/* ==============================
   RoboVerse Kids - Educational Platform
   Design System & Styles
   ============================== */

:root {
    /* Color Palette - Vibrant & Child-Friendly */
    --primary: #4CACF7;
    --primary-dark: #2B8FE0;
    --primary-light: #B3E0FF;
    --secondary: #F7D253;
    --secondary-dark: #E0B820;
    --success: #6EE59F;
    --success-dark: #3BC972;
    --accent: #FF8F4C;
    --accent-dark: #E06D22;
    --danger: #F76A6A;
    --danger-light: #FFD4D4;
    --purple: #B07EF0;
    --purple-light: #E0D0FF;
    --pink: #FF7EB3;
    --teal: #3DC9B0;
    
    --bg-light: #F4F9FD;
    --bg-card: #FFFFFF;
    --text-main: #2D3748;
    --text-muted: #718096;
    --text-light: #A0AEC0;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 25px rgba(0,0,0,0.08);
    --shadow-lg: 0 15px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px rgba(76,172,247,0.3);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --radius-xl: 40px;
    
    --font-ar: 'Tajawal', 'Baloo Bhaijaan 2', sans-serif;
    --font-en: 'Nunito', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ar);
    background: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== PAGE MANAGEMENT ===== */
.page { display: none; min-height: 100vh; flex-direction: column; }
.page.active-page { display: flex; }

/* ===== BACKGROUND DECORATIONS ===== */
.bg-decoration {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    pointer-events: none;
}
.shape-1 { width: 350px; height: 350px; background: var(--primary); top: -80px; right: -80px; }
.shape-2 { width: 450px; height: 450px; background: var(--secondary); bottom: -120px; left: -120px; }
.shape-3 { width: 280px; height: 280px; background: var(--success); bottom: 25%; right: 8%; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #E8F4FD 0%, #FFF9E6 50%, #E8FFF0 100%);
}

.login-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-shape {
    position: absolute;
    border-radius: 50%;
    animation: loginFloat 6s ease-in-out infinite;
}
.login-shape.s1 { width: 200px; height: 200px; background: rgba(76,172,247,0.15); top: 10%; right: 5%; animation-delay: 0s; }
.login-shape.s2 { width: 150px; height: 150px; background: rgba(247,210,83,0.2); bottom: 15%; left: 10%; animation-delay: 1s; }
.login-shape.s3 { width: 180px; height: 180px; background: rgba(110,229,159,0.15); top: 50%; left: 5%; animation-delay: 2s; }
.login-shape.s4 { width: 120px; height: 120px; background: rgba(255,143,76,0.15); top: 20%; left: 40%; animation-delay: 3s; }

@keyframes loginFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.login-container {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    animation: loginAppear 0.8s ease-out;
}

@keyframes loginAppear {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-area {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    background: linear-gradient(135deg, rgba(76,172,247,0.08), rgba(247,210,83,0.08));
}
.login-logo-img {
    width: 120px;
    height: 120px;
    border-radius: 30px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 20px rgba(76,172,247,0.3));
}
.login-title {
    font-size: 2.2rem;
    color: var(--primary);
    margin-top: 0.8rem;
    font-weight: 800;
}
.login-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    letter-spacing: 2px;
}

.login-form-area { padding: 1.5rem 2rem 2rem; }

.login-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 0.3rem;
}
.login-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.7rem;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-family: var(--font-ar);
    font-size: 0.95rem;
    font-weight: 700;
    background: transparent;
    color: var(--text-muted);
    transition: var(--transition);
}
.login-tab .material-icons-round { font-size: 1.2rem; }
.login-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.login-tab:hover:not(.active) { color: var(--text-main); }

.form-group {
    position: relative;
    margin-bottom: 1rem;
}
.form-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.3rem;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 1rem;
    padding-right: 3rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-ar);
    font-size: 1.05rem;
    background: var(--white);
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(76,172,247,0.15);
}

.password-group {
    position: relative;
}
.password-group input {
    padding-left: 2.8rem;
}
.toggle-password-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: var(--transition);
}
.toggle-password-btn:hover {
    color: var(--primary);
    background: rgba(76,172,247,0.1);
}
.toggle-password-btn .material-icons-round {
    font-size: 1.25rem;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-ar);
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(76,172,247,0.3);
    margin-top: 0.5rem;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(76,172,247,0.4); }
.btn-login:active { transform: translateY(1px); }

/* Quick 1-Click Demo Login Grid */
.login-quick-section {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px dashed var(--border);
}
.quick-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    text-align: center;
}
.quick-login-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}
.quick-role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-ar);
    background: var(--bg-light);
    position: relative;
    overflow: hidden;
}
.quick-role-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.quick-role-btn:active {
    transform: translateY(0);
}
.quick-role-btn .q-icon {
    font-size: 1.35rem;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.quick-role-btn .q-role {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-main);
}
.quick-role-btn .q-user {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
    direction: ltr;
}

.quick-role-btn.q-student {
    background: rgba(76, 172, 247, 0.08);
    border-color: rgba(76, 172, 247, 0.25);
}
.quick-role-btn.q-student:hover {
    background: rgba(76, 172, 247, 0.16);
    border-color: var(--primary);
}

.quick-role-btn.q-teacher {
    background: rgba(61, 201, 176, 0.08);
    border-color: rgba(61, 201, 176, 0.25);
}
.quick-role-btn.q-teacher:hover {
    background: rgba(61, 201, 176, 0.16);
    border-color: var(--teal);
}

.quick-role-btn.q-parent {
    background: rgba(176, 126, 240, 0.08);
    border-color: rgba(176, 126, 240, 0.25);
}
.quick-role-btn.q-parent:hover {
    background: rgba(176, 126, 240, 0.16);
    border-color: var(--purple);
}

.quick-role-btn.q-admin {
    background: rgba(255, 143, 76, 0.08);
    border-color: rgba(255, 143, 76, 0.25);
}
.quick-role-btn.q-admin:hover {
    background: rgba(255, 143, 76, 0.16);
    border-color: var(--accent);
}

#studentAgeGroup { display: block; }

/* ===== APP HEADER ===== */
.app-header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0,0,0,0.04);
}
.teacher-header { border-bottom: 3px solid var(--teal); }
.parent-header { border-bottom: 3px solid var(--purple); }
.admin-header { border-bottom: 3px solid var(--accent); }

.header-right, .header-left { display: flex; align-items: center; gap: 1rem; }
.header-center { flex: 1; text-align: center; }

