/* ============================================================
   ACT Expert Research — Modal & Button Styles (Light Palette v2)
   ============================================================ */

/* --- Expert Research Button (card variant) --- */
.expert-research-btn-card {
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 50%, #1E88E5 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    letter-spacing: 0.3px;
}
.expert-research-btn-card:hover {
    background: linear-gradient(135deg, #1565C0 0%, #1E88E5 50%, #42A5F5 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.4);
}

/* --- Expert Research Button (hero variant) --- */
.expert-research-btn-hero {
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}
.expert-research-btn-hero:hover {
    background: linear-gradient(135deg, #1565C0 0%, #1E88E5 100%) !important;
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.4);
}

/* --- Modal Overlay --- */
#expert-research-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10500;
    display: none;
    align-items: center;
    justify-content: center;
    animation: erFadeIn 0.25s ease;
}
#expert-research-modal-overlay.active {
    display: flex;
}
@keyframes erFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Modal Container (LIGHT) --- */
.er-modal {
    background: #ffffff;
    border-radius: 12px;
    width: 92%;
    max-width: 1100px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

/* --- Modal Header (keep branded blue) --- */
.er-modal-header {
    background: linear-gradient(135deg, #0D47A1, #1565C0);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.er-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.er-modal-header h3 i {
    color: #FFD700;
}

/* --- Header Action Buttons --- */
.er-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.er-header-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.er-header-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}
.er-header-btn.er-btn-print { color: #90CAF9; }
.er-header-btn.er-btn-download { color: #A5D6A7; }
.er-header-btn.er-btn-brief { color: #FFD54F; }
.er-header-btn.er-btn-blitz { color: #EF9A9A; }
.er-header-btn.er-btn-close {
    background: rgba(244,67,54,0.3);
    border-color: rgba(244,67,54,0.5);
    color: #EF9A9A;
}
.er-header-btn.er-btn-close:hover {
    background: rgba(244,67,54,0.5);
}

/* --- Modal Body (LIGHT) --- */
.er-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 30px;
    color: #333333;
    font-size: 0.92rem;
    line-height: 1.7;
    background: #ffffff;
}
.er-modal-body::-webkit-scrollbar { width: 8px; }
.er-modal-body::-webkit-scrollbar-track { background: #f5f5f5; }
.er-modal-body::-webkit-scrollbar-thumb { background: #bdbdbd; border-radius: 4px; }
.er-modal-body::-webkit-scrollbar-thumb:hover { background: #9e9e9e; }

/* --- Report Content Styling (LIGHT) --- */
.er-report-content h1 {
    color: #0D47A1;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    border-bottom: 2px solid #1E88E5;
    padding-bottom: 8px;
}
.er-report-content h2 {
    color: #1565C0;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 12px;
    border-left: 4px solid #1E88E5;
    padding-left: 12px;
}
.er-report-content h3 {
    color: #1976D2;
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
}
.er-report-content p {
    margin-bottom: 12px;
    color: #333;
}
.er-report-content strong {
    color: #0D47A1;
}
.er-report-content blockquote {
    border-left: 4px solid #FFB300;
    background: #FFF8E1;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #5D4037;
}
.er-report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.85rem;
}
.er-report-content table th {
    background: #E3F2FD;
    color: #0D47A1;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #1E88E5;
    font-weight: 700;
}
.er-report-content table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}
.er-report-content table tr:hover td {
    background: #F5F9FF;
}
.er-report-content ul, .er-report-content ol {
    padding-left: 24px;
    margin-bottom: 12px;
}
.er-report-content li {
    margin-bottom: 6px;
    color: #333;
}
.er-report-content a {
    color: #1565C0;
    text-decoration: underline;
}

/* --- Loading State (LIGHT) --- */
.er-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}
.er-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #E3F2FD;
    border-top: 4px solid #1E88E5;
    border-radius: 50%;
    animation: erSpin 1s linear infinite;
}
@keyframes erSpin {
    to { transform: rotate(360deg); }
}
.er-loading-text {
    color: #1565C0;
    font-size: 1rem;
    font-weight: 600;
}
.er-loading-subtext {
    color: #546E7A;
    font-size: 0.85rem;
    max-width: 500px;
    text-align: center;
    line-height: 1.5;
}
.er-progress-bar {
    width: 300px;
    height: 6px;
    background: #E3F2FD;
    border-radius: 3px;
    overflow: hidden;
}
.er-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1E88E5, #42A5F5);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
    animation: erPulse 2s ease-in-out infinite;
}
@keyframes erPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Error state (LIGHT) --- */
.er-loading .fa-exclamation-triangle {
    color: #D32F2F !important;
}

/* --- Modal Footer (LIGHT) --- */
.er-modal-footer {
    background: #f5f5f5;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #757575;
}

/* ============================================================
   PRINT STYLES — Only print the modal content, hide everything else
   ============================================================ */
@media print {
    /* Hide EVERYTHING on the page */
    body > * {
        display: none !important;
        visibility: hidden !important;
    }

    /* Show ONLY the modal overlay and its children */
    #expert-research-modal-overlay,
    #expert-research-modal-overlay * {
        visibility: visible !important;
    }
    #expert-research-modal-overlay {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        background: white !important;
        z-index: 99999 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    .er-modal {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }
    /* Hide the header bar and footer in print */
    .er-modal-header { display: none !important; }
    .er-modal-footer { display: none !important; }

    .er-modal-body {
        color: #000 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: white !important;
        height: auto !important;
    }
    .er-report-content h1 { color: #000 !important; border-color: #000 !important; }
    .er-report-content h2 { color: #333 !important; border-color: #333 !important; }
    .er-report-content h3 { color: #555 !important; }
    .er-report-content p, .er-report-content li, .er-report-content td { color: #000 !important; }
    .er-report-content strong { color: #000 !important; }
    .er-report-content blockquote { color: #333 !important; border-color: #333 !important; background: #f5f5f5 !important; }
    .er-report-content table th { background: #eee !important; color: #000 !important; border-color: #333 !important; }
    .er-report-content table td { color: #000 !important; border-color: #ccc !important; }
    .er-report-content a { color: #000 !important; }
}
