/* =============================================================
   Almanca Sınav Hazırlık — Stil
   Mobile-first, tek dosya, CDN'siz
   ============================================================= */

:root {
    --c-navy: #1F3864;
    --c-navy-dark: #142547;
    --c-purple: #7030A0;
    --c-green: #2E7D32;
    --c-green-bg: #E8F5E9;
    --c-red: #C62828;
    --c-red-bg: #FFEBEE;
    --c-bg: #F8F9FB;
    --c-card: #FFFFFF;
    --c-border: #E5E8EE;
    --c-text: #1F2937;
    --c-muted: #6B7280;
    --c-amber: #FFC107;
    --c-amber-bg: #FFF8E1;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(31, 56, 100, 0.08);
    --shadow-lg: 0 12px 28px rgba(31, 56, 100, 0.12);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--c-text);
    background: var(--c-bg);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 12px; color: var(--c-navy); font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 12px; }

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

.muted { color: var(--c-muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }

code { background: #F3F4F6; padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 0.85em; }

/* ---------- Buton ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit; font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    background: transparent;
    color: var(--c-text);
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--c-navy); color: #fff; }
.btn-primary:hover { background: var(--c-navy-dark); color: #fff; }
.btn-secondary { background: var(--c-purple); color: #fff; }
.btn-secondary:hover { background: #581f80; color: #fff; }
.btn-ghost { background: transparent; border-color: var(--c-border); color: var(--c-text); }
.btn-ghost:hover { background: #F3F4F6; }
.btn-danger { background: var(--c-red); color: #fff; }
.btn-danger:hover { background: #9b1c1c; color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.875rem; }
.btn.big { padding: 14px 22px; font-size: 1.05rem; }

/* ---------- Form ---------- */
label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    color: var(--c-text);
}
label input, label select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 13px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    font: inherit;
    background: #fff;
    color: var(--c-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
label input:focus, label select:focus {
    outline: none;
    border-color: var(--c-navy);
    box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.12);
}

/* ---------- Alert ---------- */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    border-left: 4px solid;
    font-size: 0.92rem;
}
.alert-error { background: var(--c-red-bg); border-color: var(--c-red); color: var(--c-red); }
.alert-info { background: #E3F2FD; border-color: #1976D2; color: #0D47A1; }
.alert-warn { background: var(--c-amber-bg); border-color: var(--c-amber); color: #6D4C00; }

/* ---------- Giriş ekranı ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #F8F9FB 0%, #E8EEF6 100%);
}
.login-page.admin-bg {
    background: linear-gradient(135deg, #F8F9FB 0%, #F0E8F6 100%);
}
.login-box {
    width: 100%; max-width: 440px;
    background: var(--c-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}
.login-header { margin-bottom: 24px; }
.brand {
    display: flex; align-items: center; gap: 14px;
}
.brand h1 { font-size: 1.25rem; margin: 0; }
.brand-sub { font-size: 0.82rem; color: var(--c-muted); margin: 2px 0 0; }
.brand-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--c-navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
    flex-shrink: 0;
}
.brand-icon.admin { background: var(--c-purple); }
.brand-icon.small { width: 32px; height: 32px; font-size: 0.85rem; border-radius: 8px; }
.brand-link { display: inline-flex; align-items: center; gap: 8px; color: var(--c-text); }
.brand-link:hover { text-decoration: none; }

.login-form h2 { font-size: 1.4rem; margin-bottom: 4px; }
.login-form > p { margin-bottom: 22px; }
.login-form .btn { margin-top: 6px; }

/* ---------- Topbar ---------- */
.topbar {
    background: var(--c-navy); color: #fff;
    padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 50;
}
.topbar.admin { background: var(--c-purple); }
.topbar a { color: #fff; }
.topbar .brand-icon.small { background: rgba(255,255,255,0.15); }
.topbar .brand-icon.small.admin { background: rgba(255,255,255,0.2); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar-nav { display: flex; gap: 6px; margin-left: 12px; }
.topbar-nav a {
    padding: 6px 12px; border-radius: 6px; font-size: 0.9rem; font-weight: 500;
    transition: background 0.15s ease;
}
.topbar-nav a:hover, .topbar-nav a.active { background: rgba(255,255,255,0.18); text-decoration: none; }

.user-chip {
    background: rgba(255,255,255,0.15); padding: 6px 12px;
    border-radius: 999px; font-size: 0.82rem;
}
.score-chip {
    background: var(--c-amber); color: #4A2D00;
    padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
}
.btn-ghost { color: #fff; border-color: rgba(255,255,255,0.3); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,0.12); }

/* ---------- Home ekranı ---------- */
.home-main {
    max-width: 1080px; margin: 32px auto; padding: 0 20px;
}
.welcome-card {
    background: var(--c-card);
    border-radius: var(--radius-lg);
    padding: 28px 30px;
    box-shadow: var(--shadow);
}
.welcome-card > h1,
.welcome-card > p.muted,
.welcome-card > .info-grid,
.welcome-card > .section-heading,
.welcome-card > p.muted.small {
    max-width: 760px;
}
.welcome-card h1 { margin-bottom: 6px; }
.welcome-card h3 { margin-top: 24px; }
.info-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; margin: 22px 0;
}
.info-item {
    background: #F3F4F6;
    border-radius: var(--radius);
    padding: 14px;
    display: flex; flex-direction: column;
}
.info-item span { font-size: 0.78rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.info-item strong { font-size: 1.05rem; margin-top: 4px; }
.topic-list {
    list-style: none; padding: 0; margin: 12px 0 0;
}
.topic-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center; gap: 12px;
}
.topic-list li:last-child { border-bottom: none; }
.topic-list span { font-size: 1.3rem; width: 30px; }

/* ---------- Section heading ---------- */
.section-heading {
    margin: 28px 0 14px;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

/* ---------- Modern konu kartları (home) ---------- */
.topic-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0 8px;
}
@media (min-width: 880px) {
    .topic-cards { grid-template-columns: repeat(4, 1fr); }
}

.topic-card {
    position: relative;
    aspect-ratio: 1 / 1;
    min-width: 0;
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.28s ease,
                filter 0.28s ease;
    box-shadow: 0 4px 14px rgba(31, 56, 100, 0.10);
    isolation: isolate;
}

/* Dekoratif beyaz blob (alt sağda büyüyor) */
.topic-card::before {
    content: '';
    position: absolute;
    width: 160%;
    height: 160%;
    right: -80%;
    bottom: -90%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 70%);
    z-index: 0;
    transition: transform 0.45s ease;
}

/* Üst sağ köşede ince ışıltı */
.topic-card::after {
    content: '';
    position: absolute;
    top: -20px; left: -20px;
    width: 100px; height: 100px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 65%);
    z-index: 0;
    pointer-events: none;
}

.topic-card:hover,
.topic-card:focus-visible {
    transform: translateY(-5px) scale(1.015);
    box-shadow: 0 18px 36px rgba(31, 56, 100, 0.22);
    text-decoration: none;
    color: #fff;
    filter: brightness(1.04) saturate(1.05);
    outline: none;
}
.topic-card:hover::before {
    transform: scale(1.15) translate(-10%, -10%);
}

.topic-card .card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 1;
    position: relative;
}

.topic-card .icon-wrap {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.topic-card .icon-wrap svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
}

.topic-card .count-badge {
    background: rgba(255, 255, 255, 0.20);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 1;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.18);
    white-space: nowrap;
}