.admin-quick-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.admin-quick-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}
.btn-xs {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    border-radius: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
}
.header-logo-img { width: 42px; height: 42px; border-radius: 12px; }
.logo-text { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.role-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 700;
}
.teacher-badge { background: rgba(61,201,176,0.15); color: var(--teal); }
.parent-badge { background: rgba(176,126,240,0.15); color: var(--purple); }
.admin-badge { background: rgba(255,143,76,0.15); color: var(--accent-dark); }

.header-stats { display: flex; gap: 0.6rem; }
.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 25px;
    font-weight: 800;
    font-size: 1rem;
    transition: var(--transition);
}
.stat-stars { background: rgba(247,210,83,0.2); color: #B8860B; }
.stat-badges { background: rgba(110,229,159,0.2); color: #1B7A3F; }
.stat-badge .material-icons-round { font-size: 1.1rem; }

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}
.user-menu:hover { background: var(--bg-light); }
.user-avatar-header { font-size: 1.8rem; }
.user-name-header { font-weight: 700; font-size: 0.95rem; }

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 180px;
    z-index: 200;
    border: 1px solid var(--border);
}
.user-dropdown.show { display: block; animation: slideDown 0.2s ease-out; }
.user-dropdown button {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-ar);
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
}
.user-dropdown button:hover { background: var(--bg-light); color: var(--primary); }

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

/* ===== MAIN CONTENT ===== */
main {
    flex: 1;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ===== BUTTONS ===== */
.btn {
    font-family: var(--font-ar);
    font-weight: 700;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.1rem;
    text-decoration: none;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 6px 18px rgba(76,172,247,0.25); }
.btn-success { background: var(--success); color: #0D5926; box-shadow: 0 6px 18px rgba(110,229,159,0.25); }
.btn-accent { background: var(--accent); color: white; box-shadow: 0 6px 18px rgba(255,143,76,0.25); }
.btn-secondary { background: var(--white); color: var(--primary); border: 2px solid var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; color: var(--text-main); border: 2px solid var(--border); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.4rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== STUDENT HOME ===== */
.student-home { animation: fadeIn 0.5s ease-out; }

.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, #2B8FE0 50%, #1A6DC0 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    top: -50px;
    left: -50px;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    bottom: -40px;
    right: 50px;
}
.welcome-text { flex: 1; z-index: 1; }
.welcome-text h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.welcome-text p { font-size: 1.15rem; opacity: 0.9; }
.welcome-robot {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
    z-index: 1;
}

.section-title {
    font-size: 1.6rem;
    color: var(--text-main);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title .material-icons-round { color: var(--primary); }

/* ===== LEVELS GRID ===== */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.level-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.8rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.level-card:hover:not(.locked) {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md), 0 0 0 4px rgba(76,172,247,0.1);
}
.level-card.current {
    border-color: var(--primary);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}
.level-card.current::before {
    content: '▶ المستوى الحالي';
    position: absolute;
    top: 0; left: 0; right: 0;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.3rem;
    font-weight: 700;
}
.level-card.completed { border-color: var(--success); }
.level-card.completed::after {
    content: '✓';
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--success);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}
.level-card.locked {
    opacity: 0.55;
    filter: grayscale(0.6);
    cursor: not-allowed;
}
.level-card.locked .level-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.65);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 2;
}

.level-icon { font-size: 3.5rem; margin-bottom: 0.8rem; }
.level-title { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 0.3rem; }
.level-age { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.8rem; }

.progress-bar {
    width: 100%;
    height: 10px;
    background: #EDF2F7;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.8rem;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--teal));
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== LEVEL DETAIL VIEW ===== */
.level-detail { animation: fadeIn 0.4s ease-out; }
.level-header {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.level-header-icon { font-size: 4rem; }
.level-header-info { flex: 1; }
.level-header-info h1 { font-size: 1.8rem; color: var(--primary-dark); }
.level-header-info p { color: var(--text-muted); font-size: 1.05rem; }
.level-progress-big {
    width: 200px;
    text-align: center;
}
.level-progress-big .progress-bar { height: 14px; margin-bottom: 0.5rem; }
.level-progress-percent { font-weight: 800; font-size: 1.2rem; color: var(--success-dark); }

/* Units Grid */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
}

.unit-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.unit-card:hover { box-shadow: var(--shadow-md); }
.unit-card-header {
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}
.unit-card-header .unit-num {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}
.unit-card-header h3 { font-size: 1.15rem; flex: 1; }
.unit-card-header .unit-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 700;
}
.unit-status.done { background: rgba(110,229,159,0.15); color: var(--success-dark); }
.unit-status.inprogress { background: rgba(76,172,247,0.15); color: var(--primary); }
.unit-status.locked { background: rgba(0,0,0,0.06); color: var(--text-light); }

.unit-lessons { padding: 0; list-style: none; }
.lesson-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}
.lesson-item:hover:not(.lesson-locked) { background: rgba(76,172,247,0.05); }
.lesson-item.lesson-locked { opacity: 0.45; cursor: not-allowed; }
.lesson-item .lesson-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lesson-item.lesson-done .lesson-check {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.lesson-item .lesson-name { flex: 1; font-weight: 600; }
.lesson-item .lesson-type { font-size: 0.8rem; color: var(--text-light); }

/* ===== LESSON VIEW ===== */
.lesson-view { animation: fadeIn 0.4s ease-out; max-width: 900px; margin: 0 auto; }

.lesson-progress-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}
.lesson-step-dot {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #E2E8F0;
    transition: var(--transition);
}
.lesson-step-dot.active { background: var(--primary); }
.lesson-step-dot.done { background: var(--success); }

