/* ═══════════════════════════════════════════════════════════
   EduTrivia — Main Stylesheet
   Premium Educational Trivia Game
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
    --green-deep: #0f5132;
    --green-primary: #198754;
    --green-mid: #20c997;
    --green-sage: #b7e4c7;
    --green-mint: #d8f3dc;
    --green-pale: #f0faf3;
    --danger-subtle: #fde8ec;
    --danger-accent: #d6336c;
    --body-bg: #f8faf9;
    --card-shadow: 0 1px 3px rgba(15, 81, 50, 0.08),
        0 4px 16px rgba(15, 81, 50, 0.06);
    --card-shadow-hover: 0 4px 12px rgba(15, 81, 50, 0.12),
        0 8px 28px rgba(15, 81, 50, 0.08);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ── Reset & Base ──────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: #1b2e24;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES — GREEN THEME EXTENSIONS
   ═══════════════════════════════════════════════════════════ */
.bg-green-deep {
    background-color: var(--green-deep) !important;
}

.bg-green-primary {
    background-color: var(--green-primary) !important;
}

.bg-green-mint {
    background-color: var(--green-mint) !important;
}

.bg-green-pale {
    background-color: var(--green-pale) !important;
}

.bg-green-sage {
    background-color: var(--green-sage) !important;
}

.text-green-deep {
    color: var(--green-deep) !important;
}

.text-green-mid {
    color: var(--green-mid) !important;
}

.border-green {
    border-color: var(--green-sage) !important;
}

.border-green-start {
    border-left: 4px solid var(--green-primary) !important;
}


/* ── Buttons ──────────────────────────────────────────── */
.btn-green {
    background: var(--green-primary);
    border-color: var(--green-primary);
    color: #fff;
    font-weight: 600;
    transition: all var(--transition-smooth);
}

.btn-green:hover,
.btn-green:focus-visible {
    background: var(--green-deep);
    border-color: var(--green-deep);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 81, 50, 0.30);
}

.btn-outline-green {
    border-color: var(--green-primary);
    color: var(--green-primary);
    font-weight: 600;
    transition: all var(--transition-smooth);
}

.btn-outline-green:hover,
.btn-outline-green:focus-visible {
    background: var(--green-primary);
    border-color: var(--green-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 81, 50, 0.25);
}


/* ── Progress Bars ────────────────────────────────────── */
.progress-green {
    background-color: var(--green-sage);
}

.progress-green .progress-bar {
    background: linear-gradient(135deg, var(--green-primary), var(--green-mid));
}


/* ── Badges ───────────────────────────────────────────── */
.badge-green {
    background: var(--green-sage);
    color: var(--green-deep);
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */
.navbar-edu {
    background: linear-gradient(135deg, var(--green-deep) 0%, #0b3d24 100%);
    box-shadow: 0 2px 12px rgba(15, 81, 50, 0.18);
}

.navbar-edu .navbar-brand {
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -0.5px;
    color: #fff !important;
}

.navbar-edu .navbar-brand i {
    color: var(--green-mid);
}

.navbar-edu .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    transition: color var(--transition-smooth);
}

.navbar-edu .nav-link:hover,
.navbar-edu .nav-link.active {
    color: #fff !important;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 50px;
    padding: 4px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

.stat-badge i {
    font-size: 1.05rem;
}

.stat-badge .streak-fire {
    color: #ffb347;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-mid), var(--green-sage));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--green-deep);
}


/* ═══════════════════════════════════════════════════════════
   HERO / DAILY CHALLENGE (Dashboard)
   ═══════════════════════════════════════════════════════════ */
.hero-daily {
    background: linear-gradient(135deg, var(--green-deep) 0%, #0b5c3b 50%, var(--green-primary) 100%);
    border-radius: 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-daily::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.hero-daily .streak-text {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}


/* ═══════════════════════════════════════════════════════════
   CATEGORY CARDS (Dashboard)
   ═══════════════════════════════════════════════════════════ */
.category-card {
    background: #fff;
    border: 1px solid rgba(15, 81, 50, 0.08);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-smooth);
    cursor: default;
}

.category-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-3px);
    border-color: var(--green-sage);
}

.category-card .icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}


