* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
}

/* =============================================
   SECTION COLOR THEMES
   ============================================= */

/* MCQ Section Theme - Cyan/Teal Accents */
.mcq-theme {
    --theme-primary: #06b6d4;
    --theme-secondary: #0891b2;
    --theme-gradient: linear-gradient(135deg, #06b6d4, #0891b2);
    --theme-glow: rgba(6, 182, 212, 0.3);
    --theme-border: rgba(6, 182, 212, 0.3);
    --theme-bg: rgba(6, 182, 212, 0.05);
}

.mcq-theme .section-title i {
    color: var(--theme-primary);
}

.mcq-theme .section-title {
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mcq-theme .challenge-card,
.mcq-theme .bank-question {
    border: 1px solid var(--theme-border);
    background: var(--theme-bg);
}

.mcq-theme .start-btn,
.mcq-theme .nav-btn.primary {
    background: var(--theme-gradient);
}

.mcq-theme .challenge-icon {
    text-shadow: 0 0 20px var(--theme-glow);
}

/* Essay Section Theme - Purple/Violet Accents */
.essay-theme {
    --theme-primary: #8b5cf6;
    --theme-secondary: #7c3aed;
    --theme-gradient: linear-gradient(135deg, #8b5cf6, #7c3aed);
    --theme-glow: rgba(139, 92, 246, 0.3);
    --theme-border: rgba(139, 92, 246, 0.3);
    --theme-bg: rgba(139, 92, 246, 0.05);
}

.essay-theme .section-title i {
    color: var(--theme-primary);
}

.essay-theme .section-title {
    background: var(--theme-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.essay-theme .essay-question-item,
.essay-theme .essay-challenge-intro {
    border: 1px solid var(--theme-border);
}

.essay-theme .start-btn {
    background: var(--theme-gradient);
}

/* =============================================
   NAVIGATION BAR - CLEAN & RESPONSIVE
   ============================================= */

.subject-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    padding: 0 15px;
}

@supports (padding: env(safe-area-inset-top)) {
    .subject-navbar {
        padding-top: env(safe-area-inset-top);
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 70px;
    gap: 15px;
    position: relative;
}

/* Back Button - DESKTOP: After nav links, before logo */
.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 10px;
    flex-shrink: 0;
    min-width: 60px;
    text-align: center;
    order: 2;
}

.nav-brand i {
    font-size: 1.2rem;
}

.nav-brand span {
    font-size: 0.65rem;
    white-space: nowrap;
}

.nav-brand:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Subject Title - DESKTOP: Far right */
.nav-subject-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
    order: 1;
}

/* Mobile Menu Toggle - Hidden on desktop */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    display: none;
}

.mobile-menu-toggle:hover {
    color: #fff;
}

/* Navigation Links - DESKTOP: Compact, professional layout */
.nav-links {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 15px;
    flex: 1;
    order: 3;
    margin-left: 185px;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.nav-link i {
    font-size: 1.25rem;
}

.nav-link span {
    display: block;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0.9;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* =============================================
   MOBILE (max-width: 900px) - Simple Top Bar + Dropdown
   ============================================= */
@media (max-width: 900px) {
    .nav-container {
        min-height: 50px;
        gap: 0;
    }

    /* Mobile: Toggle on RIGHT */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        order: 3;
        padding: 12px;
    }

    /* Mobile: Subject title in CENTER */
    .nav-subject-title {
        order: 2;
        flex: 1;
        justify-content: center;
        font-size: 1rem;
    }

    /* Mobile: Back button on LEFT */
    .nav-brand {
        order: 1;
        flex-direction: row;
        gap: 0;
        min-width: auto;
        padding: 12px;
    }

    .nav-brand span {
        display: none;
    }

    /* Dropdown menu - hidden by default on mobile */
    .nav-links {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-left: 0;
        background: rgba(26, 26, 46, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        gap: 5px;
    }

    .nav-links.active {
        display: flex !important;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Mobile nav links - horizontal layout with icon + text */
    .nav-link {
        flex-direction: row;
        justify-content: flex-start;
        padding: 14px 18px;
        width: 100%;
        gap: 15px;
        min-width: auto;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.03);
    }

    .nav-link i {
        font-size: 1.2rem;
        width: 28px;
        text-align: center;
    }

    .nav-link span {
        font-size: 1rem;
        opacity: 1;
    }

    .nav-link:hover,
    .nav-link.active {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    }
}

/* =============================================
   SMALL MOBILE (max-width: 480px)
   ============================================= */
@media (max-width: 480px) {
    .nav-container {
        min-height: 45px;
    }

    .nav-subject-title {
        font-size: 0.9rem;
    }

    .mobile-menu-toggle {
        padding: 10px;
    }

    .nav-brand {
        padding: 10px;
    }

    .nav-link {
        padding: 12px 15px;
    }
}

/* Hero Section */
.subject-hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 60px;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.subject-badge {
    width: 120px;
    height: 120px;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 30px;
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.4);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 auto 15px;
    width: 100%;
    padding: 0;
    background: linear-gradient(90deg, #fff, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content>p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 auto 40px;
    text-align: center;
    padding: 0;
    width: 100%;
    max-width: 600px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-weight: 600;
}

.hero-stat i {
    color: #667eea;
    font-size: 1.2rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 35px;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Sections */
.section {
    padding: 100px 20px;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-title i {
    color: #667eea;
}

.section-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin-bottom: 50px;
}

/* Challenge Section */
.challenge-section {
    background: linear-gradient(180deg, transparent, rgba(102, 126, 234, 0.05));
}

.challenge-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.challenge-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.challenge-card h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.challenge-card>p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.challenge-rules {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.rule {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    min-width: 80px;
}

.rule i {
    font-size: 1.3rem;
    color: #667eea;
}

.name-input-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.name-input-box label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.name-input-box input {
    width: 100%;
    max-width: 300px;
    padding: 15px 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    text-align: center;
    transition: all 0.3s ease;
}

.name-input-box input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.start-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* Challenge Container */
.challenge-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.timer {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 217, 255, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    color: #00d9ff;
    font-size: 1.2rem;
    font-weight: 700;
}

.timer.warning {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.7;
    }
}

.progress {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 193, 7, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    color: #ffc107;
    font-weight: 700;
}

.question-box {
    margin-bottom: 30px;
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.question-text {
    font-size: 1.3rem;
    line-height: 1.8;
    font-weight: 600;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.option-btn {
    padding: 18px 25px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: right;
}

.option-btn:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.1);
}

.option-btn.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.option-letter {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.option-btn.selected .option-letter {
    background: #667eea;
}

.challenge-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.nav-btn.success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

/* Challenge Result */
.challenge-result {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 50px;
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.challenge-result h2 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, #00d9ff, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.restart-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* Bank Section */
.bank-section {
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.05), transparent);
}

.bank-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.questions-count {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bank-question-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
}

.bank-question-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(102, 126, 234, 0.3);
}

.bank-question-header h4 {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #fff;
}

.bank-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.bank-option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
    width: 100%;
}

.bank-option-btn:hover:not(:disabled) {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(-5px);
}

.bank-option-btn .option-letter {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.bank-option-btn .option-text {
    flex: 1;
}

.bank-option-btn .option-icon {
    width: 25px;
    text-align: center;
}

.bank-option-btn.correct {
    border-color: #38ef7d !important;
    background: rgba(56, 239, 125, 0.15) !important;
}

.bank-option-btn.correct .option-letter {
    background: #38ef7d;
    color: #000;
}

.bank-option-btn.correct .option-icon {
    color: #38ef7d;
}

.bank-option-btn.wrong {
    border-color: #ff5252 !important;
    background: rgba(255, 82, 82, 0.15) !important;
}

.bank-option-btn.wrong .option-letter {
    background: #ff5252;
    color: #fff;
}

.bank-option-btn.wrong .option-icon {
    color: #ff5252;
}

.bank-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.bank-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.show-answer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 25px;
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.show-answer-btn:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
}

.answer-reveal {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #38ef7d;
    font-weight: 600;
}

.answer-reveal i {
    font-size: 1.2rem;
}

.bank-feedback {
    margin-top: 15px;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.bank-feedback.correct {
    background: rgba(56, 239, 125, 0.1);
    border: 1px solid rgba(56, 239, 125, 0.3);
    color: #38ef7d;
}

.bank-feedback.wrong {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #ff5252;
}

.bank-feedback i {
    font-size: 1.3rem;
}

/* Show More Button */
.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px;
    margin-top: 10px;
    border: 2px dashed rgba(102, 126, 234, 0.4);
    border-radius: 15px;
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
    font-family: 'Cairo', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.show-more-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    transform: translateY(-2px);
}

.show-more-btn i {
    transition: transform 0.3s ease;
}

.show-more-btn:hover i {
    transform: translateY(3px);
}

/* Bilingual Question Styles */
.bilingual-question {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bilingual-question .q-ar {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #fff;
}

.bilingual-question .q-en {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    direction: ltr;
    text-align: left;
}

.lang-label {
    font-style: normal;
    margin-left: 5px;
}

.question-en {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-top: 5px;
    margin-bottom: 15px;
    direction: ltr;
    text-align: left;
}

.essay-question-item .question-en {
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.answer-section {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.answer-section:last-child {
    margin-bottom: 0;
}

.answer-section strong {
    display: block;
    margin-bottom: 8px;
    color: #38ef7d;
}

.answer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin: 0;
}

.essay-score-card .question-en {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 10px;
}


/* Leaderboard Section */

.leaderboard-section {
    background: linear-gradient(180deg, transparent, rgba(255, 193, 7, 0.03));
}

.leaderboard-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    overflow: hidden;
}

.leaderboard-header {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 25px;
    border-radius: 30px;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.leaderboard-container {
    padding: 0 20px 20px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 18px 20px;
    text-align: center;
}

.leaderboard-table th {
    background: rgba(102, 126, 234, 0.2);
    font-weight: 700;
    color: #667eea;
}

.leaderboard-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-table tbody tr:first-child td {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    font-weight: 700;
}

.leaderboard-table tbody tr:nth-child(2) td {
    background: rgba(192, 192, 192, 0.1);
    color: #c0c0c0;
}

.leaderboard-table tbody tr:nth-child(3) td {
    background: rgba(205, 127, 50, 0.1);
    color: #cd7f32;
}

.no-records {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

/* AI Section */
.ai-section {
    background: linear-gradient(180deg, rgba(255, 193, 7, 0.03), rgba(102, 126, 234, 0.05));
}

.ai-chat-container {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    overflow: hidden;
}

.ai-messages {
    height: 400px;
    overflow-y: auto;
    padding: 25px;
}

.ai-message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message.user .message-avatar {
    background: linear-gradient(135deg, #38ef7d, #11998e);
}

.message-content {
    max-width: 80%;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 15px;
    line-height: 1.6;
}

.ai-message.user .message-content {
    background: rgba(102, 126, 234, 0.2);
}

.ai-input-container {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-input-container textarea {
    flex: 1;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    resize: none;
}

.ai-input-container textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.ai-input-container textarea:focus {
    outline: none;
    border-color: #667eea;
}

.ai-send-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-send-btn:hover {
    transform: scale(1.1);
}

/* Footer */
.subject-footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.subject-footer a {
    color: #667eea;
    text-decoration: none;
}

/* Responsive - Non-navbar elements */
@media (max-width: 768px) {
    /* NOTE: Navbar styles defined at top of file - don't duplicate here! */

    .subject-hero-section {
        padding-top: 100px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .subject-badge {
        width: 90px;
        height: 90px;
        font-size: 2rem;
    }

    .hero-stats {
        gap: 15px;
    }

    .hero-stat {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .section {
        padding: 80px 15px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .challenge-card {
        padding: 30px 20px;
    }

    .challenge-container {
        padding: 25px 20px;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .bank-controls {
        flex-direction: column;
    }

    .search-box {
        max-width: 100%;
    }
}

/* Essay Section */
.essay-section {
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.05));
}

.essay-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px;
}

.essay-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.essay-card h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.essay-card>p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.essay-rules {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.essay-start {
    background: linear-gradient(135deg, #f093fb, #f5576c) !important;
}

.essay-start:hover {
    box-shadow: 0 15px 40px rgba(240, 147, 251, 0.4) !important;
}

/* Essay Container */
.essay-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto 50px;
}

.essay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.essay-timer {
    background: rgba(240, 147, 251, 0.1) !important;
    color: #f093fb !important;
}

.essay-question-card {
    margin-bottom: 30px;
}

.essay-answer {
    width: 100%;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
    min-height: 150px;
    transition: all 0.3s ease;
}

.essay-answer:focus {
    outline: none;
    border-color: #f093fb;
    background: rgba(240, 147, 251, 0.05);
}

.essay-answer::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.essay-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Essay Result */
.essay-result {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 50px;
}

.grading-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f093fb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.essay-scores {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.essay-score-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: right;
}

.essay-score-card h4 {
    margin-bottom: 10px;
    color: #f093fb;
}

.essay-score-card .question {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.essay-score-card .answer {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.essay-score-card .feedback {
    padding: 15px;
    background: rgba(56, 239, 125, 0.1);
    border-radius: 10px;
    color: #38ef7d;
}

.essay-score-card .score-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    padding: 5px 15px;
    border-radius: 20px;
    margin-top: 10px;
}

/* Essay Bank */
.essay-bank {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 30px;
    margin-top: 50px;
}

.essay-bank h3 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.essay-bank h3 i {
    color: #f093fb;
}

.essay-bank-search {
    position: relative;
    margin-bottom: 20px;
}

.essay-bank-search i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.essay-bank-search input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.essay-bank-search input:focus {
    outline: none;
    border-color: #f093fb;
}

.essay-questions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.essay-question-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.essay-question-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(240, 147, 251, 0.3);
}

.essay-question-item h4 {
    margin-bottom: 0;
    color: #fff;
}

.essay-question-item .model-answer {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

.essay-question-item.expanded .model-answer {
    display: block;
}

.essay-question-item .model-answer strong {
    color: #38ef7d;
}

/* Bilingual MCQ Support */
.bilingual-mcq {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bilingual-mcq .q-ar,
.bilingual-mcq .q-en {
    margin: 0;
    line-height: 1.6;
}

.bilingual-mcq .q-ar {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.bilingual-mcq .q-en {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

.bank-question-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.bank-question-header h4 {
    flex-shrink: 0;
    margin: 0;
    color: #38ef7d;
    font-size: 1.1rem;
}

.bank-question-header .bilingual-mcq {
    flex: 1;
}

/* Question text in challenge also supports bilingual */
.question-text .bilingual-mcq {
    text-align: right;
}

.question-text .bilingual-mcq .q-ar {
    font-size: 1.3rem;
}

.question-text .bilingual-mcq .q-en {
    font-size: 1.3rem;
    margin-top: 10px;
}

.question-text .bilingual-mcq .q-ar {
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Bilingual Options (English main, Arabic translation below) */
.option-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
}

.option-text .opt-en {
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
}

.option-text .opt-ar {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.option-btn {
    text-align: left;
}

.bank-option-btn .option-text {
    text-align: left;
}

.bank-option-btn .option-text .opt-en {
    font-size: 0.95rem;
}

.bank-option-btn .option-text .opt-ar {
    font-size: 0.8rem;
}

/* NOTE: Mobile navbar styles are defined at the top of this file (lines 162-254)
   with the dropdown menu system. Do not add conflicting styles here! */

/* Mobile Responsive Styles for non-navbar elements */
@media (max-width: 900px) {

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content>p {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 10px;
    }

    .hero-stat {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .subject-badge {
        width: 90px;
        height: 90px;
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .nav-brand span {
        display: none;
    }

    .nav-subject-title {
        font-size: 0.9rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content>p {
        font-size: 1rem;
    }

    .subject-badge {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        border-radius: 20px;
    }

    .challenge-card {
        padding: 30px 20px;
    }

    .section {
        padding: 60px 15px;
    }

    .section-title {
        font-size: 1.8rem;
    }
}

/* ========================================
   THEME SYSTEM
   ======================================== */

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    z-index: 1001;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

/* Smooth transitions for theme changes */
.subject-navbar,
.section,
.subject-hero-section,
.challenge-card,
footer {
    transition: all 0.5s ease;
}

/* ========================================
   SPACE THEME
   ======================================== */
body.space-theme {
    background: #05051a;
}

body.space-theme .subject-navbar {
    background: rgba(10, 10, 42, 0.95);
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
}

body.space-theme .subject-hero-section {
    background: linear-gradient(135deg, #0a0a2a 0%, #1a1a4a 50%, #4a1a6a 100%);
}

body.space-theme .section {
    background: linear-gradient(180deg, #0a0a2a 0%, #05051a 100%);
}

body.space-theme h1,
body.space-theme h2,
body.space-theme h3,
body.space-theme .section-title {
    color: #00ffff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

body.space-theme .challenge-card {
    background: linear-gradient(145deg, rgba(26, 26, 74, 0.8) 0%, rgba(74, 26, 106, 0.6) 100%);
    border: 2px solid rgba(0, 255, 255, 0.15);
}

body.space-theme .challenge-card:hover {
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

body.space-theme .btn-primary {
    background: linear-gradient(45deg, #00ffff, #1a1a4a);
    color: #0a0a2a;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

body.space-theme .btn-secondary {
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
}

body.space-theme footer {
    background: rgba(10, 10, 42, 0.9);
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}

body.space-theme .theme-toggle {
    background: linear-gradient(135deg, #00ffff, #4a1a6a);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

/* Stars animation */
body.space-theme::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: transparent url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMDAiIGN5PSIxMDAiIHI9IjAuNSIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==') repeat;
    animation: moveStars 200s linear infinite;
    opacity: 0.4;
}

@keyframes moveStars {
    from {
        transform: translateY(0) translateX(0);
    }

    to {
        transform: translateY(-1000px) translateX(-500px);
    }
}

/* Space planets */
.space-planet {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    filter: blur(1px);
    display: none;
}

body.space-theme .space-planet {
    display: block;
}

.planet-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 30% 30%, #4a1a6a, #1a1a4a);
    top: 10%;
    right: 5%;
    animation: floatPlanet 25s infinite ease-in-out;
    box-shadow: 0 0 50px rgba(74, 26, 106, 0.5);
}

.planet-2 {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 40% 40%, #1a4a4a, #0a2a2a);
    bottom: 15%;
    left: 8%;
    animation: floatPlanet 20s infinite ease-in-out reverse;
    box-shadow: 0 0 40px rgba(26, 74, 74, 0.5);
}

@keyframes floatPlanet {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(180deg);
    }
}

/* ========================================
   OCEAN THEME
   ======================================== */
body.ocean-theme {
    background: linear-gradient(180deg, #0a2942 0%, #051a2d 100%);
}

body.ocean-theme .subject-navbar {
    background: rgba(10, 41, 66, 0.95);
    border-bottom: 2px solid rgba(0, 200, 255, 0.3);
}

body.ocean-theme .subject-hero-section {
    background: linear-gradient(135deg, #0a2942 0%, #1a5a7a 50%, #0a4060 100%);
}

body.ocean-theme .section {
    background: linear-gradient(180deg, #0a2942 0%, #051a2d 100%);
}

body.ocean-theme h1,
body.ocean-theme h2,
body.ocean-theme h3,
body.ocean-theme .section-title {
    color: #00d4ff;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

body.ocean-theme .challenge-card {
    background: linear-gradient(145deg, rgba(10, 60, 90, 0.8) 0%, rgba(5, 40, 70, 0.6) 100%);
    border: 2px solid rgba(0, 200, 255, 0.2);
}

body.ocean-theme .btn-primary {
    background: linear-gradient(45deg, #00d4ff, #0a4060);
    color: #051a2d;
}

body.ocean-theme .theme-toggle {
    background: linear-gradient(135deg, #00d4ff, #0a4060);
}

/* ========================================
   SUNSET THEME
   ======================================== */
body.sunset-theme {
    background: linear-gradient(180deg, #2d1f3d 0%, #1a1020 100%);
}

body.sunset-theme .subject-navbar {
    background: rgba(45, 31, 61, 0.95);
    border-bottom: 2px solid rgba(255, 120, 100, 0.3);
}

body.sunset-theme .subject-hero-section {
    background: linear-gradient(135deg, #2d1f3d 0%, #6a3050 50%, #4a2040 100%);
}

body.sunset-theme .section {
    background: linear-gradient(180deg, #2d1f3d 0%, #1a1020 100%);
}

body.sunset-theme h1,
body.sunset-theme h2,
body.sunset-theme h3,
body.sunset-theme .section-title {
    color: #ff9a6c;
    text-shadow: 0 0 15px rgba(255, 154, 108, 0.4);
}

body.sunset-theme .challenge-card {
    background: linear-gradient(145deg, rgba(106, 48, 80, 0.8) 0%, rgba(74, 32, 64, 0.6) 100%);
    border: 2px solid rgba(255, 120, 100, 0.2);
}

body.sunset-theme .btn-primary {
    background: linear-gradient(45deg, #ff9a6c, #6a3050);
    color: #1a1020;
}

body.sunset-theme .theme-toggle {
    background: linear-gradient(135deg, #ff9a6c, #6a3050);
}

/* ========================================
   PYRAMIDS THEME
   ======================================== */
body.pyramids-theme {
    background: linear-gradient(180deg, #1a1510 0%, #2d2015 50%, #1a1510 100%);
}

body.pyramids-theme .subject-navbar {
    background: rgba(45, 32, 21, 0.95);
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

body.pyramids-theme .subject-hero-section {
    background: linear-gradient(135deg, #2d2015 0%, #4a3520 50%, #2d2015 100%);
}

body.pyramids-theme .section {
    background: linear-gradient(180deg, #1a1510 0%, #2d2015 100%);
}

body.pyramids-theme h1,
body.pyramids-theme h2,
body.pyramids-theme h3,
body.pyramids-theme .section-title {
    color: #d4af37;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

body.pyramids-theme .challenge-card {
    background: linear-gradient(145deg, rgba(74, 53, 32, 0.9) 0%, rgba(45, 32, 21, 0.7) 100%);
    border: 2px solid rgba(212, 175, 55, 0.3);
}

body.pyramids-theme .btn-primary {
    background: linear-gradient(45deg, #d4af37, #aa8a2e);
    color: #1a1510;
}

body.pyramids-theme .theme-toggle {
    background: linear-gradient(135deg, #d4af37, #aa8a2e);
}

/* Pyramids decoration */
.pyramid-3d {
    position: fixed;
    z-index: -1;
    display: none;
}

body.pyramids-theme .pyramid-3d {
    display: block;
}

.pyramid-1 {
    bottom: 0;
    right: 10%;
    width: 0;
    height: 0;
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 160px solid rgba(139, 107, 55, 0.5);
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.3));
}

.pyramid-2 {
    bottom: 0;
    left: 15%;
    width: 0;
    height: 0;
    border-left: 70px solid transparent;
    border-right: 70px solid transparent;
    border-bottom: 120px solid rgba(160, 125, 65, 0.4);
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.2));
}

/* ========================================
   WINTER THEME
   ======================================== */
body.winter-theme {
    background: linear-gradient(180deg, #151922 0%, #1e2832 100%);
}

body.winter-theme .subject-navbar {
    background: rgba(21, 25, 34, 0.95);
    border-bottom: 2px solid rgba(135, 206, 250, 0.3);
}

body.winter-theme .subject-hero-section {
    background: linear-gradient(135deg, #1e2832 0%, #2c3e50 100%);
}

body.winter-theme .section {
    background: transparent;
}

body.winter-theme h1,
body.winter-theme h2,
body.winter-theme h3,
body.winter-theme .section-title {
    color: #87cefa;
    text-shadow: 0 0 10px rgba(135, 206, 250, 0.5);
}

body.winter-theme .challenge-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(135, 206, 250, 0.2);
}

body.winter-theme .btn-primary {
    background: linear-gradient(135deg, #5da2d5, #87cefa);
    color: #151922;
}

body.winter-theme .theme-toggle {
    background: linear-gradient(135deg, #87cefa, #5da2d5);
}

/* Snowflakes */
.snowflake {
    color: #fff;
    font-size: 1.5rem;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px #000;
    position: fixed;
    top: -10%;
    z-index: 9999;
    user-select: none;
    cursor: default;
    animation-name: snowflakes-fall, snowflakes-shake;
    animation-duration: 10s, 3s;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
    animation-play-state: running, running;
    display: none;
}

body.winter-theme .snowflake {
    display: block;
}

@keyframes snowflakes-fall {
    0% {
        top: -10%;
    }

    100% {
        top: 100%;
    }
}

@keyframes snowflakes-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(80px);
    }
}

.snowflake:nth-of-type(1) {
    left: 5%;
    animation-delay: 0s, 0s;
}

.snowflake:nth-of-type(2) {
    left: 15%;
    animation-delay: 1s, 1s;
}

.snowflake:nth-of-type(3) {
    left: 25%;
    animation-delay: 6s, .5s;
}

.snowflake:nth-of-type(4) {
    left: 35%;
    animation-delay: 4s, 2s;
}

.snowflake:nth-of-type(5) {
    left: 45%;
    animation-delay: 2s, 2s;
}

.snowflake:nth-of-type(6) {
    left: 55%;
    animation-delay: 8s, 3s;
}

.snowflake:nth-of-type(7) {
    left: 65%;
    animation-delay: 6s, 2s;
}

.snowflake:nth-of-type(8) {
    left: 75%;
    animation-delay: 2.5s, 1s;
}

.snowflake:nth-of-type(9) {
    left: 85%;
    animation-delay: 1s, 0s;
}

.snowflake:nth-of-type(10) {
    left: 95%;
    animation-delay: 3s, 1.5s;
}

/* =============================================
   SUMMARIES SECTION
   ============================================= */

.summaries-section {
    padding: 80px 20px;
    background: linear-gradient(180deg, transparent, rgba(102, 126, 234, 0.05));
}

.summaries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.summary-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
}

.summary-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.summary-card:hover .summary-image img {
    transform: scale(1.05);
}

.summary-content {
    padding: 25px;
}

.summary-content h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.summary-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.summary-meta {
    display: flex;
    gap: 15px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.summary-meta i {
    margin-left: 5px;
    color: #667eea;
}

.summary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.summary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.summary-btn.external-link {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.summary-btn.external-link:hover {
    box-shadow: 0 8px 25px rgba(56, 239, 125, 0.4);
}

.no-summaries-message {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.5);
    grid-column: 1 / -1;
}

.no-summaries-message i {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    color: rgba(102, 126, 234, 0.5);
}

.no-summaries-message h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.no-summaries-message p {
    font-size: 1rem;
}

/* Responsive for summaries */
@media (max-width: 768px) {
    .summaries-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        max-width: 100%;
    }
}

/* =============================================
   MOBILE RESPONSIVE STYLES
   ============================================= */

/* iPhone Safe Area Support */
@supports (padding: env(safe-area-inset-top)) {
    .subject-navbar {
        padding-top: env(safe-area-inset-top);
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Tablet and Mobile (max-width: 768px) */
@media (max-width: 768px) {

    /* NOTE: Navbar styles are defined earlier in the file (lines 162-254)
       with the dropdown menu system. Don't duplicate here! */

    /* Hero Section - Padding for fixed navbar */
    .subject-hero-section {
        padding-top: 120px;
        min-height: calc(100vh - 60px);
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content>p {
        font-size: 1rem;
    }

    .subject-badge {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        border-radius: 20px;
    }

    /* Hero Buttons */
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    /* Sections - Proper spacing */
    .section {
        padding: 80px 15px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    /* Challenge Card */
    .challenge-card {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .challenge-rules {
        flex-direction: column;
        gap: 10px;
    }

    /* Leaderboard */
    .leaderboard-container {
        overflow-x: auto;
    }

    /* AI Chat */
    .ai-chat-container {
        height: 350px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .nav-container {
        height: 55px;
    }

    .nav-brand {
        padding: 6px 8px;
    }

    .nav-brand i {
        font-size: 1.2rem;
    }

    .nav-link {
        padding: 8px 12px;
        min-width: 40px;
        min-height: 40px;
    }

    .subject-hero-section {
        padding-top: 100px;
    }

    .hero-content h1 {
        font-size: 1.6rem;
    }

    .section {
        padding: 60px 12px;
    }

    .section-title {
        font-size: 1.5rem;
        gap: 10px;
    }
}