.lesson-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.boto-guide {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    background: linear-gradient(135deg, rgba(76,172,247,0.06), rgba(110,229,159,0.06));
    border: 2px solid rgba(76,172,247,0.15);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.boto-avatar {
    font-size: 3.5rem;
    animation: float 3s ease-in-out infinite;
    flex-shrink: 0;
}
.boto-speech {
    flex: 1;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.8;
    color: var(--text-main);
}
.audio-btn {
    background: var(--secondary);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.audio-btn:hover { transform: scale(1.1); }

.lesson-content h2 {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 1.2rem;
    text-align: center;
}
.lesson-text {
    font-size: 1.25rem;
    line-height: 2;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}
.lesson-visual {
    text-align: center;
    margin: 1.5rem 0;
}
.lesson-visual img {
    max-width: 100%;
    border-radius: var(--radius-md);
}

/* ===== ACTIVITY AREA ===== */
.activity-area {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.activity-card {
    background: var(--white);
    border: 3px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1.8rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
    gap: 0.8rem;
    user-select: none;
}
.activity-card:hover {
    border-color: var(--primary);
    background: rgba(76,172,247,0.03);
    transform: translateY(-5px);
    box-shadow: var(--shadow-sm);
}
.activity-card .activity-emoji { font-size: 3.5rem; }
.activity-card .activity-label { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.activity-card.correct {
    border: 3px solid var(--success) !important;
    background: rgba(110,229,159,0.1) !important;
    animation: correctPop 0.5s;
}
.activity-card.incorrect {
    border: 3px solid var(--danger) !important;
    background: rgba(247,106,106,0.1) !important;
    animation: shake 0.4s;
}

/* Drag and Drop */
.drag-zone {
    min-height: 100px;
    border: 3px dashed var(--primary-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    background: rgba(76,172,247,0.03);
    transition: var(--transition);
    margin: 1rem 0;
}
.drag-zone.drag-over { background: rgba(76,172,247,0.1); border-color: var(--primary); }
.drag-zone-label { color: var(--text-light); font-size: 1rem; }

.drag-item {
    padding: 0.8rem 1.5rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: grab;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: var(--transition);
}
.drag-item:active { cursor: grabbing; }
.drag-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

/* Direction chooser */
.direction-grid {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 8px;
    justify-content: center;
    margin: 1.5rem auto;
}
.dir-btn {
    width: 80px;
    height: 80px;
    border: 3px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.dir-btn:hover { border-color: var(--primary); background: rgba(76,172,247,0.05); }
.dir-btn.active { border-color: var(--primary); background: rgba(76,172,247,0.15); }

/* Robot simulation */
.robot-grid {
    display: grid;
    gap: 2px;
    justify-content: center;
    margin: 1.5rem auto;
    background: var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    width: fit-content;
}
.grid-cell {
    width: 60px;
    height: 60px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: var(--transition);
}
.grid-cell.robot-cell { background: rgba(76,172,247,0.15); }
.grid-cell.target-cell { background: rgba(110,229,159,0.15); }
.grid-cell.obstacle-cell { background: rgba(247,106,106,0.1); }

/* Command strip */
.command-strip {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    min-height: 60px;
}
.command-chip {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 2px solid var(--primary-light);
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: var(--transition);
}
.command-chip:hover { background: rgba(76,172,247,0.1); }
.command-chip .remove-cmd {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.command-palette {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.cmd-btn {
    padding: 0.7rem 1.3rem;
    border: 2px solid var(--primary);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-ar);
    transition: var(--transition);
}
.cmd-btn:hover { background: var(--primary); color: white; }

/* Quiz */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.quiz-option {
    padding: 1.2rem;
    background: var(--white);
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.quiz-option:hover { border-color: var(--primary); background: rgba(76,172,247,0.04); transform: translateY(-3px); }
.quiz-option.selected { border-color: var(--primary); background: rgba(76,172,247,0.1); }
.quiz-option.correct-answer { border-color: var(--success) !important; background: rgba(110,229,159,0.15) !important; }
.quiz-option.wrong-answer { border-color: var(--danger) !important; background: rgba(247,106,106,0.1) !important; }

/* Scratch Embed */
.scratch-embed {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
}
.scratch-embed iframe {
    width: 100%;
    height: 420px;
    border: none;
}
.scratch-instructions {
    background: rgba(247,210,83,0.1);
    border: 2px solid rgba(247,210,83,0.3);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin: 1rem 0;
}
.scratch-instructions h3 {
    font-size: 1.1rem;
    color: var(--secondary-dark);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.scratch-instructions ol {
    padding-right: 1.5rem;
    font-size: 1.05rem;
    line-height: 2;
}

/* LEGO Section */
.lego-section {
    background: rgba(255,143,76,0.06);
    border: 2px solid rgba(255,143,76,0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}
.lego-section h3 {
    color: var(--accent-dark);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lego-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.lego-step {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.lego-step .step-num {
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin: 0 auto 0.5rem;
}
.lego-step .step-icon { font-size: 2.5rem; margin-bottom: 0.4rem; }
.lego-step .step-text { font-size: 0.95rem; font-weight: 600; color: var(--text-main); }

/* Lesson Navigation */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 1rem;
}

/* ===== ASSESSMENT / TEST ===== */
.test-container {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.4s;
}
.test-header {
    text-align: center;
    margin-bottom: 2rem;
}
.test-header h1 { font-size: 1.8rem; color: var(--primary-dark); }
.test-progress {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
}
.test-progress .progress-bar { flex: 1; }
.test-progress-text { font-weight: 700; color: var(--primary); white-space: nowrap; }

.test-question {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}
.test-question h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.test-result {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.test-result .result-icon { font-size: 5rem; margin-bottom: 1rem; }
.test-result h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.test-result .result-score {
    font-size: 3rem;
    font-weight: 900;
    margin: 1rem 0;
}
.result-score.pass { color: var(--success-dark); }
.result-score.fail { color: var(--danger); }

/* ===== ACHIEVEMENTS ===== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.achievement-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.achievement-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.achievement-card.earned { border: 2px solid var(--secondary); }
.achievement-card.locked { opacity: 0.4; filter: grayscale(1); }
.achievement-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.achievement-name { font-size: 0.95rem; font-weight: 700; }

/* ===== TEACHER DASHBOARD ===== */
.teacher-home { padding: 1.5rem; animation: fadeIn 0.4s; }

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.dash-stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.dash-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.dash-stat-icon.blue { background: rgba(76,172,247,0.15); color: var(--primary); }
.dash-stat-icon.green { background: rgba(110,229,159,0.15); color: var(--success-dark); }
.dash-stat-icon.orange { background: rgba(255,143,76,0.15); color: var(--accent); }
.dash-stat-icon.purple { background: rgba(176,126,240,0.15); color: var(--purple); }
.dash-stat-value { font-size: 2rem; font-weight: 900; }
.dash-stat-label { font-size: 0.85rem; color: var(--text-muted); }

.teacher-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.teacher-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.teacher-section h2 .material-icons-round { color: var(--teal); }

/* Students table */
.students-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.students-table th {
    background: var(--bg-light);
    padding: 0.8rem 1rem;
    text-align: right;
    font-weight: 700;
    border-bottom: 2px solid var(--border);
}
.students-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.students-table tr:hover td { background: rgba(76,172,247,0.03); }
.student-name-cell { display: flex; align-items: center; gap: 0.6rem; }
.student-avatar-small { font-size: 1.5rem; }
.status-chip {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
.status-chip.excellent { background: rgba(110,229,159,0.15); color: var(--success-dark); }
.status-chip.good { background: rgba(76,172,247,0.15); color: var(--primary); }
.status-chip.needs-help { background: rgba(247,106,106,0.15); color: var(--danger); }

/* Charts placeholder */
.chart-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--bg-light), rgba(76,172,247,0.05));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    height: 200px;
    padding: 1rem 0;
    justify-content: center;
}
.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.bar {
    width: 40px;
    border-radius: 8px 8px 0 0;
    transition: height 1s ease-out;
    min-height: 5px;
}
.bar-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.bar-value { font-size: 0.85rem; font-weight: 800; }

/* ===== PARENT DASHBOARD ===== */
.parent-home { padding: 1.5rem; animation: fadeIn 0.4s; }

.child-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.child-avatar { font-size: 4rem; }
.child-info { flex: 1; }
.child-info h2 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.child-info p { color: var(--text-muted); }

.parent-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.parent-section h3 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.parent-section h3 .material-icons-round { color: var(--purple); }

.activity-timeline { list-style: none; }
.timeline-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}
.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.timeline-dot.green { background: var(--success); }
.timeline-dot.blue { background: var(--primary); }
.timeline-dot.orange { background: var(--accent); }

.home-activity-card {
    background: rgba(176,126,240,0.06);
    border: 2px solid rgba(176,126,240,0.15);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    margin-top: 0.5rem;
}
.home-activity-card p { font-size: 1.05rem; line-height: 1.8; }

/* ===== FEEDBACK OVERLAY ===== */
.feedback-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(8px);
}
.feedback-overlay.show { opacity: 1; pointer-events: auto; }
.feedback-modal {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-lg);
    position: relative;
    max-width: 400px;
    width: 90%;
}
.feedback-overlay.show .feedback-modal { transform: scale(1); }
.feedback-icon { font-size: 4.5rem; margin-bottom: 0.8rem; }
.feedback-text { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.5rem; }
.feedback-sub { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.feedback-success { color: var(--success-dark); }
.feedback-error { color: var(--danger); }

/* Badge Overlay */
.badge-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(10px);
}
.badge-overlay.show { opacity: 1; pointer-events: auto; }
.badge-modal {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    animation: badgeAppear 0.6s ease-out;
    max-width: 350px;
    width: 90%;
}
.badge-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(247,210,83,0.3), transparent 70%);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
.badge-earned-icon { font-size: 5rem; position: relative; z-index: 1; margin-bottom: 0.5rem; }
.badge-modal h2 { font-size: 1.5rem; color: var(--secondary-dark); margin-bottom: 0.5rem; position: relative; z-index: 1; }
.badge-earned-name { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.5rem; position: relative; z-index: 1; }

@keyframes badgeAppear {
    from { transform: scale(0.3) rotateZ(-10deg); opacity: 0; }
    to { transform: scale(1) rotateZ(0); opacity: 1; }
}

/* ===== BOTO FLOATING GUIDE ===== */
.boto-float {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 50;
    cursor: pointer;
}
.boto-float-icon {
    font-size: 3rem;
    background: var(--white);
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 3px solid var(--primary);
}
.boto-float:hover .boto-float-icon { transform: scale(1.1); }
.boto-float-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: pulse 2s ease-in-out infinite;
}

.boto-chat {
    position: fixed;
    bottom: 7rem;
    left: 2rem;
    width: 320px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
    overflow: hidden;
    border: 1px solid var(--border);
}
.boto-chat.show { display: block; animation: slideUp 0.3s ease-out; }
.boto-chat-header {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}
.boto-chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}
.boto-chat-body {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}
.boto-msg {
    background: var(--bg-light);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
    100% { transform: translateX(0); }
}
@keyframes correctPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.15); }
}
@keyframes starBurst {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
@keyframes confettiFall {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .welcome-banner { flex-direction: column; text-align: center; padding: 2rem 1.5rem; }
    .welcome-robot { font-size: 3.5rem; }
    .welcome-text h1 { font-size: 1.5rem; }
    .levels-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .level-card { padding: 1.2rem 1rem; }
    .level-icon { font-size: 2.5rem; }
    .level-title { font-size: 1.1rem; }
    .lesson-card { padding: 1.5rem; }
    .boto-speech { font-size: 1.1rem; }
    .activity-area { gap: 0.8rem; }
    .activity-card { min-width: 120px; padding: 1rem; }
    .activity-card .activity-emoji { font-size: 2.5rem; }
    .header-stats { gap: 0.3rem; }
    .stat-badge { padding: 0.3rem 0.5rem; font-size: 0.85rem; }
    .user-name-header { display: none; }
    .login-container { margin: 1rem; }
    .logo-text { font-size: 1.2rem; }
    main { padding: 1rem; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .boto-chat { left: 1rem; width: 280px; }
    .direction-grid { grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 60px); }
    .dir-btn { width: 60px; height: 60px; font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .levels-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .level-header { flex-direction: column; text-align: center; }
    .units-grid { grid-template-columns: 1fr; }
    .quiz-options { grid-template-columns: 1fr; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .lego-steps { grid-template-columns: 1fr; }
}

/* ===== VIDEO EMBED ===== */
.video-embed {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== ROBOT VIDEO SECTIONS (Lesson 2 - Offline Videos) ===== */
.robot-video-section {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    border: 2px solid transparent;
    transition: var(--transition);
}
.robot-video-section:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.robot-video-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, rgba(76,172,247,0.06), rgba(110,229,159,0.06));
    border-bottom: 1px solid var(--border);
}
.robot-video-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
}
.robot-video-header p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}
.robot-video-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.robot-video-icon svg {
    width: 36px;
    height: 36px;
}

.robot-video-player {
    padding: 0;
    position: relative;
}
.robot-video-player video {
    width: 100%;
    display: block;
    max-height: 350px;
    object-fit: cover;
    background: #1a1a2e;
}

/* ===== ROBOT TASKS GRID (Lesson 3 - Video Cards) ===== */
.robot-tasks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin: 1.5rem 0;
}

