/* Custom Dark Mode Overrides */
[data-theme="dark"] {
    /* Base Variables */
    --bg-page: #1a1a27;
    --bg-surface: #1e1e2d;
    --bg-drawer: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #33323e;
}

/* Base Elements */
[data-theme="dark"] body, 
[data-theme="dark"] main, 
[data-theme="dark"] .page {
    background: var(--bg-page) !important;
    background-image: none !important;
    color: var(--text-primary) !important;
}

/* Layout Elements */
[data-theme="dark"] .nav-logo,
[data-theme="dark"] .responsive-logo {
    content: url('/assets/images/NurzWhite.png') !important;
}

[data-theme="dark"] .top-row {
    background-color: var(--bg-page) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .sidebar {
    background-color: var(--bg-drawer) !important;
    border-left: 1px solid var(--border-color) !important;
}

/* Cards & Containers */
[data-theme="dark"] .mud-card, 
[data-theme="dark"] .rounded-card,
[data-theme="dark"] .bg-white {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .rounded-card.course-details {
    background-color: rgba(var(--Primary_rgba), 0.20) !important;
    color: var(--text-primary) !important;
    background-repeat: no-repeat !important;
    background-position: right top !important;
    background-size: auto 75% !important;
    transition: all 0.3s ease;
}

[data-theme="dark"] .rounded-card.course-details:hover {
    background-color: rgba(var(--Quaternary_rgba), 1) !important;
    color: var(--Primary) !important;
}

[data-theme="dark"] .rounded-card.course-details h4,
[data-theme="dark"] .rounded-card.course-details h5,
[data-theme="dark"] .rounded-card.course-details h6,
[data-theme="dark"] .rounded-card.course-details .mud-typography {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .rounded-card.course-details:hover h4,
[data-theme="dark"] .rounded-card.course-details:hover h5,
[data-theme="dark"] .rounded-card.course-details:hover h6,
[data-theme="dark"] .rounded-card.course-details:hover .mud-typography {
    color: var(--Primary) !important;
}

[data-theme="dark"] .mud-breadcrumb-item.mud-disabled > a,
[data-theme="dark"] .mud-breadcrumb-item > a,
[data-theme="dark"] .mud-primary-text {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .mud-button-filled-primary {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-gray-50 {
    background-color: #151521 !important;
}

[data-theme="dark"] .bg-gray-100 {
    background-color: var(--bg-surface) !important;
}

[data-theme="dark"] .bg-gray-800 {
    background-color: #2a2833 !important;
}

/* Text Colors */
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-900 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-gray-600 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, 
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

/* Borders */
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300,
[data-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

/* Podium Cards */
[data-theme="dark"] .rounded-card.score-podium-1,
[data-theme="dark"] .rounded-card.score-podium-2,
[data-theme="dark"] .rounded-card.score-podium-3,
[data-theme="dark"] .rounded-card.score-podium-4,
[data-theme="dark"] .rounded-card.score-podium-5 {
    background-color: #1a2c30 !important;
}

[data-theme="dark"] .rounded-card.score-podium-2,
[data-theme="dark"] .rounded-card.score-podium-3,
[data-theme="dark"] .rounded-card.score-podium-4,
[data-theme="dark"] .rounded-card.score-podium-5 {
    color: var(--text-primary) !important;
}

/* Specific Teacher App Styles */
[data-theme="dark"] .teacher-panel-text {
    color: white !important;
}

/* Fix MudBlazor Inputs in Dark Mode */
[data-theme="dark"] .mud-input {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .mud-input-label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .mud-input.mud-disabled,
[data-theme="dark"] .mud-input-control.mud-disabled .mud-input {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1 !important;
}

[data-theme="dark"] .mud-input-label.mud-disabled {
    color: rgba(255, 255, 255, 0.5) !important;
}

[data-theme="dark"] .mud-input-outlined-border {
    border-color: var(--border-color) !important;
}

/* Overlays */
[data-theme="dark"] .mud-overlay .mud-overlay-scrim.mud-overlay-light {
    background-color: rgba(26, 26, 39, 0.85) !important; /* Maps to --bg-page with opacity */
}

/* Tabs */
[data-theme="dark"] .mud-tab {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .mud-tab.mud-tab-active {
    color: var(--Primary) !important;
}

/* Quiz List & Quiz Player Dark Mode Overrides */
[data-theme="dark"] .quiz-card,
[data-theme="dark"] .qz-card {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .quiz-title,
[data-theme="dark"] .qz-question-title,
[data-theme="dark"] .qz-card-title,
[data-theme="dark"] .qz-header-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .quiz-desc,
[data-theme="dark"] .qz-card-subtitle,
[data-theme="dark"] .qz-ctrl-page-text,
[data-theme="dark"] .qz-header-sub {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .quiz-btn {
    background: #181824 !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .quiz-card:hover .quiz-btn {
    background: var(--Primary) !important;
    color: white !important;
}

[data-theme="dark"] .quiz-btn-answers {
    background: rgba(0, 128, 128, 0.15) !important;
    border-color: rgba(0, 128, 128, 0.35) !important;
    color: #4dd0e1 !important;
}

[data-theme="dark"] .quiz-btn-answers:hover {
    background: var(--Primary) !important;
    color: white !important;
}

[data-theme="dark"] .qz-timer {
    background: linear-gradient(135deg, rgba(255, 111, 97, 0.15), rgba(255, 235, 59, 0.08)) !important;
    border-color: rgba(255, 111, 97, 0.3) !important;
    color: #ff8a80 !important;
}

[data-theme="dark"] .qz-q-num {
    background: rgba(0, 128, 128, 0.2) !important;
    color: #4dd0e1 !important;
}

[data-theme="dark"] .qz-points {
    background: #151521 !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .qz-ans {
    background: #151521 !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .qz-ans:hover {
    background: #202030 !important;
    border-color: rgba(0, 128, 128, 0.4) !important;
}

[data-theme="dark"] .qz-ans.selected {
    background: rgba(0, 128, 128, 0.15) !important;
    border-color: var(--Primary) !important;
}

[data-theme="dark"] .qz-ans-check {
    border-color: #525164 !important;
}

[data-theme="dark"] .qz-ans.selected .qz-ans-check {
    border-color: var(--Primary) !important;
    background: var(--Primary) !important;
    color: white !important;
}

[data-theme="dark"] .qz-ans-text {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .qz-ans.selected .qz-ans-text {
    color: #80cbc4 !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .qz-start-info-box,
[data-theme="dark"] .qz-score-box,
[data-theme="dark"] .qz-last-attempt-box {
    background: #151521 !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .qz-start-info-box span,
[data-theme="dark"] .qz-start-info-box strong,
[data-theme="dark"] .qz-info-text,
[data-theme="dark"] .qz-attempt-heading,
[data-theme="dark"] .qz-score-summary,
[data-theme="dark"] .qz-score-highlight {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .qz-passing-pill {
    background: #1e1e2d !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .qz-passing-text {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .qz-review-ans {
    background: #151521 !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .qz-review-ans.review-correct {
    background: rgba(76, 175, 80, 0.12) !important;
    border-color: #4caf50 !important;
}

[data-theme="dark"] .qz-review-ans.review-wrong {
    background: rgba(244, 67, 54, 0.12) !important;
    border-color: #f44336 !important;
}

/* Store Page Dark Overrides */
[data-theme="dark"] .store-card {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .store-card-title {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .store-card-desc {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .store-card-image-box {
    background: radial-gradient(circle at 50% 45%, #252836 0%, #1a1a27 100%) !important;
    border-bottom-color: var(--border-color) !important;
}
[data-theme="dark"] .store-hero-header {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .store-hero-title {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .store-hero-subtitle {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .store-wallet-card {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}
[data-theme="dark"] .store-modal {
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-item-summary {
    background: var(--bg-page) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] .modal-title,
[data-theme="dark"] .modal-item-title {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .modal-item-desc {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .modal-cost-row {
    color: var(--text-primary) !important;
}

/* ============================================================
   DAILY STREAK WIDGET — Dark Mode
   ============================================================ */
[data-theme="dark"] .streak-floating-card {
    background: #1e1e2d !important;
    border-color: rgba(249, 115, 22, 0.35) !important;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.75), 0 0 25px rgba(249, 115, 22, 0.2) !important;
}
[data-theme="dark"] .streak-speech-bubble {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
}
[data-theme="dark"] .streak-speech-tail {
    background: #251e22 !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
}
[data-theme="dark"] .streak-speech-text {
    color: #fed7aa !important;
}
[data-theme="dark"] .streak-question-box {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}
[data-theme="dark"] .streak-question-tag {
    color: #94a3b8 !important;
}
[data-theme="dark"] .streak-question-text {
    color: #f8fafc !important;
}
[data-theme="dark"] .streak-choice-btn {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .streak-choice-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
}
[data-theme="dark"] .streak-choice-btn .streak-choice-badge {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .streak-choice-btn.selected {
    border-color: #f97316 !important;
    background: rgba(249, 115, 22, 0.18) !important;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.25) !important;
}
[data-theme="dark"] .streak-choice-btn.selected .streak-choice-badge {
    background: #f97316 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .streak-choice-btn.selected .streak-choice-text {
    color: #ffedd5 !important;
}
[data-theme="dark"] .streak-input-label {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .streak-textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}
[data-theme="dark"] .streak-secondary-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .streak-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
}
[data-theme="dark"] .streak-reward-pill {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: rgba(249, 115, 22, 0.25) !important;
    color: #fed7aa !important;
}
[data-theme="dark"] .streak-card-title {
    color: #f8fafc !important;
}
[data-theme="dark"] .streak-card-subtitle {
    color: #94a3b8 !important;
}

