/* main.css — DeutschTrack */

:root {
    --bg:        #0f1117;
    --bg2:       #181c27;
    --bg3:       #1e2436;
    --border:    #2a3045;
    --border2:   #323b55;
    --text:      #e8eaf0;
    --text2:     #8892aa;
    --text3:     #5a647a;
    --accent:    #4f8ef7;
    --accent2:   #2d6fda;
    --gold:      #f5c842;
    --green:     #34c97a;
    --red:       #f05252;
    --orange:    #f97316;
    --purple:    #a78bfa;
    --radius:    10px;
    --radius-lg: 16px;
    --sidebar-w: 220px;
    --topbar-h:  60px;
    --shadow:    0 4px 24px rgba(0,0,0,0.35);
    --font:      'Inter', system-ui, sans-serif;
    --font-display: 'Fraunces', serif;
    --trans:     all .18s ease;
}

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

html { font-size: 15px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0;
    z-index: 100;
    transition: transform .25s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--border);
}
.logo-de {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}
.logo-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.logo-title { display: block; font-weight: 700; font-size: .95rem; line-height: 1.2; }
.logo-sub   { display: block; font-size: .72rem; color: var(--text3); }

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text2);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    transition: var(--trans);
}
.nav-item:hover  { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(79,142,247,.15); color: var(--accent); }
.nav-item svg    { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.streak-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(249,115,22,.1);
    border: 1px solid rgba(249,115,22,.25);
    color: var(--orange);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .82rem;
    font-weight: 600;
}
.streak-badge svg { width: 16px; height: 16px; }

/* ── Topbar ──────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: var(--sidebar-w); right: 0;
    height: var(--topbar-h);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    z-index: 90;
}
.menu-toggle {
    display: none;
    background: none; border: none;
    color: var(--text2); cursor: pointer;
    padding: 6px;
}
.menu-toggle svg { width: 22px; height: 22px; }
.topbar-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

/* ── Today Panel ─────────────────────────────── */
.today-panel { position: relative; }

.today-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text2);
    border-radius: 9px;
    padding: 7px 12px;
    font-size: .84rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--trans);
    font-family: var(--font);
}
.today-trigger:hover { border-color: var(--accent); color: var(--text); }
.today-trigger.has-items { border-color: var(--accent); color: var(--accent); }
.today-trigger svg { width: 15px; height: 15px; }
.today-trigger .chevron { width: 13px; height: 13px; transition: transform .2s; }

.badge-count {
    background: var(--red);
    color: #fff;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: .74rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.today-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
}
.today-dropdown.open { display: flex; }

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
    color: var(--text2);
}
.all-done    { color: var(--green); font-weight: 600; }
.pending-count { color: var(--orange); font-weight: 600; }

.dropdown-section { padding: 8px 8px 4px; }
.section-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text3);
    padding: 2px 8px 6px;
}
.section-label.overdue { color: var(--red); }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: var(--trans);
}
.dropdown-item:hover { background: var(--bg3); }
.dropdown-item.overdue-item { border-left: 2px solid var(--red); }

.item-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.item-info { flex: 1; min-width: 0; }
.item-title {
    display: block;
    font-size: .87rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-meta { display: block; font-size: .75rem; color: var(--text3); }
.item-arrow { color: var(--text3); font-size: .85rem; }

.dropdown-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    color: var(--text3);
    text-align: center;
}
.dropdown-empty svg { width: 32px; height: 32px; color: var(--green); }
.dropdown-empty p { font-size: .84rem; line-height: 1.5; }

.dropdown-cta {
    display: block;
    text-align: center;
    padding: 12px;
    border-top: 1px solid var(--border);
    color: var(--accent);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 600;
    transition: var(--trans);
}
.dropdown-cta:hover { background: rgba(79,142,247,.08); }

/* ── Layout ──────────────────────────────────── */
.layout-wrap {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    flex: 1;
    min-height: calc(100vh - var(--topbar-h));
}
.main-content {
    padding: 28px;
    max-width: 1300px;
    margin: 0 auto;
}

/* ── Cards ───────────────────────────────────── */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title svg { width: 18px; height: 18px; color: var(--accent); }

/* ── Stat blocks ─────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-block {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stat-block .stat-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 4px;
}
.stat-block .stat-icon svg { width: 20px; height: 20px; }
.stat-val  { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text2); }

/* ── Buttons ─────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: var(--trans);
    font-family: var(--font);
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-ghost   { background: var(--bg3); border: 1px solid var(--border2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger  { background: rgba(240,82,82,.15); border: 1px solid var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(240,82,82,.25); }
.btn-success { background: rgba(52,201,122,.15); border: 1px solid var(--green); color: var(--green); }
.btn-success:hover { background: rgba(52,201,122,.25); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 11px 20px; font-size: .95rem; }

/* ── Forms ───────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: .83rem; font-weight: 600; color: var(--text2); }
.form-control {
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .9rem;
    font-family: var(--font);
    transition: var(--trans);
    outline: none;
    width: 100%;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,142,247,.15); }
select.form-control option { background: var(--bg2); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Tables ──────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; }
table.dt th {
    text-align: left;
    font-size: .77rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text3);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
table.dt td {
    padding: 11px 14px;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.dt tr:last-child td { border-bottom: none; }
table.dt tbody tr:hover td { background: var(--bg3); }

/* ── Tags / Badges ───────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.tag-blue   { background: rgba(79,142,247,.15); color: var(--accent); }
.tag-green  { background: rgba(52,201,122,.15); color: var(--green); }
.tag-orange { background: rgba(249,115,22,.15); color: var(--orange); }
.tag-red    { background: rgba(240,82,82,.15);  color: var(--red); }
.tag-purple { background: rgba(167,139,250,.15); color: var(--purple); }
.tag-gray   { background: var(--bg3); color: var(--text2); }

/* ── Checkbox custom ─────────────────────────── */
.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--trans);
}
.check-item:hover { background: var(--bg3); }
.check-item input[type=checkbox] { display: none; }
.check-box {
    width: 20px; height: 20px;
    border: 2px solid var(--border2);
    border-radius: 5px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: var(--trans);
}
.check-item input:checked + .check-box {
    background: var(--green);
    border-color: var(--green);
}
.check-item input:checked + .check-box::after {
    content: '✓';
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}
.check-item.done .check-label { text-decoration: line-through; color: var(--text3); }