.robot-task-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
}
.robot-task-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.robot-task-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: white;
}
.robot-task-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    color: white;
}
.robot-task-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.robot-task-icon svg {
    width: 28px;
    height: 28px;
}

.robot-task-video video {
    width: 100%;
    display: block;
    max-height: 180px;
    object-fit: cover;
    background: #1a1a2e;
}

.robot-task-desc {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 640px) {
    .robot-tasks-grid {
        grid-template-columns: 1fr;
    }
    .robot-video-player video {
        max-height: 250px;
    }
    .robot-task-video video {
        max-height: 160px;
    }
}

/* ===== MATCHING ACTIVITY ===== */
.matching-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}
.matching-col { display: flex; flex-direction: column; gap: 0.8rem; }
.matching-col h4 { text-align: center; margin-bottom: 0.5rem; color: var(--text-muted); }
.match-item {
    padding: 1rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
}
.match-item:hover { border-color: var(--primary); }
.match-item.selected { border-color: var(--primary); background: rgba(76,172,247,0.08); box-shadow: 0 0 0 3px rgba(76,172,247,0.15); }
.match-item.matched { border-color: var(--success); background: rgba(110,229,159,0.1); pointer-events: none; }

/* ===== TRUE/FALSE ===== */
.tf-options {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}
.tf-btn {
    padding: 1.2rem 3rem;
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--white);
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-ar);
}
.tf-btn:hover { transform: translateY(-3px); }
.tf-btn.tf-true:hover { border-color: var(--success); }
.tf-btn.tf-false:hover { border-color: var(--danger); }

