/* ============================================
   Teacher Site - Main Stylesheet
   Modern Blue-Gray IT Style
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Nunito:wght@300;400;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --secondary: #475569;
    --accent: #06b6d4;
    --accent-light: #67e8f9;
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-header: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ---- TICKER ---- */
.ticker-bar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: #fff;
    padding: 6px 0;
    font-size: 0.85rem;
    overflow: hidden;
    white-space: nowrap;
}
.ticker-content {
    display: inline-block;
    animation: ticker 25s linear infinite;
    padding-left: 100%;
}
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ---- HEADER ---- */
.header {
    background: var(--bg-header);
    color: #fff;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
}
.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}
.nav-menu a {
    color: #cbd5e1;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}
.nav-menu a:hover, .nav-menu a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lang-switch {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.lang-switch a {
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}
.lang-switch a.active, .lang-switch a:hover {
    color: #fff;
    background: var(--primary);
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}
.btn-secondary {
    background: var(--secondary);
    color: #fff;
}
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ---- LAYOUT ---- */
.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 64px);
}
.page-wrapper.full-width {
    grid-template-columns: 1fr;
}

/* ---- LEFT SIDEBAR ---- */
.sidebar-left {
    position: sticky;
    top: 84px;
    height: fit-content;
}
.sidebar-nav {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.sidebar-nav-title {
    padding: 16px 20px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: var(--transition);
}
.sidebar-nav a:hover {
    background: rgba(37,99,235,0.05);
    border-left-color: var(--primary-light);
    color: var(--primary);
}
.sidebar-nav a.active {
    background: rgba(37,99,235,0.08);
    border-left-color: var(--primary);
    color: var(--primary);
}
.sidebar-nav a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* ---- RIGHT SIDEBAR ---- */
.sidebar-right {
    position: sticky;
    top: 84px;
    height: fit-content;
}
.teacher-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-align: center;
}
.teacher-photo {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(255,255,255,0.8);
    position: relative;
}
.teacher-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.teacher-info {
    padding: 20px;
}
.teacher-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}
.teacher-role {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.teacher-contacts {
    text-align: left;
    font-size: 0.85rem;
}
.teacher-contacts div {
    padding: 6px 0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    min-width: 0;
}

/* ---- SLIDER ---- */
.slider {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    height: 280px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}
.slide {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.slide.active { opacity: 1; }
.slide-content {
    text-align: center;
    max-width: 500px;
}
.slide-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.slide-content p {
    font-size: 1rem;
    opacity: 0.9;
}
.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}
.slider-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: var(--transition);
}
.slider-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ---- CARDS ---- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 20px; }

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.lesson-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.lesson-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.lesson-thumb {
    width: 100%;
    height: 160px;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}
.lesson-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.lesson-card:hover .lesson-thumb img {
    transform: scale(1.05);
}
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: var(--transition);
}
.lesson-card:hover .play-overlay { opacity: 1; }
.play-btn-icon {
    width: 50px; height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
}
.lesson-body {
    padding: 16px;
}
.lesson-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.lesson-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.4;
}
.lesson-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- VIDEO PAGE ---- */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}
.video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- REACTIONS ---- */
.reactions {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}
.reaction-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text-light);
}
.reaction-btn:hover { border-color: var(--primary); color: var(--primary); }
.reaction-btn.active-like { border-color: var(--success); color: var(--success); background: rgba(16,185,129,0.05); }
.reaction-btn.active-dislike { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,0.05); }

/* ---- COMMENTS ---- */
.comment-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.comment-box textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    transition: var(--transition);
}
.comment-box textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.comment-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.comment-content { flex: 1; }
.comment-author { font-weight: 700; font-size: 0.9rem; }
.comment-time { font-size: 0.75rem; color: var(--text-muted); margin-left: 8px; }
.comment-text { font-size: 0.9rem; margin-top: 4px; color: var(--text-light); }

