/* english.uz — asosiy uslublar */

:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --ink: #1e2433;
    --ink-soft: #5b6472;
    --brand: #3457d5;
    --brand-dark: #24399c;
    --brand-soft: #eaeeff;
    --good: #1f9d55;
    --good-soft: #e7f8ee;
    --bad: #d64545;
    --bad-soft: #fdecec;
    --border: #e4e7ef;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.brand {
    font-weight: 800;
    font-size: 18px;
    color: var(--ink);
}
.brand-dot { color: var(--brand); }
.nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}
.nav-link {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
}
.nav-link:hover { background: var(--brand-soft); text-decoration: none; }
.nav-link.active { background: var(--brand); color: #fff; }
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--ink-soft);
}
.logout-link { color: var(--bad); font-weight: 600; }

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* Ixcham rejim: kunlik dars sahifasi (day.php) uchun -- barcha asosiy
   elementlar (nav, taxminiy vaqt, audio tezligi, flashcard, tugmalar)
   qo'shimcha pastga aylantirmasdan bitta ekranga sig'ishi uchun. */
.page-compact {
    padding-top: 14px;
    padding-bottom: 24px;
}
.page-compact h1 { font-size: 21px; margin-bottom: 3px; }
.page-compact .subtitle { margin-bottom: 10px; }
.page-compact p.page-compact-line { margin: 4px 0; }
.page-compact .card:not(.flashcard) { margin-bottom: 12px; padding: 16px 20px; }
.page-compact .card.flashcard { margin-bottom: 12px; }

.footer {
    text-align: center;
    color: var(--ink-soft);
    font-size: 13px;
    padding: 24px;
}

h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 20px; margin: 0 0 12px; }
.subtitle { color: var(--ink-soft); margin: 0 0 24px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--brand); }
.stat-label { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }

.btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.secondary {
    background: var(--brand-soft);
    color: var(--brand-dark);
}
.btn.secondary:hover { background: #dde3ff; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.speed-btn { padding: 4px 12px; font-size: 12px; }
.speed-btn.active { background: var(--brand); color: #fff; }
.vocab-mode-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.listening:disabled {
    opacity: 1;
    background: var(--bad-soft);
    color: var(--bad);
    cursor: default;
    animation: pulse-listening 1.1s ease-in-out infinite;
}
@keyframes pulse-listening {
    0%, 100% { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(214, 69, 69, 0); }
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

input[type=text], input[type=password], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}
label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; }

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert.success { background: var(--good-soft); color: var(--good); }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); }

.progress-bar {
    background: var(--border);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    background: var(--brand);
    height: 100%;
    border-radius: 999px;
}

.login-wrap {
    max-width: 380px;
    margin: 10vh auto;
    padding: 0 20px;
}
.login-wrap .card { padding: 30px; }
.login-logo { text-align: center; font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.login-logo .brand-dot { color: var(--brand); }
.login-sub { text-align: center; color: var(--ink-soft); margin-bottom: 24px; font-size: 14px; }

/* Flashcard */
.flashcard {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    padding: 24px 30px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}
.speak-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--brand-soft);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
}
.speak-btn:hover { background: #dde3ff; }
.speak-btn-inline {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    vertical-align: middle;
    opacity: 0.7;
}
.speak-btn-inline:hover { opacity: 1; }
.flashcard-word { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.flashcard-hint { color: var(--ink-soft); font-size: 13px; }
.flashcard-translation { font-size: 24px; font-weight: 700; color: var(--brand); display: none; }
.flashcard-example { display: none; margin-top: 14px; font-size: 14px; line-height: 1.5; }
.flashcard-example p { margin: 3px 0; font-style: italic; }
.flashcard-example-uz { color: var(--ink-soft); }
.flashcard.flipped .flashcard-word { display: none; }
.flashcard.flipped .flashcard-translation { display: block; }
.flashcard.flipped .flashcard-example { display: block; }
.flashcard.flipped .flashcard-hint { display: none; }

.srs-buttons {
    max-width: 480px;
    margin: 10px auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.srs-buttons button {
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}
.btn-again { background: var(--bad-soft); color: var(--bad); }
.btn-know { background: var(--good-soft); color: var(--good); }

/* Gap tuzish (sentence builder) */
.sentence-slot-row, .sentence-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 44px;
    padding: 10px;
    border-radius: 10px;
}
.sentence-slot-row {
    border: 2px dashed var(--border);
    margin-bottom: 14px;
}
.sentence-chip {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 15px;
    cursor: pointer;
}
.sentence-chip:hover:not(:disabled) { border-color: var(--brand); }
.sentence-chip:disabled { opacity: 0.4; cursor: default; }
.sentence-chip.built {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand-dark);
    font-weight: 600;
}
.sentence-chip.built:disabled { opacity: 1; }

/* Juftlikni topish (matching game) */
.match-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}
.match-item {
    display: block;
    width: 100%;
    padding: 12px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.match-item:hover:not(:disabled) { border-color: var(--brand); }
.match-item.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.match-item.matched { background: var(--good-soft); border-color: var(--good); color: var(--good); cursor: default; }
.match-item.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }

