/* ============================================
   Mektebia - Öğrenci Arayüzü CSS (Açık Tema)
   Duolingo tarzı, oyunlaştırılmış, mobil uyumlu
   ============================================ */

:root {
    --s-bg: #F0F3F5;
    --s-bg-card: #FFFFFF;
    --s-bg-hover: #F7F9FA;
    --s-green: #58CC02;
    --s-green-dark: #46A302;
    --s-green-glow: rgba(88, 204, 2, 0.2);
    --s-blue: #1CB0F6;
    --s-blue-dark: #1899D6;
    --s-red: #FF4B4B;
    --s-red-dark: #EA2B2B;
    --s-orange: #FF9600;
    --s-purple: #CE82FF;
    --s-yellow: #FFC800;
    --s-gold: #FFD700;
    --s-text: #3C3C3C;
    --s-text-dim: #6B7280;
    --s-border: #E5E5E5;
    --s-radius: 24px;
    --s-radius-sm: 16px;
    --s-radius-xs: 12px;
}

/* === Student Login Page === */
.student-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #58CC02 0%, #1CB0F6 50%, #CE82FF 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 200px;
    height: 200px;
    background: #fff;
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    background: #fff;
    top: 20%;
    right: -30px;
    animation-delay: 1.5s;
}

.shape-3 {
    width: 120px;
    height: 120px;
    background: #fff;
    bottom: 10%;
    left: 10%;
    animation-delay: 3s;
}

.shape-4 {
    width: 180px;
    height: 180px;
    background: #fff;
    bottom: -40px;
    right: 15%;
    animation-delay: 4.5s;
}

.student-login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 32px;
    padding: 48px 36px;
    width: 100%;
    max-width: 400px;
    z-index: 1;
    animation: scaleIn 0.5s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.student-login-mascot {
    text-align: center;
    margin-bottom: 8px;
}

.student-login-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--s-green);
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.student-login-subtitle {
    text-align: center;
    color: var(--s-text-dim);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 28px;
}

.student-form-label {
    display: block;
    font-weight: 800;
    font-size: 13px;
    color: var(--s-text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.student-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--s-border);
    border-radius: var(--s-radius-sm);
    background: var(--s-bg);
    color: var(--s-text);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 700;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.student-input:focus {
    border-color: var(--s-green);
    box-shadow: 0 0 0 4px var(--s-green-glow);
    background: #fff;
}

.student-input::placeholder {
    color: #B0B8C1;
    font-weight: 600;
}

/* === Student Buttons === */
.student-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    border: none;
    border-radius: var(--s-radius);
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 16px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    user-select: none;
    box-sizing: border-box;
}

.student-btn:active {
    transform: translateY(4px);
}

.student-btn-primary {
    background: var(--s-green);
    color: white;
    box-shadow: 0 5px 0 var(--s-green-dark);
}

.student-btn-primary:hover {
    background: #4DBF00;
}

.student-btn-primary:active {
    box-shadow: none;
}

.student-btn-blue {
    background: var(--s-blue);
    color: white;
    box-shadow: 0 5px 0 var(--s-blue-dark);
}

.student-btn-blue:hover {
    background: #10A4EA;
}

.student-btn-blue:active {
    box-shadow: none;
}

.student-btn-outline {
    background: transparent;
    color: var(--s-text);
    border: 3px solid var(--s-border);
    box-shadow: 0 4px 0 #DADADA;
}

.student-btn-outline:hover {
    border-color: var(--s-green);
    color: var(--s-green);
}

.student-btn-outline:active {
    box-shadow: none;
}

/* === Student Layout === */
.student-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #b1cf9b 0%, #1CB0F6 50%, #CE82FF 100%);
    color: var(--s-text);
    padding-bottom: 80px;
    padding-top: 20px;
}

/* === App Container (Mobile Feel on Desktop) === */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    background: #FFFFFF;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.app-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--s-border);
    background: white;
    z-index: 10;
}

.app-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.student-dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Duolingo 3-Column Layout === */
.duo-layout {
    display: flex;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    gap: 40px;
    align-items: flex-start;
}