/* ═══════════════════════════════════════════════════════════
   QUESTION CARD (Gameplay)
   ═══════════════════════════════════════════════════════════ */
.question-card {
    background: #fff;
    border: 1px solid rgba(15, 81, 50, 0.08);
    border-radius: 1.25rem;
    box-shadow: var(--card-shadow);
}

.question-number {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--green-primary);
}

.question-text {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
    color: #1b2e24;
}


/* ── Answer Buttons (2×2 Grid) ────────────────────────── */
.ans-btn {
    width: 100%;
    padding: 1.1rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    border: 2px solid #e2e8e6;
    border-radius: 0.85rem;
    background: #fff;
    color: #1b2e24;
    transition: all var(--transition-smooth);
    cursor: pointer;
    position: relative;
}

.ans-btn:hover {
    border-color: var(--green-mid);
    background: var(--green-pale);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 81, 50, 0.10);
}

/* Selected (picked but not yet revealed) */
.ans-btn.ans-selected {
    border-color: var(--green-primary);
    background: var(--green-mint);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.18);
}

/* Correct answer reveal */
.ans-btn.ans-correct {
    border-color: var(--green-primary);
    background: #d1fae5;
    color: var(--green-deep);
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.22);
}

.ans-btn.ans-correct::after {
    content: ' ✓';
    color: var(--green-primary);
    font-weight: 800;
}

/* Incorrect answer reveal */
.ans-btn.ans-incorrect {
    border-color: var(--danger-accent);
    background: var(--danger-subtle);
    color: #9b1d3a;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.18);
}

.ans-btn.ans-incorrect::after {
    content: ' ✗';
    color: var(--danger-accent);
    font-weight: 800;
}

/* Disabled all after pick */
.ans-btn.ans-disabled {
    pointer-events: none;
    opacity: 0.9;
}


/* ── Explanation Panel ─────────────────────────────────── */
.explanation-panel {
    border-left: 4px solid var(--green-primary);
    background: var(--green-pale);
    border-radius: 0.75rem;
    transition: all var(--transition-smooth);
}


/* ═══════════════════════════════════════════════════════════
   POST-GAME ANALYTICS (Results)
   ═══════════════════════════════════════════════════════════ */
.score-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(var(--green-primary) 0deg,
            var(--green-primary) 252deg,
            #e9ecef 252deg,
            #e9ecef 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle-inner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--green-deep);
}

.xp-gained {
    background: linear-gradient(135deg, var(--green-deep), var(--green-primary));
    color: #fff;
    border-radius: 1rem;
}

/* ── Accordion Overrides ──────────────────────────────── */
.accordion-button:not(.collapsed) {
    background: var(--green-pale);
    color: var(--green-deep);
    font-weight: 700;
    box-shadow: none;
}

.accordion-button:focus {
    border-color: var(--green-sage);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.18);
}


/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
.fade-in-up {
    animation: fadeInUp 0.5s ease-out both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green-mid);
    display: inline-block;
    animation: pulse 1.8s infinite;
}

.pulse-dot-static {
    border: 2px solid var(--green-mid);
    color: var(--green-mid);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}


/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.footer-edu {
    background: var(--green-deep);
    color: #fff;
}


/* ═══════════════════════════════════════════════════════════
   DASHBOARD EXTENSIONS
   ═══════════════════════════════════════════════════════════ */

/* Hover elevate for prize cards */
.hover-elevate {
    transition: all var(--transition-smooth);
}

.hover-elevate:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

/* Larger avatar circle for winner cards */
.avatar-circle-lg {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-mid), var(--green-sage));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--green-deep);
}

/* Pulse glow for the main CTA */
.pulse-glow {
    animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 20px 4px rgba(255, 255, 255, 0.15);
    }
}

/* Background opacity utility */
.bg-opacity-15 {
    --bs-bg-opacity: 0.15;
}