/* Tinglab tanlash (listening choice) */
.listen-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}
.listen-choice-btn {
    padding: 14px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.listen-choice-btn:hover:not(:disabled) { border-color: var(--brand); }
.listen-choice-btn:disabled { cursor: default; }
.listen-choice-btn.correct { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.listen-choice-btn.incorrect { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }

/* Topic / dialog list */
.topic-list { display: flex; flex-direction: column; gap: 10px; }
.topic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.topic-row:hover { border-color: var(--brand); }
.topic-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 13px;
    margin-right: 10px;
}
.badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
}
.badge.done { background: var(--good-soft); color: var(--good); }
.badge.approved { background: var(--good-soft); color: var(--good); }
.badge.pending { background: var(--brand-soft); color: var(--brand-soft-ink); }
.badge.rejected { background: var(--bad-soft); color: var(--bad); }
.badge.admin { background: var(--bad-soft); color: var(--bad); }

/* Admin panel jadvali */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table th { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.admin-table td:last-child, .admin-table th:last-child { white-space: normal; }

/* Quiz question */
.question-block { margin-bottom: 22px; }
.question-text { font-weight: 700; margin-bottom: 10px; font-size: 16px; }
.choice {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    background: #fff;
}
.choice:hover { border-color: var(--brand); }
.choice input { margin-right: 10px; }
.choice.correct { background: var(--good-soft); border-color: var(--good); }
.choice.incorrect { background: var(--bad-soft); border-color: var(--bad); }

/* Dialog reading */
.dialog-line { display: flex; margin-bottom: 12px; gap: 10px; }
.dialog-speaker {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
}
.dialog-bubble {
    background: var(--bg);
    border-radius: 12px;
    padding: 10px 14px;
    flex: 1;
}
.dialog-en { font-weight: 600; }
.dialog-uz { color: var(--ink-soft); font-size: 13px; margin-top: 3px; }

/* Chat */
.chat-window {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    height: 55vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}
.msg { max-width: 75%; padding: 10px 14px; border-radius: 14px; font-size: 15px; }
.msg-user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg-assistant { align-self: flex-start; background: var(--bg); color: var(--ink); border-bottom-left-radius: 4px; white-space: pre-wrap; }
.chat-form { display: flex; gap: 10px; }
.chat-form textarea { resize: none; height: 52px; }

.empty-state { text-align: center; color: var(--ink-soft); padding: 40px 20px; }

/* Kunlik dars bo'lim navigatsiyasi */
.day-section-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.day-section-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 14px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
    flex: 1;
    min-width: 80px;
    text-align: center;
}
.day-section-tab:hover { border-color: var(--brand); text-decoration: none; }
.day-section-tab.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.day-section-tab.done { color: var(--good); }
.day-section-tab.locked { opacity: 0.5; cursor: not-allowed; }
.day-section-icon { font-size: 17px; }

/* Lug'at bo'limining ichki bosqich (Kartochka/Juftlik/Tinglab/Tezkor) tugmalari */
.vocab-mode-btn.locked { opacity: 0.45; cursor: not-allowed; }
.vocab-mode-btn.mode-done { border-color: var(--good); color: var(--good); }

/* Bitta-bittadan ko'rsatiladigan test/mashq savollari uchun progress yozuvi */
.quiz-progress { text-align: center; color: var(--ink-soft); font-size: 13px; margin-bottom: 14px; font-weight: 600; }

/* Kurs yo'l xaritasi (index.php) */
.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin: 20px 0;
}
.roadmap-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    aspect-ratio: 1;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink-soft);
}
.roadmap-day-num { line-height: 1.1; }
.roadmap-day-date {
    font-size: 9px;
    font-weight: 600;
    opacity: 0.8;
    letter-spacing: 0.2px;
}
.roadmap-day.done { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.roadmap-day.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.roadmap-day.locked { opacity: 0.45; }
.roadmap-day.clickable:hover { border-color: var(--brand); text-decoration: none; }

.speaking-prompt { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.speaking-prompt:last-child { border-bottom: none; }

@media (max-width: 640px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; }
    .nav { width: 100%; }
    .msg { max-width: 90%; }
    .day-section-tab span:last-child { display: none; }
}