.duo-sidebar-left {
    width: 250px;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: calc(100vh - 40px);
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 20px 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

.duo-brand {
    font-size: 2.2rem;
    font-weight: 900;
    color: #000000;
    text-decoration: none;
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: -1px;
    padding: 10px 0;
}

.duo-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--s-text-dim);
    font-weight: 800;
    font-size: 15px;
    border-radius: 16px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duo-nav-item:hover {
    background: var(--s-bg-hover);
}

.duo-nav-item.active {
    color: var(--s-blue);
    background: rgba(28, 176, 246, 0.1);
    border: 2px solid rgba(28, 176, 246, 0.2);
}

.duo-nav-item .icon {
    font-size: 1.5rem;
    width: 32px;
    text-align: center;
}

.duo-nav-spacer {
    flex: 1;
}

.duo-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--s-border);
    border-radius: 18px;
    color: var(--s-text-dim);
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 0 var(--s-border);
    margin-bottom: 16px;
    text-transform: none;
}

.duo-back-btn:hover {
    border-color: var(--s-blue);
    color: var(--s-blue);
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--s-blue-dark);
}

.duo-back-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.duo-main-content {
    flex: 1;
    min-width: 0;
    padding-top: 20px;
    padding-bottom: 60px;
}

.duo-sidebar-right {
    width: 320px;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 20px;
}

.duo-top-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--s-bg-card);
    border-radius: var(--s-radius);
    border: 2px solid var(--s-border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 15px;
    color: var(--s-text-dim);
}

.stat-item.stat-streak {
    color: var(--s-orange);
}

.stat-item.stat-gems {
    color: var(--s-blue);
}

.stat-item.stat-hearts {
    color: var(--s-red);
}

@media (max-width: 900px) {
    .duo-layout {
        flex-direction: column;
        padding: 0 16px 120px;
        align-items: stretch;
    }

    .duo-sidebar-left {
        display: none;
    }

    .duo-sidebar-right {
        width: 100%;
        position: static;
    }
}

/* Top Bar */
.student-topbar {
    background: var(--s-bg-card);
    border-radius: 20px;
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.student-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-topbar-logo {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--s-purple);
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-topbar-logo img {
    height: 24px;
}

.student-topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.xp-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FFF8E0;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 14px;
    color: #E6A800;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FFF3E0;
    border: 2px solid #FFCC80;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 14px;
    color: var(--s-orange);
}

.student-topbar-link {
    font-weight: 800;
    font-size: 14px;
    color: var(--s-text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.student-topbar-link:hover {
    color: var(--s-purple);
}

.student-avatar {
    color: var(--s-red);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.student-avatar:hover {
    transform: scale(1.1);
}

/* === Bottom Nav (Mobil) === */
.student-bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--s-border);
    border-radius: 24px;
    display: none;
    justify-content: space-around;
    padding: 10px 6px;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 900px) {
    .student-bottom-nav {
        display: flex;
    }

    .student-topbar-link {
        display: none;
    }

    .student-dashboard-wrapper {
        grid-template-columns: 1fr !important;
    }

    .student-sidebar {
        display: none;
    }
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--s-text-dim);
    font-size: 11px;
    font-weight: 800;
    padding: 8px 4px;
    border-radius: 18px;
    transition: all 0.2s;
}

.bottom-nav-item .nav-icon {
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.bottom-nav-item.active {
    color: var(--s-blue);
    background: rgba(28, 176, 246, 0.08);
}

.bottom-nav-item.active .nav-icon {
    transform: translateY(-2px) scale(1.1);
}

.bottom-nav-item:hover {
    color: var(--s-blue);
}

/* === Content Area === */
.student-dashboard-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}

.student-main-content {
    min-width: 0;
}

.student-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--s-text);
    margin-bottom: 16px;
}

/* === Class Cards === */
.class-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.class-card {
    background: var(--s-bg-card);
    border: 3px solid var(--s-border);
    border-radius: var(--s-radius);
    padding: 24px 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 0 #E0E0E0;
}

.class-card:hover {
    border-color: var(--s-green);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.class-card:active {
    transform: translateY(0);
    box-shadow: none;
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
}

.class-card:nth-child(1)::before {
    background: var(--s-green);
}

.class-card:nth-child(2)::before {
    background: var(--s-blue);
}

.class-card:nth-child(3)::before {
    background: var(--s-orange);
}

.class-card:nth-child(4)::before {
    background: var(--s-purple);
}

.class-card-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    display: block;
}

