/* QuarkCode PDF Invoices Pro - Frontend Styles */

.qc-pdf-invoice-download {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.qc-pdf-invoice-download .button {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.qc-pdf-invoice-download .button:hover {
    background: #005177;
    border-color: #005177;
    color: #fff;
    text-decoration: none;
}

.qc-pdf-invoice-download .button:before {
    content: '\f346';
    font-family: dashicons;
    margin-right: 5px;
    vertical-align: middle;
}

/* My Account Page Styles */
.woocommerce-account .woocommerce-orders-table .order-actions .button.download_invoice {
    background: #0073aa;
    color: #fff;
    border: 1px solid #0073aa;
    font-size: 12px;
    padding: 4px 8px;
    text-decoration: none;
    border-radius: 3px;
    display: inline-block;
    margin: 2px;
    transition: all 0.3s ease;
}

.woocommerce-account .woocommerce-orders-table .order-actions .button.download_invoice:hover {
    background: #005177;
    border-color: #005177;
    color: #fff;
    text-decoration: none;
}

.woocommerce-account .woocommerce-orders-table .order-actions .button.download_invoice:before {
    content: '\f346';
    font-family: dashicons;
    font-size: 10px;
    margin-right: 3px;
    vertical-align: middle;
}

/* Order Details Page */
.woocommerce-order-details .qc-pdf-invoice-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.woocommerce-order-details .qc-pdf-invoice-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.woocommerce-order-details .qc-pdf-invoice-section .invoice-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.woocommerce-order-details .qc-pdf-invoice-section .invoice-detail {
    flex: 1;
    min-width: 200px;
}

.woocommerce-order-details .qc-pdf-invoice-section .invoice-detail strong {
    display: block;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.woocommerce-order-details .qc-pdf-invoice-section .invoice-detail span {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

/* Thank You Page */
.woocommerce-order .qc-pdf-invoice-download {
    background: #e8f5e8;
    border-color: #4caf50;
    border-left: 4px solid #4caf50;
}

.woocommerce-order .qc-pdf-invoice-download .button {
    background: #4caf50;
    border-color: #4caf50;
}

.woocommerce-order .qc-pdf-invoice-download .button:hover {
    background: #45a049;
    border-color: #45a049;
}

/* Loading States */
.qc-pdf-invoice-loading {
    opacity: 0.6;
    pointer-events: none;
}

.qc-pdf-invoice-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ccc;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: qc-pdf-spin 1s linear infinite;
}

@keyframes qc-pdf-spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .woocommerce-order-details .qc-pdf-invoice-section .invoice-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .woocommerce-order-details .qc-pdf-invoice-section .invoice-detail {
        min-width: auto;
    }
    
    .qc-pdf-invoice-download {
        text-align: center;
    }
    
    .qc-pdf-invoice-download .button {
        width: 100%;
        padding: 12px 16px;
    }
    
    .woocommerce-account .woocommerce-orders-table .order-actions {
        text-align: center;
    }
    
    .woocommerce-account .woocommerce-orders-table .order-actions .button {
        display: block;
        width: 100%;
        margin: 2px 0;
    }
}

@media (max-width: 480px) {
    .woocommerce-order-details .qc-pdf-invoice-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .woocommerce-order-details .qc-pdf-invoice-section h3 {
        font-size: 16px;
    }
    
    .qc-pdf-invoice-download {
        padding: 10px;
    }
}

/* Print Styles */
@media print {
    .qc-pdf-invoice-download,
    .woocommerce-account .woocommerce-orders-table .order-actions {
        display: none;
    }
}

/* Accessibility Improvements */
.qc-pdf-invoice-download .button:focus {
    outline: 2px solid #005177;
    outline-offset: 2px;
}

.woocommerce-account .woocommerce-orders-table .order-actions .button:focus {
    outline: 2px solid #005177;
    outline-offset: 1px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .qc-pdf-invoice-download {
        border-width: 2px;
    }
    
    .qc-pdf-invoice-download .button {
        border-width: 2px;
        font-weight: bold;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .qc-pdf-invoice-download {
        background: #2c3338;
        border-color: #50575e;
        color: #f0f0f1;
    }
    
    .woocommerce-order-details .qc-pdf-invoice-section {
        background: #2c3338;
        border-color: #50575e;
        color: #f0f0f1;
    }
    
    .woocommerce-order-details .qc-pdf-invoice-section h3 {
        color: #f0f0f1;
        border-bottom-color: #50575e;
    }
    
    .woocommerce-order-details .qc-pdf-invoice-section .invoice-detail strong {
        color: #c3c4c7;
    }
    
    .woocommerce-order-details .qc-pdf-invoice-section .invoice-detail span {
        color: #f0f0f1;
    }
}

/* Animation for download success */
@keyframes qc-pdf-download-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.qc-pdf-invoice-download.success {
    animation: qc-pdf-download-success 0.3s ease;
}

/* Error states */
.qc-pdf-invoice-error {
    background: #fef2f2;
    border-color: #dc3232;
    color: #721c24;
}

.qc-pdf-invoice-error .button {
    background: #dc3232;
    border-color: #dc3232;
}

.qc-pdf-invoice-error .button:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}
