/**
 * Estimate PDF viewer content styling (extracted from estimate-detail.js)
 *
 * @package Silva_Customer_Portal
 * @since 3.2.0
 */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.estimate-viewer-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.estimate-viewer-content table thead {
    background: #f9fafb;
}

.estimate-viewer-content table thead th {
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
}

.estimate-viewer-content table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.estimate-viewer-content table tbody tr:hover {
    background-color: #f9fafb;
}

.estimate-viewer-content table td,
.estimate-viewer-content table th {
    padding: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.estimate-viewer-content table tbody tr[data-total]:not([data-total=""]) td:last-child::after {
    content: attr(data-badge);
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.estimate-viewer-content img {
    max-width: 100%;
    height: auto;
}

.estimate-viewer-content h4 {
    margin: 24px 0 12px 0;
    font-size: 14px;
    font-weight: 600;
}

.estimate-viewer-content table tbody tr[style*="eff6ff"] {
    background: #eff6ff !important;
}

.estimate-viewer-content table tbody tr[style*="fff7ed"] {
    background: #fff7ed !important;
}

.estimate-viewer-content .totals-section {
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    position: sticky;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.estimate-viewer-content .totals-section .total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.estimate-viewer-content .totals-section .grand-total {
    border-top: 2px solid #86efac;
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 18px;
    color: #166534;
}

@media (max-width: 768px) {
    .estimate-viewer-content table {
        font-size: 13px;
    }

    .estimate-viewer-content table thead th {
        font-size: 11px;
    }

    .estimate-viewer-content table td,
    .estimate-viewer-content table th {
        padding: 8px;
    }

    .estimate-viewer-content table thead {
        display: none;
    }

    .estimate-viewer-content table tbody,
    .estimate-viewer-content table tr {
        display: block;
    }

    .estimate-viewer-content table tbody tr {
        margin-bottom: 16px;
        background: #ffffff;
        border: 1.5px solid #e5e7eb;
        border-radius: 8px;
        padding: 14px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        position: relative;
    }

    .estimate-viewer-content table tbody tr:hover {
        background: #ffffff;
        border-color: #d1d5db;
    }

    .estimate-viewer-content table td {
        display: block;
        padding: 6px 0;
        border: none;
        text-align: left !important;
    }

    .estimate-viewer-content table td:first-child {
        font-weight: 600;
        font-size: 15px;
        color: #111827;
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #f3f4f6;
    }

    .estimate-viewer-content table td:last-child {
        font-size: 18px;
        font-weight: 700;
        color: #059669;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #f3f4f6;
    }

    .estimate-viewer-content table td:not(:first-child):not(:last-child)::before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        min-width: 100px;
        color: #6b7280;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .estimate-viewer-content table td:nth-child(2) {
        font-style: italic;
        color: #6b7280;
        font-size: 13px;
        margin-top: 4px;
    }

    .estimate-viewer-content .totals-section {
        margin-top: 16px;
        padding: 14px;
    }

    .estimate-viewer-content .totals-section .total-row {
        font-size: 14px;
    }

    .estimate-viewer-content .totals-section .grand-total {
        font-size: 16px;
    }

    .estimate-viewer-content table tbody tr[style*="eff6ff"],
    .estimate-viewer-content table tbody tr[style*="fff7ed"] {
        display: none;
    }

    .estimate-viewer-content h4 {
        margin: 20px 0 12px 0;
        font-size: 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .estimate-viewer-content {
        font-size: 14px;
    }

    .estimate-viewer-content table td,
    .estimate-viewer-content table th {
        padding: 10px;
    }
}