.class-card-name {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--s-text);
    margin-bottom: 4px;
}

.class-card-info {
    font-size: 13px;
    color: var(--s-text-dim);
    font-weight: 700;
}

/* === Lesson Cards === */
.lesson-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.lesson-card {
    background: var(--s-bg-card);
    border-radius: var(--s-radius);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    width: calc(25% - 12px);
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .lesson-card {
        width: calc(50% - 8px);
    }
}

@media (max-width: 500px) {
    .lesson-card {
        width: 100%;
    }
}

.lesson-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--lesson-color, var(--s-green));
}

.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.lesson-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    background: var(--lesson-bg-color, rgba(88, 204, 2, 0.1));
}

.lesson-info {
    text-align: center;
}

.lesson-name {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--s-text);
}

.lesson-meta {
    font-size: 12px;
    color: var(--s-text-dim);
    font-weight: 700;
}

/* === Sidebar Components === */
.sidebar-card {
    background: var(--s-bg-card);
    border-radius: var(--s-radius);
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.sidebar-mission {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--s-border);
}

.sidebar-mission-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-mission-icon {
    width: 40px;
    height: 40px;
    background: #FFF0F0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--s-bg);
    padding: 4px;
    border-radius: 12px;
}

.sidebar-tab {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-weight: 800;
    font-size: 14px;
    border-radius: 8px;
    color: var(--s-text-dim);
    cursor: pointer;
}

.sidebar-tab.active {
    background: var(--s-purple);
    color: white;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 800;
}

.calendar-days {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-day {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 14px;
    color: var(--s-text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day.active {
    background: var(--s-purple);
    color: white;
}

.calendar-day:hover {
    background: rgba(206, 130, 255, 0.2);
    color: var(--s-purple);
}

/* === Topic Cards === */
.topic-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-card {
    background: var(--s-bg-card);
    border: 2px solid var(--s-border);
    border-radius: var(--s-radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 5px 0 var(--s-border);
    margin-bottom: 4px;
}

.topic-card:hover {
    border-color: var(--s-green);
    transform: translateY(2px);
    box-shadow: 0 3px 0 var(--s-green-dark);
}

.topic-card:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 transparent;
}

.topic-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topic-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--s-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    color: var(--s-text);
    flex-shrink: 0;
}

.topic-card.completed .topic-number {
    background: var(--s-green);
    color: white;
}

.topic-name {
    font-weight: 800;
    font-size: 15px;
    color: var(--s-text);
}

.topic-questions-count {
    font-size: 12px;
    color: var(--s-text-dim);
    font-weight: 700;
    margin-top: 2px;
}

.topic-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-progress-bar {
    width: 60px;
    height: 8px;
    border-radius: 4px;
    background: var(--s-border);
    overflow: hidden;
}

.topic-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--s-green);
    transition: width 0.5s ease;
}

/* === Quiz Interface === */
.quiz-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    padding-bottom: 100px;
    /* Space for fixed bottom bar */
}

.quiz-top-bar {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 16px;
    background: white;
}

.quiz-close-btn {
    color: var(--s-text-dim);
    font-size: 1.5rem;
    text-decoration: none;
    font-weight: 800;
    transition: color 0.2s;
}

.quiz-close-btn:hover {
    color: var(--s-red);
}

.quiz-progress-bar {
    flex: 1;
    height: 16px;
    border-radius: 10px;
    background: var(--s-border);
    overflow: hidden;
    position: relative;
}

.quiz-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--s-green) 0%, #7ED321 100%);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.quiz-progress-fill::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 4px;
    right: 4px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
}

.quiz-question-counter {
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--s-text-dim);
    margin-bottom: 24px;
}

.quiz-question-text {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--s-text);
    margin-bottom: 32px;
    line-height: 1.5;
    text-align: center;
}

.quiz-question-image {
    text-align: center;
    margin-bottom: 20px;
}

.quiz-question-image img {
    max-width: 100%;
    max-height: 250px;
    border-radius: var(--s-radius);
    border: 3px solid var(--s-border);
    object-fit: contain;
}