/* ---- TEST ---- */
.test-question {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.test-question h3 {
    font-size: 1rem;
    margin-bottom: 14px;
    color: var(--text);
}
.test-question .q-number {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 8px;
}
.test-option {
    display: block;
    padding: 10px 16px;
    margin: 6px 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}
.test-option:hover { border-color: var(--primary-light); background: rgba(37,99,235,0.03); }
.test-option input { display: none; }
.test-option.selected { border-color: var(--primary); background: rgba(37,99,235,0.08); color: var(--primary); font-weight: 600; }

.test-result {
    text-align: center;
    padding: 40px 20px;
}
.test-score {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.test-result.passed { }
.test-result.failed { }
.test-result .result-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* ---- AI CHAT ---- */
.ai-chat-container {
    max-width: 800px;
    margin: 0 auto;
}
.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border);
}
.chat-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}
.chat-msg.user { flex-direction: row-reverse; }
.chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.chat-msg.assistant .chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.chat-msg.assistant .chat-avatar { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.chat-msg.user .chat-avatar { background: var(--secondary); color: #fff; }
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}
.chat-input-area input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}
.chat-input-area input:focus { outline: none; border-color: var(--primary); }

/* ---- FORMS ---- */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--bg-card);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea.form-control { min-height: 100px; resize: vertical; }

/* ---- AUTH FORMS ---- */
.auth-container {
    max-width: 420px;
    margin: 40px auto;
}
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 36px;
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
}
.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- ADMIN ---- */
.admin-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.admin-table th {
    background: var(--bg-header);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.admin-table tr:hover td { background: rgba(37,99,235,0.02); }

/* ---- SECTION TITLES ---- */
.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 2px;
}

/* ---- GALLERY ---- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg);
    cursor: pointer;
    transition: var(--transition);
}
.gallery-item:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* ---- FAQ ---- */
.faq-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.faq-question {
    padding: 16px 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}
.faq-question:hover { background: rgba(37,99,235,0.03); }
.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: var(--text-light);
    font-size: 0.9rem;
}
.faq-item.open .faq-answer {
    max-height: 300px;
    padding: 0 20px 16px;
}
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: var(--primary);
}

/* ---- FOOTER ---- */
.footer {
    background: var(--bg-header);
    color: #94a3b8;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.85rem;
}

/* ---- ALERT ---- */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 600;
}
.alert-success { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.alert-danger { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.alert-info { background: rgba(37,99,235,0.1); color: var(--primary); border: 1px solid rgba(37,99,235,0.2); }

/* ---- BADGE ---- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-primary { background: rgba(37,99,235,0.1); color: var(--primary); }
.badge-success { background: rgba(16,185,129,0.1); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ---- PAGINATION ---- */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 24px;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- ABOUT PAGE ---- */
.about-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.about-section h2 { margin-bottom: 16px; }

/* ---- ANIMATIONS ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}
.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ---- MOBILE MENU ---- */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) {
    .page-wrapper {
        grid-template-columns: 1fr;
    }
    .sidebar-left, .sidebar-right {
        position: static;
    }
    .sidebar-left {
        order: 2;
    }
    .main-content {
        order: 1;
    }
    .sidebar-right {
        order: 3;
    }
}
@media (max-width: 768px) {
    .header { padding: 0 12px; }
    .nav-menu { display: none; }
    .nav-menu.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-header);
        padding: 12px;
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    .mobile-toggle { display: block; }
    .page-wrapper { padding: 12px; gap: 12px; }
    .slider { height: 200px; }
    .slide-content h2 { font-size: 1.2rem; }
    .lessons-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
    .chat-bubble { max-width: 85%; }
}
@media (max-width: 480px) {
    .header-inner { height: 56px; }
    .logo { font-size: 1rem; }
    .lang-switch a { padding: 3px 6px; font-size: 0.7rem; }
    .btn { padding: 6px 14px; font-size: 0.85rem; }
}

/* ---- LOADING SPINNER ---- */
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TYPING INDICATOR ---- */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 14px;
}
.typing-indicator span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}