.topic-card .card-text {
    z-index: 1;
    position: relative;
    padding-right: 28px; /* ok ikonuna yer aç */
}

.topic-card .baslik {
    display: block;
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.22;
    margin-bottom: 4px;
    color: #fff;
    letter-spacing: -0.01em;
}

.topic-card .alt {
    display: block;
    font-size: 0.76rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.85);
}

.topic-card .arrow {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 22px;
    height: 22px;
    color: rgba(255, 255, 255, 0.70);
    transition: transform 0.25s ease, color 0.25s ease;
    z-index: 1;
}
.topic-card:hover .arrow {
    color: #fff;
    transform: translateX(4px);
}

/* Kategori başına gradient renkler */
/* 10. Sınıf */
.topic-card--trennbare   { background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); }
.topic-card--uhrzeiten   { background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%); }
.topic-card--modalverben { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.topic-card--wfragen     { background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%); }
.topic-card--tagesablauf { background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%); }
.topic-card--hoeren      { background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%); }
.topic-card--wortschatz  { background: linear-gradient(135deg, #6366F1 0%, #4338CA 100%); }
/* 11. Sınıf — Urlaub & Reisen */
.topic-card--dativ       { background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%); }
.topic-card--ortsangaben { background: linear-gradient(135deg, #14B8A6 0%, #0F766E 100%); }
.topic-card--klima       { background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%); }
.topic-card--uhrzeit     { background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%); }
.topic-card--hoertext    { background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%); }