/* ── Progress bar ────────────────────────────── */
.progress-wrap { background: var(--bg3); border-radius: 999px; height: 7px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }

/* ── Modal ───────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-close {
    background: none; border: none;
    color: var(--text3); cursor: pointer;
    padding: 4px; border-radius: 6px;
    transition: var(--trans);
}
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-close svg { width: 20px; height: 20px; }
.modal-body   { padding: 22px; }
.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ── Tekrar badges (1-3-9-15-30) ─────────────── */
.tekrar-steps {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tekrar-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: .78rem;
    font-weight: 700;
    border: 2px solid var(--border2);
    color: var(--text3);
    position: relative;
}
.tekrar-step.done  { background: var(--green);  border-color: var(--green);  color: #fff; }
.tekrar-step.today { background: var(--accent);  border-color: var(--accent); color: #fff; box-shadow: 0 0 0 3px rgba(79,142,247,.2); }
.tekrar-step.missed{ border-color: var(--red); color: var(--red); }
.tekrar-step.next  { border-color: var(--border2); color: var(--text3); }

/* ── Konu card ───────────────────────────────── */
.konu-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: var(--trans);
}
.konu-card:hover { border-color: var(--border2); box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.konu-color-bar { width: 4px; min-height: 40px; border-radius: 4px; flex-shrink: 0; }
.konu-body { flex: 1; min-width: 0; }
.konu-title { font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.konu-meta  { font-size: .8rem; color: var(--text3); display: flex; gap: 10px; }
.konu-actions { display: flex; gap: 6px; }
.konu-actions button { background: none; border: none; color: var(--text3); cursor: pointer; padding: 5px; border-radius: 6px; transition: var(--trans); }
.konu-actions button:hover { background: var(--bg3); color: var(--text); }
.konu-actions button svg { width: 16px; height: 16px; display: block; }

/* ── Grammatik ───────────────────────────────── */
.g-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.g-table th { background: var(--bg3); padding: 8px 12px; text-align: left; font-size: .82rem; }
.g-table td { padding: 7px 12px; border-top: 1px solid var(--border); }

/* ── Week bar chart ──────────────────────────── */
.week-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 80px;
}
.week-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.week-bar-bg { width: 100%; flex: 1; background: var(--bg3); border-radius: 5px 5px 0 0; position: relative; overflow: hidden; }
.week-bar-fill { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 5px 5px 0 0; background: var(--accent); transition: height .5s ease; }
.week-bar-fill.today { background: var(--gold); }
.week-bar-label { font-size: .72rem; color: var(--text3); }

/* ── Alert ───────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-info    { background: rgba(79,142,247,.1);  border: 1px solid rgba(79,142,247,.25);  color: var(--accent); }
.alert-success { background: rgba(52,201,122,.1);  border: 1px solid rgba(52,201,122,.25);  color: var(--green); }
.alert-warning { background: rgba(249,115,22,.1);  border: 1px solid rgba(249,115,22,.25);  color: var(--orange); }
.alert-danger  { background: rgba(240,82,82,.1);   border: 1px solid rgba(240,82,82,.25);   color: var(--red); }

/* ── Page header ─────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-header-left h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.page-header-left p { color: var(--text2); font-size: .88rem; }

/* ── Toast ───────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: .86rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn .25s ease;
    max-width: 300px;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }
.toast.info    { border-color: var(--accent); color: var(--accent); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Grid utils ──────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flex    { display: flex; }
.flex-1  { flex: 1; }
.gap-2   { gap: 8px; }
.gap-3   { gap: 12px; }
.gap-4   { gap: 16px; }
.mt-2    { margin-top: 8px; }
.mt-3    { margin-top: 12px; }
.mt-4    { margin-top: 16px; }
.mb-3    { margin-bottom: 12px; }
.mb-4    { margin-bottom: 16px; }
.text-sm { font-size: .82rem; }
.text-muted { color: var(--text3); }
.font-bold  { font-weight: 700; }
.text-center{ text-align: center; }
.w-full     { width: 100%; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 0 100vw rgba(0,0,0,.5);
    }
    .topbar { left: 0; }
    .menu-toggle { display: flex; }
    .layout-wrap { margin-left: 0; }
    .main-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .today-dropdown { right: -60px; width: 300px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}