/* Info cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.info-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.info-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.info-card-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.info-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
.info-card-desc { font-size: 0.9rem; color: var(--text-muted); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: none;
    border: none;
    font-family: var(--font-ar);
}
.back-btn:hover { color: var(--primary); background: rgba(76,172,247,0.06); }

/* ===== ACTIVITY POPUP OVERLAY ===== */
.activity-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1002;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(12px);
    padding: 1.5rem;
}
.activity-popup-overlay.show { opacity: 1; pointer-events: auto; }

.activity-popup-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 95%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.7) translateY(40px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}
.activity-popup-overlay.show .activity-popup-modal {
    transform: scale(1) translateY(0);
}

.activity-popup-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.06);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}
.activity-popup-close:hover {
    background: rgba(247,106,106,0.15);
    color: var(--danger);
    transform: rotate(90deg);
}

.activity-popup-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    background: linear-gradient(180deg, rgba(76,172,247,0.08), transparent);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.activity-popup-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFF9E6, #FFFCE8);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.8rem;
    animation: popBounce 0.6s ease-out;
    box-shadow: 0 4px 15px rgba(247,210,83,0.3);
}
.activity-popup-header h2 {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 0.3rem;
}
.activity-popup-header p {
    font-size: 1rem;
    color: var(--text-muted);
}

.activity-popup-body {
    padding: 1rem 2rem 2rem;
}

@keyframes popBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Start Activity Button - replaces old "Next" */
.btn-start-activity {
    background: linear-gradient(135deg, var(--accent), #FF6B35);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: var(--font-ar);
    border-radius: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 1.5rem auto 0;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(255,143,76,0.35);
    position: relative;
    overflow: hidden;
}
.btn-start-activity::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    animation: shimmerBtn 2.5s ease-in-out infinite;
}
.btn-start-activity:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 35px rgba(255,143,76,0.45);
}
.btn-start-activity:active { transform: translateY(1px); }
.btn-start-activity svg { flex-shrink: 0; }

@keyframes shimmerBtn {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

/* Activity Card with Image */
.activity-card-img {
    background: var(--white);
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
    max-width: 180px;
    gap: 0.6rem;
    user-select: none;
}
.activity-card-img img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.activity-card-img:hover {
    border-color: var(--primary);
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-md);
}
.activity-card-img:hover img { transform: scale(1.08); }
.activity-card-img .activity-label {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}
.activity-card-img.correct {
    border: 3px solid var(--success) !important;
    background: rgba(110,229,159,0.1) !important;
    animation: correctPop 0.5s;
}
.activity-card-img.incorrect {
    border: 3px solid var(--danger) !important;
    background: rgba(247,106,106,0.1) !important;
    animation: shake 0.4s;
}

/* Badge Close Button */
.badge-close-btn {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.06);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}
.badge-close-btn:hover {
    background: rgba(247,106,106,0.15);
    color: var(--danger);
}

/* SVG Icon Wrappers */
.svg-icon-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
}
.svg-icon-card svg { width: 28px; height: 28px; }

/* Quiz option with image */
.quiz-option-img {
    padding: 1rem;
    background: var(--white);
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}
.quiz-option-img img {
    width: 140px;
    height: 100px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.quiz-option-img .opt-label { font-weight: 800; font-size: 1.1rem; }
.quiz-option-img:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-sm);
}
.quiz-option-img.correct-answer {
    border-color: var(--success) !important;
    background: rgba(110,229,159,0.15) !important;
}
.quiz-option-img.wrong-answer {
    border-color: var(--danger) !important;
    background: rgba(247,106,106,0.1) !important;
}

/* ===== GAMIFICATION STATS BAR ===== */
.gamification-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gam-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    transition: transform 0.2s, box-shadow 0.2s;
}
.gam-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.gam-stat .material-icons-round { font-size: 1.8rem; }
.gam-stat div { display: flex; flex-direction: column; align-items: center; }
.gam-stat strong { font-size: 1.2rem; font-weight: 800; color: var(--text-main); }
.gam-stat small { font-size: 0.7rem; color: var(--text-muted); }

/* ===== LEGO BUILDER GAME ===== */
.lego-builder-game { max-width: 500px; margin: 0 auto; }
.lego-build-area {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    background: linear-gradient(135deg, #f8faff, #eef4ff);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 3px dashed var(--primary-light);
    margin-bottom: 1rem;
    min-height: 250px;
    align-items: center;
}
.lego-slot {
    width: 80%;
    padding: 0.8rem 1rem;
    background: rgba(76,172,247,0.08);
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: all 0.3s;
}
.lego-slot.filled {
    background: linear-gradient(135deg, var(--primary-light), rgba(110,229,159,0.2));
    border: 2px solid var(--success);
    color: var(--text-main);
    animation: popBounce 0.4s;
}
.lego-slot.filled svg { width: 36px; height: 36px; }
.lego-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}
.lego-piece {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.2rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.lego-piece:hover:not(.placed) {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}
.lego-piece.placed { opacity: 0.3; cursor: default; }
.lego-piece svg { width: 28px; height: 28px; }

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-6px); }
    40%,80% { transform: translateX(6px); }
}

