/* ============================================
   QuestIAS – News, Exam Alerts, Notifications, Banners, Contextual AI
   Keeps existing ExamHub UI/background as-is (no theme override).
   ============================================ */

/* ---- Today's News & Updates (matches existing ExamHub glass / light UI) ---- */
.questias-news-wrap {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
[data-theme="dark"] .questias-news-wrap {
    background: rgba(30, 41, 59, 0.88);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.questias-news-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: inherit;
    margin-bottom: 0.25rem;
}
.questias-news-subtitle { color: #6b7280; font-size: 0.875rem; margin-bottom: 1rem; }
[data-theme="dark"] .questias-news-subtitle { color: #94a3b8; }
.questias-news-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.questias-news-tab {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.6);
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
[data-theme="dark"] .questias-news-tab {
    border-color: rgba(71, 85, 105, 0.8);
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
}
.questias-news-tab:hover { color: #1f2937; border-color: rgba(59, 130, 246, 0.4); }
[data-theme="dark"] .questias-news-tab:hover { color: #e2e8f0; }
.questias-news-tab.active {
    color: #4338ca;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}
[data-theme="dark"] .questias-news-tab.active {
    color: #e2e8f0;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.25);
}
.questias-news-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.questias-news-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
[data-theme="dark"] .questias-news-pill {
    border-color: rgba(71, 85, 105, 0.8);
    background: rgba(30, 41, 59, 0.4);
    color: #94a3b8;
}
.questias-news-pill:hover { color: #1f2937; }
.questias-news-pill.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #4338ca;
}
[data-theme="dark"] .questias-news-pill.active {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    color: #e2e8f0;
}
.questias-news-feed {
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.questias-news-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
[data-theme="dark"] .questias-news-card {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(71, 85, 105, 0.5);
}
.questias-news-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}
[data-theme="dark"] .questias-news-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}
.questias-news-card-title { font-weight: 600; color: inherit; font-size: 0.9375rem; margin-bottom: 0.35rem; }
.questias-news-card-summary { color: #6b7280; font-size: 0.8125rem; margin-bottom: 0.5rem; line-height: 1.4; }
[data-theme="dark"] .questias-news-card-summary { color: #94a3b8; }
.questias-news-card-meta { color: #9ca3af; font-size: 0.75rem; }
[data-theme="dark"] .questias-news-card-meta { color: #64748b; }
.questias-news-card-meta .questias-news-loc {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.06);
    color: #6b7280;
    margin-left: 0.35rem;
}
[data-theme="dark"] .questias-news-card-meta .questias-news-loc {
    background: rgba(71, 85, 105, 0.5);
    color: #94a3b8;
}
.questias-news-read-more { color: #6366f1; font-size: 0.75rem; font-weight: 600; margin-top: 0.5rem; }
.questias-news-read-more:hover { color: #4f46e5; text-decoration: underline; }
[data-theme="dark"] .questias-news-read-more { color: #60a5fa; }
[data-theme="dark"] .questias-news-read-more:hover { color: #93c5fd; }

/* ---- Exam Alert (LIVE) ---- */
.questias-exam-alert {
    border: 1px solid rgba(249, 115, 22, 0.6) !important;
    box-shadow: 0 0 24px rgba(249, 115, 22, 0.2) !important;
}
.questias-live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.35rem;
    animation: questias-live-pulse 1.2s ease-in-out infinite;
}
@keyframes questias-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* ---- News Article Modal (light UI) ---- */
.questias-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.questias-modal-backdrop.show { display: flex; }
.questias-article-modal {
    background: #fff;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 1rem;
    max-width: 42rem;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
}
[data-theme="dark"] .questias-article-modal {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.15);
}
.questias-article-modal .modal-title { color: inherit; font-weight: 700; }
[data-theme="dark"] .questias-article-modal .modal-title { color: #f1f5f9; }
.questias-article-modal .modal-meta { color: #6b7280; font-size: 0.8125rem; }
[data-theme="dark"] .questias-article-modal .modal-meta { color: #94a3b8; }
.questias-article-modal .modal-body { color: #374151; font-size: 0.9375rem; line-height: 1.6; overflow-y: auto; }
[data-theme="dark"] .questias-article-modal .modal-body { color: #cbd5e1; }

/* ---- Notification popup (light UI) ---- */
.questias-notif-popup {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
}
.questias-notif-popup.show { display: flex; }
.questias-notif-popup .card {
    background: #fff;
    border: 1px solid rgba(249, 115, 22, 0.35);
    border-radius: 1rem;
    max-width: 28rem;
    box-shadow: 0 24px 48px rgba(0,0,0,0.12);
}
[data-theme="dark"] .questias-notif-popup .card {
    background: rgba(30, 41, 59, 0.98);
    box-shadow: 0 0 32px rgba(249, 115, 22, 0.2);
}
.questias-notif-popup .card-title { color: inherit; }
[data-theme="dark"] .questias-notif-popup .card-title { color: #f1f5f9; }
.questias-notif-popup .card-text { color: #6b7280; }
[data-theme="dark"] .questias-notif-popup .card-text { color: #94a3b8; }

/* ---- Missed You / Recover Streak banners (light UI) ---- */
.questias-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    padding: 1rem 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(249, 115, 22, 0.35);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.08);
    animation: questias-banner-in 0.4s ease-out;
}
[data-theme="dark"] .questias-banner {
    background: rgba(15, 23, 42, 0.98);
    border-top-color: rgba(249, 115, 22, 0.4);
    box-shadow: 0 -8px 32px rgba(249, 115, 22, 0.15);
}
.questias-banner.show { display: flex; }
.questias-banner-recover { border-top-color: rgba(16, 185, 129, 0.4); }
[data-theme="dark"] .questias-banner-recover { border-top-color: rgba(71, 85, 105, 0.6); box-shadow: 0 -8px 32px rgba(16, 185, 129, 0.1); }
@keyframes questias-banner-in {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.questias-banner-text { color: #374151; font-size: 0.9375rem; margin: 0; }
[data-theme="dark"] .questias-banner-text { color: #e2e8f0; }
.questias-banner-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.questias-banner-btn-orange {
    background: #f97316;
    color: #fff;
}
.questias-banner-btn-orange:hover { background: #ea580c; transform: scale(1.02); box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4); }
.questias-banner-btn-green {
    background: #10b981;
    color: #fff;
}
.questias-banner-btn-green:hover { background: #059669; transform: scale(1.02); box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4); }

/* ---- Contextual AI (only in learning content) ---- */
.questias-ai-bubble {
    position: fixed;
    z-index: 9990;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    animation: questias-bubble-in 0.2s ease-out;
}
@keyframes questias-bubble-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.questias-ai-trigger-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    color: #10b981;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}
.questias-content-card-with-ai { position: relative; }
.questias-content-card-with-ai:hover .questias-ai-trigger-icon { opacity: 1; }
.questias-explainer-modal .modal-content {
    background: #fff;
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 1rem;
    color: #374151;
}
[data-theme="dark"] .questias-explainer-modal .modal-content {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(16, 185, 129, 0.4);
    color: #e2e8f0;
}
.questias-explainer-modal .modal-header { border-bottom-color: rgba(0,0,0,0.08); }
.questias-explainer-modal .modal-footer { border-top-color: rgba(0,0,0,0.08); }
[data-theme="dark"] .questias-explainer-modal .modal-header { border-bottom-color: rgba(71, 85, 105, 0.6); }
[data-theme="dark"] .questias-explainer-modal .modal-footer { border-top-color: rgba(71, 85, 105, 0.6); }
.questias-explainer-dialog { max-width: 480px; }
.questias-explainer-body { min-height: 80px; line-height: 1.5; }
.questias-explainer-body.loading { color: #64748b; font-style: italic; }
.questias-explainer-list { margin: 0.5rem 0 1rem 1.25rem; padding-left: 1rem; }
.questias-explainer-list li { margin-bottom: 0.35rem; }
.questias-explainer-body .questias-mind-blowing { margin-top: 1rem; padding: 0.75rem 1rem; background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.08)); border-left: 4px solid #10b981; border-radius: 0.5rem; font-size: 0.9em; font-weight: 600; color: #0f766e; }
[data-theme="dark"] .questias-explainer-body .questias-mind-blowing { background: rgba(16, 185, 129, 0.15); color: #5eead4; border-left-color: #34d399; }
.questias-learned { text-decoration: underline; text-decoration-color: rgba(16, 185, 129, 0.6); text-underline-offset: 3px; }
.questias-short-notes-panel { position: fixed; top: 0; right: 0; width: 360px; max-width: 100%; height: 100vh; background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,0.12); z-index: 1050; display: none; flex-direction: column; overflow: hidden; }
.questias-short-notes-panel.show { display: flex !important; }
[data-theme="dark"] .questias-short-notes-panel { background: #1e293b; }
.questias-short-notes-header { padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.questias-short-notes-header h6 { margin: 0; font-weight: 700; }
.questias-short-notes-body { flex: 1; overflow-y: auto; padding: 1rem; }
.questias-short-notes-section { margin-bottom: 1.5rem; }
.questias-short-notes-section-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; margin-bottom: 0.75rem; }
.questias-short-notes-card { background: #f8fafc; border-radius: 0.5rem; padding: 0.75rem 1rem; margin-bottom: 0.75rem; border: 1px solid #e2e8f0; }
[data-theme="dark"] .questias-short-notes-card { background: #334155; border-color: #475569; }
.questias-short-notes-card-concept { font-weight: 600; color: #0f766e; margin-bottom: 0.35rem; }
.questias-short-notes-card-text { font-size: 0.875rem; line-height: 1.45; color: #475569; }
[data-theme="dark"] .questias-short-notes-card-text { color: #cbd5e1; }
.questias-short-notes-card-mind { font-size: 0.8rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed #cbd5e1; color: #059669; font-weight: 500; }
[data-theme="dark"] .questias-short-notes-card-mind { border-top-color: #475569; color: #34d399; }
.questias-short-notes-card-ref { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed #e2e8f0; }
.questias-short-notes-card-refer { font-size: 0.8rem; font-weight: 600; color: #6366f1; text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.questias-short-notes-card-refer:hover { text-decoration: underline; color: #4f46e5; }
[data-theme="dark"] .questias-short-notes-card-ref { border-top-color: #475569; }
[data-theme="dark"] .questias-short-notes-card-refer { color: #818cf8; }
[data-theme="dark"] .questias-short-notes-card-refer:hover { color: #a5b4fc; }
.questias-short-notes-empty { text-align: center; color: #94a3b8; font-size: 0.875rem; padding: 2rem 1rem; }
