/* Novglot — CSS avec variables dynamiques par langue */

:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #1e3a5f;
    --correct: #10b981;
    --wrong: #ef4444;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #e5e7eb;
    --sidebar-active: var(--primary);
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem 1rem;
}

.sidebar-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.sidebar-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.lang-flag { font-size: 1.2rem; }

.lang-switcher {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.lang-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.2s;
}
.lang-chip:hover { background: rgba(255,255,255,0.2); }
.lang-chip.active { background: var(--primary); color: #fff; }

.nav-links {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.15s;
}

.nav-links li a:hover { background: rgba(255,255,255,0.08); }
.nav-links li a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.nav-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }
.nav-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 0.5rem 0; }

/* === MAIN CONTENT === */
.main-content {
    margin-left: 220px;
    padding: 2rem;
    max-width: 1200px;
}

.main-public {
    padding: 0;
    max-width: 100%;
}

/* === HAMBURGER === */
.hamburger {
    display: none;
    position: fixed;
    top: 0.75rem; left: 0.75rem;
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}

/* === FLASH MESSAGES === */
.flash-messages { margin-bottom: 1rem; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: opacity 0.3s;
}
.flash-error { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.flash-success { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.flash-info { background: #eff6ff; color: #2563eb; border: 1px solid #93c5fd; }

/* === PAGE HEADER === */
.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.6rem;
    color: var(--accent);
}

/* === CARDS === */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

/* === GRIDS === */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    min-height: 44px;
    white-space: nowrap;
}
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-small { padding: 0.25rem 0.6rem; font-size: 0.8rem; min-height: 32px; }
.btn-large { padding: 0.75rem 1.5rem; font-size: 1.05rem; }
.btn-full { width: 100%; }

.btn-correct { background: var(--correct); color: #fff; border-color: var(--correct); }
.btn-correct:hover { background: #059669; }
.btn-wrong { background: var(--wrong); color: #fff; border-color: var(--wrong); }
.btn-wrong:hover { background: #dc2626; }
.btn-hard { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.btn-hard:hover { background: #d97706; }
.btn-flip { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === FORMS === */
.input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    min-height: 44px;
    width: 100%;
    background: var(--surface);
    color: var(--text);
}
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.input-sm { max-width: 200px; }

.input-target { border-left: 3px solid var(--primary); }
.input-native { border-left: 3px solid #2563eb; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-check label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.form-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.form-inline { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }

small.text-muted { font-size: 0.8rem; color: var(--text-muted); display: block; margin-top: 0.25rem; }

/* === TABLES === */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.table th, .table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th { font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
.table tbody tr:hover { background: #f9fafb; }
.table-compact th, .table-compact td { padding: 0.35rem 0.5rem; }

/* === TOOLBAR === */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.toolbar-actions { display: flex; gap: 0.5rem; }
.filters-form { display: flex; gap: 0.5rem; }

/* === ADD FORM === */
.add-form {
    background: #f9fafb;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* === DIFFICULTY BADGES === */
.diff-1 { color: var(--correct); font-weight: 700; }
.diff-2 { color: #3b82f6; font-weight: 700; }
.diff-3 { color: #f59e0b; font-weight: 700; }
.diff-4 { color: #f97316; font-weight: 700; }
.diff-5 { color: var(--wrong); font-weight: 700; }

/* === CATEGORIES === */
.category-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: #f3f4f6;
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s;
}
.category-tag:hover { background: #e5e7eb; }
.category-tag-sm {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #f3f4f6;
    font-size: 0.8rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--text-muted);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-primary { background: var(--primary); }

/* === QUICK ACTIONS === */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* === FLASHCARDS === */
.flashcard-container { max-width: 700px; margin: 0 auto; }
.flashcard-filters { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; align-items: center; }

.flashcard {
    width: 100%;
    max-width: 550px;
    height: 300px;
    margin: 1.5rem auto;
    perspective: 1000px;
    cursor: pointer;
}

.fc-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}

.flashcard.flipped .fc-inner { transform: rotateY(180deg); }

.fc-front, .fc-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.fc-front {
    background: var(--surface);
    border: 2px solid var(--border);
}

.fc-back {
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
    color: #fff;
    transform: rotateY(180deg);
}

.fc-word { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.fc-hint { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; }
.fc-context, .fc-grammar { font-size: 0.9rem; opacity: 0.85; margin-top: 0.3rem; }
.fc-interval { font-size: 0.8rem; opacity: 0.6; margin-top: 0.75rem; }
.fc-badge {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.fc-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.fc-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

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

.fc-end { text-align: center; padding: 2rem; }
.fc-end h2 { margin-bottom: 0.5rem; }

/* === EXERCISES === */
.ex-config {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.ex-card {
    max-width: 650px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
}

.ex-type-badge {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.ex-question { font-size: 1.15rem; font-weight: 600; margin-bottom: 1.25rem; padding-right: 5rem; }

.ex-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ex-option {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    transition: all 0.15s;
}
.ex-option:hover { background: #f3f4f6; border-color: var(--primary); }
.ex-option:disabled { cursor: default; }
.ex-option-correct { background: #f0fdf4 !important; border-color: var(--correct) !important; color: #16a34a; }
.ex-option-wrong { background: #fef2f2 !important; border-color: var(--wrong) !important; color: #dc2626; }

.ex-input-area { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.ex-feedback {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.ex-correct { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.ex-wrong { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }

/* === CONJUGATION === */
.conj-header { margin-bottom: 1.5rem; }
.conj-header h2 { color: var(--primary); }
.conj-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.conj-section { background: #f9fafb; border-radius: var(--radius); padding: 1rem; }
.conj-section h3 { font-size: 1rem; color: var(--accent); margin-bottom: 0.5rem; }

/* === CHAT === */
.chat-card { padding: 0; display: flex; flex-direction: column; max-width: 800px; }
.chat-header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }

.chat-messages {
    flex: 1;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.msg-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.msg-assistant {
    align-self: flex-start;
    background: #f3f4f6;
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.msg-user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.typing-indicator { opacity: 0.6; animation: blink 1s infinite; }

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}
.chat-input .input { flex: 1; }

/* === AUTH === */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
}

.auth-card h1 { text-align: center; margin-bottom: 1.5rem; color: var(--accent); }
.auth-link { text-align: center; margin-top: 1.25rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-link a { color: var(--primary); }

/* === PROFILE === */
.lang-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.lang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    background: #f9fafb;
}
.lang-active { background: #eff6ff; border: 1px solid #93c5fd; }

/* === LANDING === */
.landing { max-width: 1100px; margin: 0 auto; padding: 2rem; }

.landing-hero {
    text-align: center;
    padding: 5rem 1rem 4rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #93c5fd;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.landing-hero h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1px;
}

.text-primary { color: var(--primary); }

.landing-subtitle {
    font-size: 1.4rem;
    color: var(--text);
    margin-top: 0.75rem;
    font-weight: 500;
}

.landing-desc {
    max-width: 650px;
    margin: 1.25rem auto 2.5rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.landing-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-langs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    font-size: 2rem;
}

.landing-section {
    margin: 4rem 0;
}

.section-title {
    font-size: 2rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.step-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
}

.step-number {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0 auto 1rem;
}

.step-card h3 { color: var(--accent); margin-bottom: 0.5rem; font-size: 1rem; }
.step-card p { color: var(--text-muted); font-size: 0.85rem; }

/* Features */
.landing-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { color: var(--accent); margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

/* Social proof */
.social-proof {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    background: linear-gradient(135deg, var(--accent), #2d2d44);
    border-radius: var(--radius);
    padding: 2.5rem;
    color: #fff;
}

.proof-item { text-align: center; }
.proof-number {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.proof-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* === PRICING === */
.landing-pricing { text-align: center; margin: 4rem 0; }
.landing-pricing h2 { font-size: 2rem; color: var(--accent); margin-bottom: 2.5rem; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 950px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    position: relative;
}

.pricing-featured {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pricing-card h3 { font-size: 1.3rem; color: var(--accent); margin-bottom: 0.5rem; }
.pricing-price { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

.pricing-card ul {
    list-style: none;
    margin-bottom: 1.5rem;
    text-align: left;
}

.pricing-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text);
}

/* Final CTA */
.landing-final-cta {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border-radius: var(--radius);
    margin: 3rem 0;
}
.landing-final-cta h2 { font-size: 1.8rem; color: var(--accent); margin-bottom: 0.5rem; }
.landing-final-cta p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.05rem; }

/* Footer */
.landing-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* === LESSON === */
.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.lesson-timer {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
}
.lesson-timer.paused { opacity: 0.5; }

.lesson-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.vocab-list {
    max-height: 400px;
    overflow-y: auto;
}
.vocab-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.vocab-item:last-child { border-bottom: none; }
.vocab-item-target { font-weight: 600; color: var(--primary); }

.translate-box {
    background: #f9fafb;
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 0.75rem;
}
.translate-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.75rem;
}

.ai-comment {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #93c5fd;
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}
.ai-comment h4 { color: var(--primary); margin-bottom: 0.5rem; }

.recording-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.75rem;
}
.rec-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--wrong);
    animation: pulse 1s infinite;
}

.mini-chat {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1rem;
}
.mini-chat-messages {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.mini-chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-top: 1px solid var(--border);
}
.mini-chat-input .input { flex: 1; min-height: 36px; }

.summary-bar {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.summary-stat { text-align: center; }
.summary-stat-number { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.summary-stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* === CONTENT === */
.content-source-tabs {
    display: flex;
    gap: 0.5rem;
}
.source-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.content-list { display: flex; flex-direction: column; gap: 0.75rem; }

.content-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow 0.15s;
}
.content-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.content-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-item-title {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
}
.content-item-title:hover { color: var(--primary); }

.content-item-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.content-item-summary {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.content-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.content-type-article { background: #3b82f6; }
.content-type-youtube { background: #ef4444; }
.content-type-text { background: #8b5cf6; }
.content-type-podcast { background: #f59e0b; }
.content-type-rss { background: #f97316; }

/* === FEEDBACK WIDGET === */
.feedback-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 500;
}

.feedback-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.feedback-fab:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }

.feedback-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 320px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    padding: 1rem;
    border: 1px solid var(--border);
}

.feedback-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.feedback-types {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.fb-type-btn {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}
.fb-type-btn:hover { background: #f3f4f6; }
.fb-type-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Feedback admin */
.fb-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}
.fb-type-bug { background: #ef4444; }
.fb-type-idea { background: #f59e0b; }
.fb-type-improvement { background: #3b82f6; }
.fb-type-feedback { background: #6b7280; }

/* === SWITCH TOGGLE === */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}
.switch-slider:before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider:before { transform: translateX(20px); }

/* === ANIMATIONS === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* === ONBOARDING === */
.onboarding-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.onboarding-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
}
.step-dot.active { background: var(--primary); color: #fff; }

.step-line {
    width: 60px;
    height: 3px;
    background: var(--border);
}

.onboarding-step { display: none; }
.onboarding-step.active { display: block; animation: fadeIn 0.3s ease; }

.onboarding-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.onboarding-card h1 { font-size: 1.8rem; color: var(--accent); margin-bottom: 0.5rem; }
.onboarding-card h2 { font-size: 1.5rem; color: var(--accent); }

.onboarding-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.level-card {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.level-card:hover { border-color: var(--primary); }
.level-card.selected { border-color: var(--primary); background: #eff6ff; }

.level-code { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.level-name { font-weight: 600; margin-top: 0.25rem; }
.level-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.objectives-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.objective-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.objective-card:hover { border-color: var(--primary); }
.objective-card.selected { border-color: var(--primary); background: #eff6ff; }
.obj-icon { font-size: 1.8rem; margin-bottom: 0.3rem; }
.objective-card small { font-size: 0.8rem; color: var(--text-muted); }

.goal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.goal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.goal-card:hover { border-color: var(--primary); }
.goal-card.selected { border-color: var(--primary); background: #eff6ff; }
.goal-icon { font-size: 1.5rem; }
.goal-card small { font-size: 0.75rem; color: var(--text-muted); }

.recap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.recap-item { text-align: center; padding: 1rem; background: #f9fafb; border-radius: var(--radius); }
.recap-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }
.recap-value { font-size: 1.3rem; font-weight: 700; color: var(--primary); margin-top: 0.25rem; }

/* === GAMIFICATION BAR === */
.gam-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.gam-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.gam-level-badge {
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.gam-xp-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}
.gam-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: 4px;
    transition: width 0.5s ease;
}
.gam-xp-text { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

.gam-streak {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.gam-streak-fire {
    font-size: 1.3rem;
    font-weight: 800;
    color: #f59e0b;
}
.gam-streak-label { font-size: 0.8rem; color: var(--text-muted); }

.gam-cecr {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.gam-cecr-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    background: #f3f4f6;
    color: var(--text);
}
.gam-cecr-target { background: var(--primary); color: #fff; }
.gam-cecr-arrow { color: var(--text-muted); }

/* === ACHIEVEMENTS === */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.2s;
}
.achievement-item.unlocked { background: #f0fdf4; border: 1px solid #86efac; }
.achievement-item.locked { background: #f9fafb; border: 1px solid var(--border); opacity: 0.5; filter: grayscale(1); }
.achievement-icon { font-size: 1.8rem; }
.achievement-name { font-size: 0.8rem; font-weight: 600; margin-top: 0.25rem; }
.achievement-xp { font-size: 0.7rem; color: var(--primary); }

/* === MODALS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

/* === PLACEMENT === */
.placement-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}
.placement-progress .progress-bar { flex: 1; }

.placement-question { padding: 0 1rem 1rem; }

.placement-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.15s;
}
.placement-option:hover { border-color: var(--primary); background: #eff6ff; }

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

/* === UTILITIES === */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* === ANIMATIONS === */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .sidebar { width: 60px; }
    .nav-text { display: none; }
    .sidebar-header h2 { font-size: 0; }
    .sidebar-lang span:last-child { display: none; }
    .lang-switcher { display: none; }
    .main-content { margin-left: 60px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .landing-features { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .social-proof { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-featured { transform: none; }
}

@media (max-width: 768px) {
    .hamburger { display: block; }
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        transition: transform 0.3s;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open ~ .sidebar-overlay { display: block; }
    .nav-text { display: inline; }
    .sidebar-header h2 { font-size: 1.4rem; }
    .sidebar-lang span:last-child { display: inline; }
    .lang-switcher { display: flex; }
    .main-content { margin-left: 0; padding: 1rem; padding-top: 3.5rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .flashcard { height: 220px; }
    .fc-word { font-size: 1.5rem; }
    .ex-options { grid-template-columns: 1fr; }
    .landing-hero h1 { font-size: 2.5rem; }
    .landing-features { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; }
    .social-proof { grid-template-columns: repeat(2, 1fr); padding: 1.5rem; }
    .hero-langs { font-size: 1.5rem; }
    .lesson-grid { grid-template-columns: 1fr; }
    .feedback-panel { width: 280px; right: -0.5rem; }
    .level-grid { grid-template-columns: repeat(2, 1fr); }
    .objectives-grid { grid-template-columns: 1fr; }
    .goal-grid { grid-template-columns: repeat(2, 1fr); }
    .gam-bar { flex-direction: column; align-items: stretch; }
    .gam-level { min-width: auto; }
    .achievements-grid { grid-template-columns: repeat(3, 1fr); }
    .content-source-tabs { flex-wrap: wrap; }
}