/* ===== ENHANCED TEST ===== */
.test-header-enhanced {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.test-header-enhanced h1 { font-size: 1.4rem; margin-bottom: 1rem; }
.test-meta-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.test-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 1rem;
    color: var(--text-muted);
}
.test-meta-item strong { color: var(--text-main); font-size: 1.1rem; }
.test-progress-bar-wrap { margin-top: 0.5rem; }
.test-progress-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 0.8rem;
}
.test-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s;
}
.test-dot.dot-active { background: var(--primary); transform: scale(1.3); box-shadow: 0 0 0 3px rgba(76,172,247,0.3); }
.test-dot.dot-correct { background: var(--success); }
.test-dot.dot-wrong { background: var(--danger); }
.test-question-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    animation: fadeIn 0.4s;
}
.test-q-number {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.test-question-card h2 { margin-bottom: 1.5rem; font-size: 1.4rem; }
.explain-box {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-size: 0.95rem;
    animation: fadeIn 0.4s;
}
.explain-correct { background: rgba(110,229,159,0.12); border: 1px solid var(--success); }
.explain-wrong { background: rgba(247,106,106,0.08); border: 1px solid var(--danger); }

/* ===== TEST RESULT ENHANCED ===== */
.test-result-enhanced {
    animation: fadeIn 0.5s;
}
.result-header {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}
.result-pass {
    background: linear-gradient(135deg, rgba(110,229,159,0.08), rgba(76,172,247,0.08));
    border: 2px solid var(--success);
}
.result-fail {
    background: linear-gradient(135deg, rgba(247,106,106,0.05), rgba(255,143,76,0.05));
    border: 2px solid var(--accent);
}
.result-emoji { font-size: 4rem; margin-bottom: 0.5rem; }
.result-header h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.result-score-big {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
}
.result-fail .result-score-big { color: var(--accent); }
.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: var(--white);
    padding: 1.2rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.result-stat .material-icons-round { font-size: 2rem; }
.result-stat strong { font-size: 1.5rem; font-weight: 800; }
.result-stat small { font-size: 0.75rem; color: var(--text-muted); }
.result-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.result-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--primary-dark);
}
.answer-review { display: flex; flex-direction: column; gap: 0.5rem; }
.review-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
}
.review-correct { background: rgba(110,229,159,0.08); }
.review-wrong { background: rgba(247,106,106,0.06); }
.review-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.review-correct .review-num { background: var(--success); color: var(--white); }
.review-wrong .review-num { background: var(--danger); color: var(--white); }
.review-q { font-weight: 700; font-size: 0.95rem; }
.review-a { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.result-badges {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}
.result-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    transition: transform 0.2s;
}
.result-badge.earned { background: rgba(110,229,159,0.1); border: 2px solid var(--success); }
.result-badge.locked { background: var(--bg-light); border: 2px solid var(--border); opacity: 0.5; }
.result-badge-icon { font-size: 2rem; }
.result-badge-name { font-size: 0.75rem; font-weight: 700; }

/* ===== CERTIFICATE ===== */
.certificate {
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    max-width: 650px;
    margin: 0 auto;
}
.cert-border {
    border: 4px double var(--primary);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(76,172,247,0.03), rgba(110,229,159,0.03));
}
.cert-stars, .cert-stars-bottom { font-size: 2rem; margin: 0.5rem 0; }
.cert-logo { margin: 0.5rem auto; }
.cert-logo svg { width: 64px; height: 64px; }
.cert-title {
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin: 0.5rem 0;
    font-weight: 900;
}
.cert-subtitle { color: var(--text-muted); font-size: 1rem; }
.cert-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 1rem 0;
}
.cert-body { color: var(--text-main); font-size: 1.1rem; margin: 0.3rem 0; }
.cert-name {
    font-size: 2.5rem;
    color: var(--text-main);
    margin: 0.5rem 0;
    font-weight: 900;
}
.cert-level {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0.5rem 0;
}
.cert-score {
    color: var(--success-dark);
    font-weight: 700;
    font-size: 1rem;
    margin: 0.5rem 0;
}
.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.cert-date { font-size: 0.9rem; color: var(--text-muted); }
.cert-seal { font-size: 3rem; }
.cert-sig { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

/* ===== TEACHER ACTION BUTTONS ===== */
.teacher-actions {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--white);
    transition: transform 0.2s, box-shadow 0.2s;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.action-msg { background: var(--primary); }
.action-activity { background: var(--success); }
.action-report { background: var(--accent); }
.action-schedule { background: var(--purple); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ===== TEACHER MESSAGES (Parent Dashboard) ===== */
.teacher-msg-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(76,172,247,0.05);
    border-radius: var(--radius-md);
    border-right: 4px solid var(--primary);
}
.msg-avatar { font-size: 2rem; }
.msg-content { flex: 1; }
.msg-from {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.msg-time {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.msg-content p { font-size: 0.9rem; color: var(--text-main); line-height: 1.6; }

/* ===== RESPONSIVE ADDITIONS ===== */
@media (max-width: 640px) {
    .gamification-bar { padding: 0.8rem; gap: 0.3rem; }
    .gam-stat { padding: 0.4rem 0.6rem; }
    .gam-stat .material-icons-round { font-size: 1.3rem; }
    .result-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .certificate { padding: 1rem; }
    .cert-border { padding: 1.2rem; }
    .cert-name { font-size: 1.8rem; }
    .cert-title { font-size: 1.6rem; }
    .teacher-actions { gap: 0.5rem; }
    .action-btn { padding: 0.5rem 0.8rem; font-size: 0.85rem; }
    .lego-slot { width: 95%; }
}
.btn-lg { padding: 0.8rem 2rem; font-size: 1.1rem; }

/* ===== AUDIO TOGGLE BUTTON ===== */
.audio-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
    background: rgba(76,172,247,0.08);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.audio-toggle-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(76,172,247,0.4);
}
.audio-toggle-btn .material-icons-round {
    font-size: 1.4rem;
    transition: transform 0.3s;
}
.audio-toggle-btn.audio-playing {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    animation: audioPulse 1.5s ease-in-out infinite;
}
.audio-toggle-btn.audio-playing .material-icons-round {
    animation: audioWave 0.8s ease-in-out infinite alternate;
}

@keyframes audioPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76,172,247,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(76,172,247,0); }
}
@keyframes audioWave {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* ===== 2D LEGO BUILDER GAME ===== */
.lego-game-wrapper {
    text-align: center;
    width: 100%;
}

.lego-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, rgba(255,143,76,0.08), rgba(247,210,83,0.08));
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
.lego-game-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}
.lego-game-emoji {
    font-size: 2rem;
}
.lego-game-score {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--secondary-dark);
    background: rgba(247,210,83,0.15);
    padding: 0.4rem 1rem;
    border-radius: 20px;
}