/* Answer Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    flex: 1;
}

.quiz-option {
    background: var(--s-bg-card);
    border: 2px solid var(--s-border);
    border-radius: var(--s-radius-sm);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    box-shadow: 0 4px 0 var(--s-border);
    margin-bottom: 4px;
}

.quiz-option:hover {
    background: #F7F9FA;
}

.quiz-option:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent;
}

.quiz-option.selected {
    border-color: var(--s-blue);
    background: #E8F4FD;
    box-shadow: 0 4px 0 var(--s-blue);
}

.quiz-option.correct {
    border-color: var(--s-green) !important;
    background: #EAFBE7 !important;
    box-shadow: 0 4px 0 var(--s-green) !important;
    animation: bounceIn 0.4s ease-out;
}

.quiz-option.wrong {
    border-color: var(--s-red) !important;
    background: #FFE8E8 !important;
    box-shadow: 0 4px 0 var(--s-red) !important;
    animation: shake 0.5s ease;
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.quiz-option.disabled.correct {
    opacity: 1;
}

.quiz-option-letter {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--s-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    color: var(--s-text);
    flex-shrink: 0;
    border: 2px solid var(--s-border);
    transition: all 0.2s;
}

.quiz-option.selected .quiz-option-letter {
    background: var(--s-blue);
    color: white;
    border-color: var(--s-blue);
}

.quiz-option.correct .quiz-option-letter {
    background: var(--s-green);
    color: white;
    border-color: var(--s-green);
}

.quiz-option.wrong .quiz-option-letter {
    background: var(--s-red);
    color: white;
    border-color: var(--s-red);
}

.quiz-option-text {
    font-weight: 800;
    font-size: 15px;
    color: var(--s-text);
    flex: 1;
}

/* Explanation */
.quiz-explanation {
    background: #EAFBE7;
    border: 3px solid var(--s-green);
    border-radius: var(--s-radius);
    padding: 20px;
    margin-bottom: 24px;
    animation: slideUp 0.4s ease-out;
    display: none;
}

.quiz-explanation.show {
    display: block;
}

.quiz-explanation-title {
    font-weight: 900;
    font-size: 14px;
    color: var(--s-green-dark);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.quiz-explanation-text {
    font-weight: 700;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* === Fixed Bottom Bar === */
.quiz-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    padding: 24px 20px;
    background: white;
    border-top: 2px solid var(--s-border);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.quiz-bottom-bar.state-correct {
    background: #d7ffb8;
    border-top-color: var(--s-green);
}

.quiz-bottom-bar.state-wrong {
    background: #ffdfe0;
    border-top-color: var(--s-red);
}

/* === Results Page === */
.result-page {
    min-height: 100vh;
    background: var(--s-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: var(--s-text);
}

.result-animation {
    margin-bottom: 16px;
}

.result-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.result-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--s-text-dim);
    margin-bottom: 32px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
    width: 100%;
    max-width: 400px;
}

.result-stat {
    background: var(--s-bg-card);
    border: 2px solid var(--s-border);
    border-radius: var(--s-radius);
    padding: 20px 12px;
    box-shadow: 0 3px 0 #E0E0E0;
}

.result-stat-number {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.result-stat-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--s-text-dim);
    text-transform: uppercase;
    margin-top: 4px;
}

.result-xp {
    background: #FFF8E0;
    border: 2px solid #FFE082;
    border-radius: var(--s-radius);
    padding: 16px 32px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: bounceIn 0.6s ease-out 0.5s both;
}

.result-xp-icon {
    font-size: 2rem;
}

.result-xp-text {
    font-weight: 900;
    font-size: 1.2rem;
    color: #E6A800;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

/* === Brush Panel === */
.brush-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

.brush-canvas-wrapper {
    background: white;
    border-radius: var(--s-radius);
    border: 3px solid var(--s-border);
    overflow: hidden;
    margin-bottom: 16px;
    touch-action: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.brush-canvas {
    display: block;
    cursor: crosshair;
    width: 100%;
}

.brush-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--s-bg-card);
    border: 2px solid var(--s-border);
    border-radius: var(--s-radius);
    padding: 16px;
    box-shadow: 0 3px 0 #E0E0E0;
}

