/**
 * Invoices Styles
 * Reuses table styles from WooCommerce and ofsy-orders module
 */

/* Modal Overlay */
.merida-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.merida-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.merida-modal-content {
    position: relative;
    background-color: #fff;
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto;
    padding: 32px;
    border-radius: 8px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.merida-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.merida-modal-close:hover {
    color: #000;
}

.merida-modal-body {
    margin-top: 24px;
}

/* Invoice Details Styling */
.invoice-details h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 1px solid #e2e2e2;
    padding-bottom: 8px;
}

.invoice-details p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
}

.invoice-details strong {
    color: #1a1a1a;
    font-weight: 600;
}

.invoice-details table {
    width: 100%;
    margin-top: 16px;
    border-collapse: collapse;
}

.invoice-details table th,
.invoice-details table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #e2e2e2;
    font-size: 0.9rem;
}

.invoice-details table th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: #1a1a1a;
}

/* PDF Download Link - uses button.primary from theme */
.invoice-pdf-download {
    margin-top: 16px;
}

/* Loading State */
.merida-modal-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.merida-modal-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* Error State */
.merida-modal-error {
    padding: 20px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .merida-modal-content {
        margin: 2vh 16px;
        padding: 24px 16px;
        max-height: 96vh;
    }

    .invoice-details table {
        font-size: 0.85rem;
    }

    .invoice-details table th,
    .invoice-details table td {
        padding: 6px 4px;
    }
}