.lego-game-body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.lego-game-target {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    min-width: 200px;
}
.lego-game-target h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.lego-game-target canvas {
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-sm);
}

.lego-game-main {
    flex: 1;
    display: flex;
    justify-content: center;
}
.lego-game-main canvas {
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-md);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s;
}
.lego-game-main canvas:hover {
    box-shadow: var(--shadow-md);
}

/* Palette */
.lego-game-palette {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.lego-palette-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 1rem;
    border: 3px solid var(--border);
    background: var(--white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    min-width: 80px;
}
.lego-palette-btn:hover:not(.depleted) {
    border-color: var(--brick-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.lego-palette-btn.selected {
    border-color: var(--brick-color);
    background: rgba(76,172,247,0.04);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brick-color) 25%, transparent);
    transform: translateY(-3px);
}
.lego-palette-btn.depleted {
    opacity: 0.35;
    cursor: default;
    filter: grayscale(0.8);
}

.lego-palette-brick {
    width: 36px;
    height: 36px;
    background: var(--brick-color);
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15), inset 0 3px 0 var(--brick-light);
}
.lego-palette-brick::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brick-light);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
}

.lego-palette-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}
.lego-palette-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.lego-game-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(247,210,83,0.08);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
}
.lego-game-hint .material-icons-round {
    color: var(--secondary);
    font-size: 1.3rem;
}

.lego-game-progress {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.lego-game-progress .progress-bar {
    flex: 1;
}
#legoProgressText {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .lego-game-body {
        flex-direction: column;
        align-items: center;
    }
    .lego-game-target {
        min-width: auto;
        width: 100%;
    }
    .lego-palette-btn {
        min-width: 65px;
        padding: 0.4rem 0.6rem;
    }
    .lego-palette-brick {
        width: 28px;
        height: 28px;
    }
    .audio-toggle-btn {
        width: 36px;
        height: 36px;
    }
}

/* ===== SCRATCH SIMULATOR ===== */
.scratch-sim {
    width: 100%;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #FAFBFF;
}
.scratch-sim-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #E8F0FE, #F0E8FE);
    border-bottom: 2px solid #E2E8F0;
}
.scratch-flag-btn, .scratch-stop-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.scratch-flag-btn {
    background: #E8F5E9;
    color: #2E7D32;
    border: 2px solid #A5D6A7;
}
.scratch-flag-btn:hover { background: #C8E6C9; transform: scale(1.05); }
.scratch-flag-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.scratch-stop-btn {
    background: #FFEBEE;
    color: #C62828;
    border: 2px solid #EF9A9A;
}
.scratch-stop-btn:hover { background: #FFCDD2; transform: scale(1.05); }
.scratch-sim-status {
    margin-right: auto;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.scratch-sim-body {
    display: grid;
    grid-template-columns: 160px 1fr 1fr;
    min-height: 320px;
}

/* Blocks Panel */
.scratch-blocks-panel {
    background: #F5F5F5;
    border-left: 2px solid #E2E8F0;
    padding: 0.6rem;
    overflow-y: auto;
    max-height: 400px;
}
.scratch-cat {
    margin-bottom: 0.8rem;
}
.scratch-cat-title {
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.scratch-block-item {
    background: var(--block-color);
    color: white;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    cursor: grab;
    transition: all 0.15s;
    user-select: none;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
    position: relative;
}
.scratch-block-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.scratch-block-item:active { cursor: grabbing; }
.scratch-block-item::before {
    content: '';
    position: absolute;
    top: -3px;
    right: 10px;
    width: 14px;
    height: 6px;
    background: var(--block-color);
    border-radius: 0 0 4px 4px;
    filter: brightness(1.15);
}
.scratch-block-item::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 20px;
    width: 14px;
    height: 6px;
    background: var(--block-color);
    border-radius: 0 0 4px 4px;
    filter: brightness(0.85);
}

/* Workspace */
.scratch-workspace-panel {
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    border-left: 2px solid #E2E8F0;
}
.scratch-workspace-label, .scratch-stage-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-align: center;
}
.scratch-workspace {
    flex: 1;
    background: white;
    border: 2px dashed #CBD5E0;
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    min-height: 200px;
    transition: all 0.2s;
    overflow-y: auto;
}
.scratch-workspace.drag-over {
    border-color: #4C97FF;
    background: rgba(76,151,255,0.04);
    box-shadow: inset 0 0 20px rgba(76,151,255,0.1);
}
.scratch-workspace-hint {
    text-align: center;
    color: #A0AEC0;
    font-weight: 700;
    font-size: 1rem;
    padding: 3rem 1rem;
}
.scratch-ws-block {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--block-color);
    color: white;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    animation: slideIn 0.2s ease;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
    transition: all 0.2s;
}
.scratch-ws-block.executing {
    box-shadow: 0 0 0 3px white, 0 0 0 6px var(--block-color);
    transform: scale(1.05);
}
.ws-block-num {
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.ws-block-label { flex: 1; }
.ws-block-remove {
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ws-block-remove:hover { background: rgba(255,0,0,0.4); }
.scratch-clear-btn {
    display: block;
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: #FFF3E0;
    border: 1px solid #FFE0B2;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: #E65100;
    transition: background 0.2s;
}
.scratch-clear-btn:hover { background: #FFE0B2; }

/* Stage */
.scratch-stage-panel {
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#scratchStageCanvas {
    border: 3px solid #4CACF7;
    border-radius: var(--radius-sm);
    max-width: 100%;
    height: auto;
    box-shadow: var(--shadow-sm);
}

/* Robot Nav Lesson */
.robot-nav-lesson {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.nav-commands-panel h3, .nav-maze-panel h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
}

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

@media (max-width: 768px) {
    .scratch-sim-body {
        grid-template-columns: 1fr;
    }
    .scratch-blocks-panel {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        border-left: none;
        border-bottom: 2px solid #E2E8F0;
        max-height: 150px;
    }
    .scratch-cat { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.3rem; }
    .scratch-workspace-panel { border-left: none; border-bottom: 2px solid #E2E8F0; }
    .robot-nav-lesson { grid-template-columns: 1fr; }
}

/* ===== LEGO CELEBRATION OVERLAY ===== */
.lego-celebration-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--radius-md);
}
.lego-celebration-overlay.show {
    opacity: 1;
    transform: scale(1);
}
.lego-game-wrapper {
    position: relative;
}
.lego-celebration-content {
    background: linear-gradient(145deg, #ffffff, #f0f4ff);
    border-radius: 24px;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 4px rgba(76,172,247,0.3);
    max-width: 360px;
    width: 90%;
    animation: celebPop 0.8s ease 0.3s both;
}
@keyframes celebPop {
    0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    50% { transform: scale(1.08) rotate(2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.celebration-emoji {
    font-size: 4rem;
    animation: celebBounce 0.6s ease infinite alternate;
    margin-bottom: 0.5rem;
}
@keyframes celebBounce {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-12px) scale(1.1); }
}
.celebration-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #4CACF7, #B07EF0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.celebration-stars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.cel-star {
    font-size: 2.2rem;
    display: inline-block;
    animation: starPop 0.5s ease calc(var(--delay, 0s) + 0.5s) both;
}
@keyframes starPop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    60% { transform: scale(1.4) rotate(20deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.celebration-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--secondary-dark);
    background: rgba(247,210,83,0.12);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    margin-bottom: 0.8rem;
    animation: scoreSlide 0.5s ease 1s both;
}
@keyframes scoreSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.celebration-msg {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0;
    animation: scoreSlide 0.5s ease 1.3s both;
}

/* ===== PLACEMENT TEST ===== */
.placement-test-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1rem;
}
.placement-test-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.pt-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: celebBounce 0.8s ease infinite alternate;
}
.placement-test-header h1 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 0.3rem;
}
.placement-test-header p {
    font-size: 1rem;
    color: var(--text-muted);
}

.pt-progress-section {
    margin-bottom: 1.5rem;
}
.pt-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.pt-question-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border-top: 5px solid var(--primary);
    animation: slideIn 0.3s ease;
}
.pt-question-num {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.pt-question-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.pt-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.pt-option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--bg-light);
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    transition: all 0.2s;
    text-align: right;
}
.pt-option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(76,172,247,0.05);
    transform: translateX(-5px);
    box-shadow: var(--shadow-sm);
}
.pt-option-letter {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.pt-option-text { flex: 1; }

.pt-option-btn.pt-correct {
    border-color: var(--success) !important;
    background: rgba(110,229,159,0.12) !important;
    transform: scale(1.02);
}
.pt-option-btn.pt-correct .pt-option-letter {
    background: var(--success);
    color: white;
}
.pt-option-btn.pt-wrong {
    border-color: var(--danger) !important;
    background: rgba(247,106,106,0.08) !important;
    opacity: 0.7;
}
.pt-option-btn.pt-wrong .pt-option-letter {
    background: var(--danger);
    color: white;
}

/* Results */
.pt-results {
    text-align: center;
}
.pt-results-header {
    margin-bottom: 2rem;
}
.pt-result-emoji {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: celebBounce 0.8s ease infinite alternate;
}
.pt-results h1 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 1rem;
}
.pt-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #B07EF0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(76,172,247,0.3);
}
.pt-score-pct {
    font-size: 2rem;
    font-weight: 900;
    color: white;
}
.pt-score-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    font-weight: 700;
}

