/* Frontend Styles for WooCommerce Warranty Certificate Plugin */

/* Warranty Section Styles */
.wwc-warranty-section {
    background-color: #f0f8ff;
    border: 2px solid #2271b1;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.wwc-warranty-section h3 {
    color: #2271b1;
    margin: 0 0 15px 0;
    font-size: 1.2em;
}

.wwc-warranty-section p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Download Button Styles */
.wwc-download-certificate {
    background-color: #2271b1 !important;
    border-color: #2271b1 !important;
    color: white !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.wwc-download-certificate:hover {
    background-color: #1e5d8c !important;
    border-color: #1e5d8c !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.wwc-download-certificate:focus {
    outline: 3px solid rgba(34, 113, 177, 0.3) !important;
    outline-offset: 2px !important;
}

/* My Account Warranty Certificates Page */
.wwc-warranty-certificates {
    margin: 20px 0;
}

.wwc-warranty-certificates h3 {
    color: #2271b1;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.wwc-warranty-certificates .woocommerce-orders-table {
    margin-top: 20px;
}

.wwc-warranty-certificates .woocommerce-orders-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2271b1;
}

.wwc-warranty-certificates .woocommerce-orders-table td {
    vertical-align: middle;
}

/* Loading States */
.wwc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.wwc-loading-spinner {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wwc-loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: wwc-spin 1s linear infinite;
    margin: 0 auto 15px;
}

.wwc-loading-spinner p {
    margin: 0;
    color: #333;
    font-weight: bold;
}

@keyframes wwc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button Loading State */
.wwc-download-certificate.loading {
    opacity: 0.7;
    pointer-events: none;
}

.wwc-download-certificate.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: wwc-spin 1s linear infinite;
    margin-left: 8px;
}

/* Error and Success Messages */
.wwc-message {
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.wwc-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wwc-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wwc-message.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Certificate Preview Modal */
.wwc-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.wwc-preview-content {
    background-color: white;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
}

.wwc-preview-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    z-index: 1;
}

.wwc-preview-close:hover {
    color: #000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wwc-warranty-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .wwc-download-certificate {
        width: 100%;
        text-align: center;
        padding: 15px !important;
    }
    
    .wwc-warranty-certificates .woocommerce-orders-table {
        font-size: 14px;
    }
    
    .wwc-warranty-certificates .woocommerce-orders-table th,
    .wwc-warranty-certificates .woocommerce-orders-table td {
        padding: 8px 4px;
    }
    
    .wwc-preview-content {
        max-width: 95%;
        max-height: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .wwc-warranty-section h3 {
        font-size: 1.1em;
    }
    
    .wwc-warranty-certificates .woocommerce-orders-table {
        font-size: 12px;
    }
    
    .wwc-loading-spinner {
        padding: 20px;
    }
    
    .wwc-loading-spinner .spinner {
        width: 30px;
        height: 30px;
    }
}