@media (max-width: 480px) {
    .topic-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .topic-card { padding: 14px; border-radius: 18px; }
    .topic-card .icon-wrap { width: 42px; height: 42px; border-radius: 12px; }
    .topic-card .icon-wrap svg { width: 22px; height: 22px; }
    .topic-card .baslik { font-size: 0.94rem; }
    .topic-card .alt { font-size: 0.72rem; }
    .topic-card .count-badge { font-size: 0.62rem; padding: 3px 7px; }
    .topic-card .arrow { width: 18px; height: 18px; bottom: 12px; right: 12px; }
}

/* ---------- Practice layout ---------- */
.practice-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    min-height: calc(100vh - 60px);
}
.sidebar {
    background: #fff;
    border-right: 1px solid var(--c-border);
    padding: 22px 16px;
    position: sticky; top: 60px; align-self: start;
    height: calc(100vh - 60px); overflow-y: auto;
}
.sidebar-title {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--c-muted); margin-bottom: 10px;
}
/* Kategori renk paleti (home.php ile birebir aynı) */
/* 10. Sınıf */
.cat-btn--trennbare,   .cat-hero--trennbare,   .category-wrap--trennbare   { --cat-c1: #4F46E5; --cat-c2: #7C3AED; }
.cat-btn--uhrzeiten,   .cat-hero--uhrzeiten,   .category-wrap--uhrzeiten   { --cat-c1: #F59E0B; --cat-c2: #EF4444; }
.cat-btn--modalverben, .cat-hero--modalverben, .category-wrap--modalverben { --cat-c1: #10B981; --cat-c2: #059669; }
.cat-btn--wfragen,     .cat-hero--wfragen,     .category-wrap--wfragen     { --cat-c1: #8B5CF6; --cat-c2: #A855F7; }
.cat-btn--tagesablauf, .cat-hero--tagesablauf, .category-wrap--tagesablauf { --cat-c1: #EC4899; --cat-c2: #DB2777; }
.cat-btn--hoeren,      .cat-hero--hoeren,      .category-wrap--hoeren      { --cat-c1: #0EA5E9; --cat-c2: #06B6D4; }
.cat-btn--wortschatz,  .cat-hero--wortschatz,  .category-wrap--wortschatz  { --cat-c1: #6366F1; --cat-c2: #4338CA; }
/* 11. Sınıf — Urlaub & Reisen */
.cat-btn--dativ,       .cat-hero--dativ,       .category-wrap--dativ       { --cat-c1: #3B82F6; --cat-c2: #1D4ED8; }
.cat-btn--ortsangaben, .cat-hero--ortsangaben, .category-wrap--ortsangaben { --cat-c1: #14B8A6; --cat-c2: #0F766E; }
.cat-btn--klima,       .cat-hero--klima,       .category-wrap--klima       { --cat-c1: #38BDF8; --cat-c2: #0284C7; }
.cat-btn--uhrzeit,     .cat-hero--uhrzeit,     .category-wrap--uhrzeit     { --cat-c1: #F59E0B; --cat-c2: #EF4444; }
.cat-btn--hoertext,    .cat-hero--hoertext,    .category-wrap--hoertext    { --cat-c1: #0EA5E9; --cat-c2: #06B6D4; }

.cat-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: transparent; border: 1.5px solid transparent;
    color: var(--c-text); cursor: pointer; width: 100%;
    font: inherit; text-align: left;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    position: relative;
}
.cat-btn:hover {
    background: #F3F4F6;
    transform: translateX(2px);
}
.cat-btn .ic {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--cat-c1, var(--c-navy)), var(--cat-c2, var(--c-purple)));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.cat-btn .ic svg { width: 18px; height: 18px; stroke: #fff; }
.cat-btn .lbl {
    font-size: 0.9rem;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cat-btn .meta {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--c-muted);
    background: #F3F4F6;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    flex-shrink: 0;
}

.cat-btn.active {
    background: linear-gradient(135deg, var(--cat-c1, var(--c-navy)), var(--cat-c2, var(--c-purple)));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 18px -6px var(--cat-c1, var(--c-navy));
    transform: translateX(0);
}
.cat-btn.active .ic {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(4px);
}
.cat-btn.active .meta {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

.sidebar-meta { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--c-border); }

.content {
    padding: 28px;
    max-width: 860px;
    width: 100%;
}
.loading { color: var(--c-muted); text-align: center; padding: 60px 20px; }

.cat-header {
    margin-bottom: 18px;
}
.cat-header h1 { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.cat-header .ic { font-size: 1.5rem; }
.cat-header .alt { color: var(--c-muted); font-size: 0.95rem; }

/* ---------- Kategori hero card (practice üstü) ---------- */
.cat-hero {
    background: linear-gradient(135deg, var(--cat-c1, var(--c-navy)) 0%, var(--cat-c2, var(--c-purple)) 100%);
    color: #fff;
    border-radius: 20px;
    padding: 22px 24px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 28px -10px var(--cat-c1, var(--c-navy));
    isolation: isolate;
}
.cat-hero::before {
    content: '';
    position: absolute;
    inset: auto -10% -60% auto;
    width: 240px; height: 240px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 60%);
    z-index: 0;
}
.cat-hero-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.18);
}
.cat-hero-icon svg { width: 32px; height: 32px; stroke: #fff; }
.cat-hero-text { z-index: 1; min-width: 0; flex: 1; }
.cat-hero-text h1 {
    color: #fff;
    margin: 0 0 4px;
    font-size: 1.5rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.cat-hero-text p {
    margin: 0;
    color: rgba(255,255,255,0.88);
    font-size: 0.92rem;
}
.cat-hero-meta {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 18px;
    background: rgba(255,255,255,0.18);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.16);
    flex-shrink: 0;
    backdrop-filter: blur(6px);
}
.cat-hero-count {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}
.cat-hero-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

@media (max-width: 640px) {
    .cat-hero { padding: 16px 18px; gap: 12px; border-radius: 16px; }
    .cat-hero-icon { width: 48px; height: 48px; border-radius: 12px; }
    .cat-hero-icon svg { width: 24px; height: 24px; }
    .cat-hero-text h1 { font-size: 1.15rem; }
    .cat-hero-text p { font-size: 0.82rem; }
    .cat-hero-meta { padding: 6px 12px; }
    .cat-hero-count { font-size: 1.3rem; }
    .cat-hero-label { font-size: 0.62rem; }
}

/* ---------- Progress satırı ---------- */
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 8px;
    font-size: 0.85rem;
}
.progress-info .progress-label { color: var(--c-muted); }
.progress-info .progress-label strong { color: var(--c-navy); font-size: 1rem; }
.progress-info .progress-correct {
    color: var(--c-green);
    font-weight: 600;
    font-size: 0.85rem;
}
.progress-bar {
    height: 8px; background: #E5E8EE; border-radius: 999px;
    overflow: hidden; margin: 0 0 22px;
}
.progress-bar > div {
    height: 100%;
    background: linear-gradient(90deg, var(--cat-c1, var(--c-navy)), var(--cat-c2, var(--c-purple)));
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 999px;
}

/* Soru numara badge'i kategorinin rengini alır */
.category-wrap .exercise-num {
    background: linear-gradient(135deg, var(--cat-c1, var(--c-navy)), var(--cat-c2, var(--c-purple)));
}

/* Input focus ring kategoriye uyar */
.category-wrap .exercise-input:focus,
.category-wrap .lueckentext input.inline:focus {
    border-color: var(--cat-c1, var(--c-navy));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat-c1, var(--c-navy)) 18%, transparent);
}

/* Primary button kategoriye uyar (sadece practice içinde) */
.category-wrap .btn-primary {
    background: linear-gradient(135deg, var(--cat-c1, var(--c-navy)), var(--cat-c2, var(--c-purple)));
    border: none;
}
.category-wrap .btn-primary:hover {
    filter: brightness(1.06) saturate(1.05);
    background: linear-gradient(135deg, var(--cat-c1, var(--c-navy)), var(--cat-c2, var(--c-purple)));
}

/* Exercise card — sol kenarda kategori vurgu çubuğu */
.category-wrap .exercise-card {
    border-left: 4px solid transparent;
    border-image: linear-gradient(180deg, var(--cat-c1, var(--c-navy)), var(--cat-c2, var(--c-purple))) 1;
}

/* W-Fragen butonları kategoriye uyar */
.category-wrap .wfragen-buttons button {
    border-color: var(--cat-c1, var(--c-navy));
    color: var(--cat-c1, var(--c-navy));
}
.category-wrap .wfragen-buttons button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--cat-c1), var(--cat-c2));
    border-color: transparent;
    color: #fff;
}

/* Flashcard kategoriye uyar */
.category-wrap--wortschatz .flashcard {
    background: linear-gradient(135deg, var(--cat-c1), var(--cat-c2));
}

.exercise-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.exercise-num {
    display: inline-block;
    background: var(--c-navy); color: #fff;
    padding: 4px 10px; border-radius: 999px;
    font-size: 0.8rem; font-weight: 600;
    margin-bottom: 14px;
}
.exercise-text { font-size: 1.25rem; line-height: 1.6; margin-bottom: 8px; color: var(--c-text); }
.digital-prompt {
    display: inline-block;
    background: linear-gradient(135deg, var(--cat-c1, var(--c-navy)), var(--cat-c2, var(--c-purple)));
    color: #fff;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    margin-right: 6px;
    letter-spacing: 0.01em;
}
.hint { color: var(--c-muted); font-size: 0.92rem; margin-bottom: 18px; }
.hint strong { color: var(--c-purple); }

.input-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.exercise-input {
    flex: 1; min-width: 120px;
    padding: 12px 14px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    font: inherit; font-size: 1rem;
    background: #fff;
}
.exercise-input:focus {
    outline: none;
    border-color: var(--c-navy);
    box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.12);
}
.exercise-input.correct { border-color: var(--c-green); background: var(--c-green-bg); }
.exercise-input.incorrect { border-color: var(--c-red); background: var(--c-red-bg); }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.wfragen-buttons {
    display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0;
}
.wfragen-buttons button {
    padding: 12px 22px;
    border: 1.5px solid var(--c-navy);
    background: #fff;
    border-radius: var(--radius);
    font: inherit; font-weight: 600; color: var(--c-navy);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1rem;
}
.wfragen-buttons button:hover:not(:disabled) { background: var(--c-navy); color: #fff; transform: translateY(-1px); }
.wfragen-buttons button.correct { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.wfragen-buttons button.incorrect { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.wfragen-buttons button:disabled { cursor: default; opacity: 0.7; }

.feedback {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    border-left: 4px solid;
}
.feedback.correct { background: var(--c-green-bg); color: var(--c-green); border-color: var(--c-green); }
.feedback.incorrect { background: var(--c-red-bg); color: var(--c-red); border-color: var(--c-red); }
.feedback strong { display: block; margin-bottom: 4px; }

/* ---------- Tagesablauf okuma kartı ---------- */
.reading-box {
    background: var(--c-amber-bg);
    border-left: 4px solid var(--c-amber);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}
.reading-box h3 { color: #6D4C00; margin-bottom: 8px; }
.reading-box p { margin: 0; line-height: 1.7; }

.rf-questions { display: flex; flex-direction: column; gap: 10px; }
.rf-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    background: #fff;
}
.rf-row .satz { flex: 1; }
.rf-buttons { display: flex; gap: 6px; }
.rf-buttons button {
    width: 38px; height: 38px;
    border: 1.5px solid var(--c-border);
    background: #fff;
    border-radius: 8px;
    font: inherit; font-weight: 700; cursor: pointer;
    transition: all 0.15s ease;
}
.rf-buttons button:hover:not(:disabled) { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }
.rf-buttons button.correct { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.rf-buttons button.incorrect { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.rf-row .neden { display: block; margin-top: 6px; font-size: 0.85rem; color: var(--c-muted); }

/* ---------- Hörverstehen (lückentext) ---------- */
.lueckentext .reading-box p { line-height: 2; }
.lueckentext input.inline {
    display: inline-block;
    width: 110px;
    padding: 4px 8px;
    border: 1.5px solid var(--cat-c1, var(--c-navy));
    border-radius: 6px;
    font: inherit;
    margin: 0 3px;
    background: #fff;
}
.lueckentext input.correct { border-color: var(--c-green); background: var(--c-green-bg); }
.lueckentext input.incorrect { border-color: var(--c-red); background: var(--c-red-bg); }

/* ---------- Audio Player (TTS) ---------- */
.audio-player {
    background: linear-gradient(135deg, var(--cat-c1, #0EA5E9), var(--cat-c2, #06B6D4));
    color: #fff;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 24px -10px var(--cat-c1, #0EA5E9);
}
.play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}
.play-btn svg { width: 26px; height: 26px; transform: translateX(1px); }
.play-btn:hover {
    background: rgba(255,255,255,0.34);
    transform: scale(1.05);
}
.play-btn.playing {
    background: #fff;
    color: var(--cat-c1, #0EA5E9);
    animation: pulse-ring 1.8s ease-in-out infinite;
}
.play-btn.playing svg { transform: none; }
@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(255,255,255,0); }
}
.audio-info { flex: 1; min-width: 0; }
.audio-info h3 { color: #fff; margin: 0 0 2px; font-size: 1.05rem; line-height: 1.2; }
.audio-info p { color: rgba(255,255,255,0.86); margin: 0; font-size: 0.82rem; }
.audio-controls { display: flex; gap: 4px; flex-shrink: 0; }
.speed-btn {
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    padding: 5px 9px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    transition: all 0.15s ease;
    min-width: 38px;
}
.speed-btn:hover { background: rgba(255,255,255,0.28); }
.speed-btn.active {
    background: #fff;
    color: var(--cat-c1, #0EA5E9);
}

@media (max-width: 560px) {
    .audio-player { flex-wrap: wrap; padding: 14px; gap: 12px; }
    .audio-info { order: 2; width: calc(100% - 76px); }
    .audio-controls { order: 3; width: 100%; justify-content: center; }
    .play-btn { width: 54px; height: 54px; }
    .play-btn svg { width: 22px; height: 22px; }
}

/* Link butonu (sesli oku gibi minik aksiyonlar için) */
.link-btn {
    background: transparent;
    border: none;
    color: var(--cat-c1, var(--c-navy));
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.link-btn:hover { color: var(--cat-c2, var(--c-purple)); }

/* ---------- Flashcard ---------- */
.flashcard {
    background: linear-gradient(135deg, var(--c-navy), var(--c-purple));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    min-height: 220px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
    transition: transform 0.2s ease;
    user-select: none;
    box-shadow: var(--shadow-lg);
}
.flashcard:hover { transform: scale(1.01); }
.flashcard .word { font-size: 2.2rem; font-weight: 700; }
.flashcard .word.tr { font-size: 1.6rem; opacity: 0.95; }
.flashcard-hint { text-align: center; color: var(--c-muted); margin: -8px 0 14px; font-size: 0.85rem; }

/* ---------- Tamamlandı kutusu ---------- */
.complete-box {
    background: #fff;
    border: 2px solid var(--c-border);
    border-radius: 20px;
    padding: 40px 28px 32px;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.complete-box::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, var(--cat-c1, var(--c-green)), var(--cat-c2, var(--c-green)));
}
.complete-box .complete-emoji {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 12px;
    animation: bounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.complete-box h2 {
    color: var(--c-text);
    margin-bottom: 4px;
    font-size: 1.6rem;
}
.complete-box .big-num {
    font-size: 3.6rem; font-weight: 800;
    background: linear-gradient(135deg, var(--cat-c1, var(--c-green)), var(--cat-c2, var(--c-green)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 14px 0 6px;
    line-height: 1;
    letter-spacing: -0.02em;
}
.complete-box .big-num-of {
    font-size: 1.6rem;
    color: var(--c-muted);
    -webkit-text-fill-color: var(--c-muted);
    font-weight: 600;
}
.complete-box .complete-yuzde {
    color: var(--c-muted);
    font-size: 0.95rem;
    margin: 0 0 24px;
}
.complete-box .complete-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Admin ---------- */
.admin-main { max-width: 1200px; margin: 24px auto; padding: 0 20px; }

.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px; margin-bottom: 22px;
}
.stat-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 6px;
}
.stat-card.highlight { background: linear-gradient(135deg, var(--c-purple), var(--c-navy)); color: #fff; }
.stat-card.highlight .stat-label { color: rgba(255,255,255,0.85); }
.stat-label { font-size: 0.78rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--c-navy); display: flex; align-items: center; gap: 8px; }
.stat-card.highlight .stat-value { color: #fff; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: #4ADE80; display: inline-block; }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.3); } }

.filter-row { margin-bottom: 18px; }
.filters {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    background: #fff; padding: 14px 16px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.filters select, .filters input {
    padding: 8px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    font: inherit; font-size: 0.92rem;
    background: #fff;
}

.data-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; margin-bottom: 14px;
}
.inline-form { display: inline; }

.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.92rem;
}
.data-table th {
    text-align: left; padding: 12px 10px;
    background: #F9FAFB;
    color: var(--c-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.data-table tr:hover td { background: #FAFBFC; }
.data-table .mono { font-size: 0.78rem; }

.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}
.badge.active { background: #DCFCE7; color: #166534; }
.badge.warn { background: #FEF3C7; color: #92400E; }
.badge.done { background: #E0E7FF; color: #3730A3; }

.archive-list { list-style: none; padding: 0; }
.archive-list li {
    padding: 10px 0; border-bottom: 1px solid var(--c-border);
    color: var(--c-muted); font-size: 0.9rem;
}

/* ---------- Modal ---------- */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    max-width: 640px; width: 100%;
    max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.modal-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--c-border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 { margin: 0; }
.modal-close {
    border: none; background: transparent;
    font-size: 1.6rem; cursor: pointer;
    color: var(--c-muted); width: 32px; height: 32px;
    border-radius: 8px;
}
.modal-close:hover { background: #F3F4F6; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-body dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; }
.modal-body dt { color: var(--c-muted); font-size: 0.88rem; }
.modal-body dd { margin: 0; }
.modal-body .cat-progress {
    margin-top: 16px; padding: 12px; background: #F9FAFB;
    border-radius: var(--radius); border: 1px solid var(--c-border);
}
.modal-body .cat-progress h4 { margin: 0 0 8px; font-size: 0.95rem; }
.modal-body .cat-row {
    display: flex; justify-content: space-between; padding: 5px 0;
    font-size: 0.9rem; border-bottom: 1px dashed var(--c-border);
}
.modal-body .cat-row:last-child { border-bottom: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .practice-layout { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky; top: 60px; z-index: 40;
        height: auto;
        background: #fff;
        border-right: none; border-bottom: 1px solid var(--c-border);
        padding: 12px 14px;
        box-shadow: 0 2px 8px rgba(31, 56, 100, 0.05);
    }
    .sidebar .sidebar-title { display: none; }
    .sidebar nav {
        display: flex; gap: 8px; overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }
    .sidebar nav::-webkit-scrollbar { height: 4px; }
    .sidebar nav::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }
    .cat-btn {
        flex-shrink: 0;
        padding: 8px 12px 8px 8px;
        margin-bottom: 0;
        border-radius: 999px;
    }
    .cat-btn .meta { display: none; }
    .cat-btn .ic { width: 28px; height: 28px; border-radius: 8px; }
    .cat-btn .ic svg { width: 16px; height: 16px; }
    .cat-btn .lbl { font-size: 0.85rem; max-width: 130px; }
    .sidebar-meta { display: none; }
    .content { padding: 18px; }
}
@media (max-width: 640px) {
    body { font-size: 14px; }
    .topbar { padding: 10px 14px; gap: 8px; }
    .topbar-left, .topbar-right { gap: 8px; }
    .user-chip { font-size: 0.72rem; padding: 4px 8px; }
    .topbar-nav { margin-left: 0; }
    .info-grid { grid-template-columns: 1fr; }
    .exercise-text { font-size: 1.05rem; }
    .exercise-card { padding: 18px; }
    .login-box { padding: 24px 20px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 1.4rem; }
    .flashcard { padding: 40px 20px; min-height: 180px; }
    .flashcard .word { font-size: 1.7rem; }
}