.pt-level-results {
    margin: 1.5rem 0;
    text-align: right;
}
.pt-level-results h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.8rem;
}
.pt-level-result {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.pt-level-result.passed {
    background: rgba(110,229,159,0.08);
    border: 2px solid rgba(110,229,159,0.2);
}
.pt-level-result.failed {
    background: rgba(247,106,106,0.06);
    border: 2px solid rgba(247,106,106,0.15);
}
.pt-lr-icon { font-size: 1.3rem; }
.pt-lr-name { flex: 1; }
.pt-lr-score {
    background: rgba(0,0,0,0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.pt-final-level {
    margin: 1.5rem 0;
}
.pt-final-level h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}
.pt-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    border-radius: 20px;
    color: white;
    font-weight: 900;
    font-size: 1.2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    animation: celebPop 0.6s ease;
}
.pt-lb-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.pt-final-level p {
    margin-top: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* ===== ADMIN DASHBOARD STYLES ===== */
.admin-home {
    padding: 1.5rem 1rem 3rem;
}
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.admin-stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--primary);
    transition: var(--transition);
}
.admin-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.admin-stat-card.c-students { border-top-color: var(--primary); }
.admin-stat-card.c-teachers { border-top-color: var(--teal); }
.admin-stat-card.c-parents { border-top-color: var(--purple); }
.admin-stat-card.c-courses { border-top-color: var(--success); }
.admin-stat-card.c-health { border-top-color: var(--accent); }

.admin-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.admin-stat-val {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.1;
}
.admin-stat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.admin-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}
.admin-section h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.admin-table-container {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.admin-table th {
    text-align: right;
    padding: 0.8rem 1rem;
    background: var(--bg-light);
    color: var(--text-muted);
    font-weight: 800;
    border-bottom: 2px solid var(--border);
}
.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tr:hover td {
    background: rgba(76, 172, 247, 0.03);
}

.user-badge-role {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
}
.user-badge-role.student { background: rgba(76, 172, 247, 0.15); color: var(--primary-dark); }
.user-badge-role.teacher { background: rgba(61, 201, 176, 0.15); color: #0f8a70; }
.user-badge-role.parent { background: rgba(176, 126, 240, 0.15); color: #6d35b5; }
.user-badge-role.admin { background: rgba(255, 143, 76, 0.15); color: #c4520e; }

.admin-action-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    font-family: var(--font-ar);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.admin-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.admin-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.admin-tool-card {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    text-align: center;
    border: 1px dashed var(--border);
    transition: var(--transition);
}
.admin-tool-card:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: var(--shadow-sm);
}
.admin-tool-card h4 {
    margin-bottom: 0.4rem;
    color: var(--text-main);
}
.admin-tool-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