.brush-colors {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.brush-color-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.brush-color-btn:hover {
    transform: scale(1.15);
}

.brush-color-btn.active {
    border-color: var(--s-green);
    box-shadow: 0 0 0 3px var(--s-green-glow);
}

.brush-size-slider {
    -webkit-appearance: none;
    width: 100px;
    height: 8px;
    border-radius: 4px;
    background: var(--s-border);
    outline: none;
}

.brush-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--s-green);
    cursor: pointer;
    border: 3px solid var(--s-green-dark);
}

.brush-tool-btn {
    padding: 10px 16px;
    border-radius: var(--s-radius-xs);
    border: 2px solid var(--s-border);
    background: var(--s-bg);
    color: var(--s-text);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
}

.brush-tool-btn:hover {
    border-color: var(--s-green);
    color: var(--s-green);
}

.brush-tool-btn.active {
    background: var(--s-green);
    border-color: var(--s-green);
    color: white;
}

/* === Shake Animation === */
@keyframes shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

/* === Confetti === */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
}

/* === Back Button === */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--s-text-dim);
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
    padding: 8px 0;
    transition: color 0.2s;
    margin-bottom: 20px;
}

.back-btn:hover {
    color: var(--s-green);
}

/* === Speech Button === */
.quiz-speech-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid var(--s-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    z-index: 10;
}

.quiz-speech-btn:hover {
    background: var(--s-bg);
    transform: translateY(-50%) scale(1.1);
}

.quiz-speech-btn.playing {
    border-color: var(--s-green);
    color: var(--s-green);
    animation: quiz-pulse 1s infinite;
}

@keyframes quiz-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(88, 204, 2, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(88, 204, 2, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(88, 204, 2, 0);
    }
}

/* === Quiz Start Overlay === */
.quiz-start-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.quiz-start-content {
    padding: 40px;
    animation: scaleIn 0.4s ease-out;
    background: white;
    border-radius: var(--s-radius);
    border: 2px solid var(--s-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 90%;
}

/* === Empty State === */
.student-empty {
    text-align: center;
    padding: 60px 20px;
}

.student-empty h3 {
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--s-text);
    margin-top: 16px;
    margin-bottom: 8px;
}

.student-empty p {
    color: var(--s-text-dim);
    font-weight: 700;
    font-size: 14px;
}

/* === Profile === */
.profile-card {
    background: var(--s-bg-card);
    border: 3px solid var(--s-border);
    border-radius: var(--s-radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 0 #E0E0E0;
}

.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--s-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 2rem;
    color: white;
    margin: 0 auto 16px;
    border: 4px solid var(--s-green-dark);
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--s-text);
    margin-bottom: 4px;
}

.profile-email {
    color: var(--s-text-dim);
    font-weight: 700;
    font-size: 14px;
}

.progress-lesson {
    background: var(--s-bg-card);
    border: 2px solid var(--s-border);
    border-radius: var(--s-radius-sm);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 0 #ECECEC;
}

.progress-lesson-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.progress-lesson-info {
    flex: 1;
}

.progress-lesson-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--s-text);
    margin-bottom: 6px;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: var(--s-border);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s ease;
}

.progress-lesson-pct {
    font-weight: 900;
    font-size: 16px;
    color: var(--s-green);
    flex-shrink: 0;
}

/* === Hero Stats === */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.hero-stat-card {
    background: white;
    padding: 20px;
    border-radius: 24px;
    border: 2px solid var(--s-border);
    box-shadow: 0 4px 0 var(--s-border);
    text-align: center;
    transition: transform 0.2s;
}
.hero-stat-val {
    font-size: 1.5rem;
    font-weight: 900;
    display: block;
    margin-bottom: 4px;
}
.hero-stat-label {
    font-size: 12px;
    font-weight: 800;
    color: #4B5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
@media (max-width: 600px) {
    .hero-stats {
        gap: 8px;
    }
    .hero-stat-card {
        padding: 12px 8px;
        border-radius: 18px;
    }
    .hero-stat-val {
        font-size: 1.1rem;
    }
    .hero-stat-label {
        font-size: 9px;
    }
}

/* === Responsive === */
@media (max-width: 600px) {
    .class-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .class-card {
        padding: 20px 16px;
    }

    .class-card-icon {
        font-size: 2.2rem;
    }

    .class-card-name {
        font-size: 0.95rem;
    }

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

    .result-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .student-login-card {
        padding: 36px 24px;
    }
}