/* =====================================================================
   İçerik Üreticisi Rehberi — Ana Stil (soft-modern, responsive)
   Açık/Koyu tema · Sidebar · Kartlar · İlerleme öğeleri
   ===================================================================== */

:root {
    --bg: #f4f5fb;
    --surface: #ffffff;
    --surface-2: #f8f9fd;
    --border: #e6e8f0;
    --text: #1f2330;
    --text-soft: #6b7180;
    --muted: #9aa0ad;
    --primary: #6c5ce7;
    --primary-dark: #5847d6;
    --primary-soft: #ede9ff;
    --accent: #00b894;
    --warn: #f39c12;
    --danger: #e74c3c;
    --info: #0984e3;
    --shadow: 0 1px 3px rgba(20, 22, 40, .06), 0 6px 20px rgba(20, 22, 40, .05);
    --shadow-lg: 0 10px 40px rgba(20, 22, 40, .12);
    --radius: 14px;
    --radius-sm: 9px;
    --sidebar-w: 264px;
    --header-h: 62px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

html[data-theme="dark"] {
    --bg: #14151c;
    --surface: #1d1f2a;
    --surface-2: #232633;
    --border: #2e3140;
    --text: #eceef4;
    --text-soft: #a7adbd;
    --muted: #7d8394;
    --primary: #8b7cf0;
    --primary-dark: #7a6ae8;
    --primary-soft: #2a2745;
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--text-soft); }
small { color: var(--muted); }
img { max-width: 100%; height: auto; }

/* ---------- Auth / Blank ---------- */
.auth-body, .blank-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
    background: linear-gradient(135deg, #6c5ce7 0%, #8b7cf0 50%, #00b894 140%);
}
html[data-theme="dark"] .auth-body { background: linear-gradient(135deg, #241f3d 0%, #191b26 60%, #10221c 140%); }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; color: #fff; margin-bottom: 22px; }
.auth-logo { font-size: 44px; }
.auth-brand h1 { color: #fff; font-size: 1.5rem; margin: 6px 0 4px; }
.auth-brand p { color: rgba(255,255,255,.85); margin: 0; font-size: .92rem; }
.auth-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 30px 26px;
}
.auth-card h2 { margin-bottom: 18px; }
.auth-links { margin-top: 16px; text-align: center; font-size: .9rem; }
.blank-wrap { width: 100%; max-width: 480px; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
    transition: transform .25s ease;
}
.main {
    flex: 1; min-width: 0; margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
}
.sidebar-head { height: var(--header-h); display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); font-size: 1.05rem; }
.sidebar-logo:hover { text-decoration: none; }
.logo-mark { font-size: 22px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 12px; }
.nav-group { margin-bottom: 6px; }
.nav-group-title {
    width: 100%; text-align: left; background: none; border: none;
    color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: 10px 10px 6px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; font-family: inherit;
}
.nav-group-title .chev { transition: transform .2s; font-size: .7rem; }
.nav-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-items { display: none; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: var(--radius-sm);
    color: var(--text-soft); font-weight: 500; font-size: .92rem;
    margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-icon { width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.nav-item.logout:hover { color: var(--danger); }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px; padding: 0 22px;
    position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-weight: 700; font-size: 1.05rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 10px; border: none; background: transparent;
    cursor: pointer; font-size: 1.15rem; color: var(--text-soft); position: relative;
    display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.menu-toggle { display: none; }
.badge-dot {
    position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--danger); color: #fff; border-radius: 9px; font-size: .65rem;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.topbar-user { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; text-transform: uppercase;
}
.user-name-sm { font-size: .9rem; font-weight: 600; }

/* ---------- Content ---------- */
.content { padding: 24px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.page-head .sub { color: var(--text-soft); margin: 0; }

/* ---------- Cards & grid ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- Stat cards ---------- */
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px;
}
.stat .stat-icon { font-size: 1.4rem; }
.stat .stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat .stat-label { color: var(--text-soft); font-size: .85rem; }
.stat .stat-change { font-size: .8rem; font-weight: 600; }
.stat-change.up { color: var(--accent); }
.stat-change.down { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
    font-weight: 600; font-size: .9rem; cursor: pointer; font-family: inherit;
    transition: background .15s, transform .05s, box-shadow .15s; text-decoration: none;
    line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--accent); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--text); }
input, select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text); font-size: .92rem; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: #e5f8f0; color: #0a7a5a; border-color: #b6ecd8; }
.alert-error, .alert-danger { background: #fdecea; color: #b02a1a; border-color: #f7c8c1; }
.alert-info { background: #e7f2fd; color: #0a5aa0; border-color: #c3e0f8; }
.alert-warn, .alert-warning { background: #fef6e7; color: #9a6700; border-color: #f7e2b6; }
html[data-theme="dark"] .alert-success { background: #123026; color: #4fd6a8; border-color: #1d4a3a; }
html[data-theme="dark"] .alert-error { background: #331a17; color: #f0897a; border-color: #4d2420; }
html[data-theme="dark"] .alert-info { background: #14283d; color: #6bb6f5; border-color: #1f3c5a; }
html[data-theme="dark"] .alert-warn { background: #33290f; color: #f0c368; border-color: #4d3d17; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-success { background: #e5f8f0; color: #0a7a5a; border-color: transparent; }
.badge-warn { background: #fef6e7; color: #9a6700; border-color: transparent; }
.badge-danger { background: #fdecea; color: #b02a1a; border-color: transparent; }
.badge-info { background: #e7f2fd; color: #0a5aa0; border-color: transparent; }
html[data-theme="dark"] .badge-success { background: #123026; color: #4fd6a8; }
html[data-theme="dark"] .badge-warn { background: #33290f; color: #f0c368; }
html[data-theme="dark"] .badge-danger { background: #331a17; color: #f0897a; }
html[data-theme="dark"] .badge-info { background: #14283d; color: #6bb6f5; }

/* ---------- Progress ---------- */
.progress { height: 9px; background: var(--surface-2); border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 20px; transition: width .4s ease; }
.progress-bar.accent { background: var(--accent); }
.progress-ring { --size: 120px; --val: 0; width: var(--size); height: var(--size); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; position: relative;
    background: conic-gradient(var(--primary) calc(var(--val) * 1%), var(--surface-2) 0);
}
.progress-ring::before { content: ""; position: absolute; inset: 12px; background: var(--surface); border-radius: 50%; }
.progress-ring .ring-label { position: relative; text-align: center; }
.progress-ring .ring-val { font-size: 1.6rem; font-weight: 800; }
.progress-ring .ring-sub { font-size: .72rem; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { background: var(--surface-2); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-soft); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }

/* ---------- Lists / tasks ---------- */
.task-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.task-item:last-child { border-bottom: none; }
.task-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); flex-shrink: 0; cursor: pointer; background: var(--surface); margin-top: 2px; position: relative; }
.task-check.done { background: var(--accent); border-color: var(--accent); }
.task-check.done::after { content: "✓"; color: #fff; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task-item.completed .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; font-size: .78rem; color: var(--muted); }

/* ---------- Roadmap ---------- */
.roadmap { display: flex; flex-direction: column; gap: 14px; }
.module-card { display: flex; gap: 16px; align-items: center; }
.module-icon { font-size: 1.8rem; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 14px; flex-shrink: 0; }
.module-card.locked { opacity: .6; }
.module-status { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 12px; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { min-width: 260px; width: 260px; flex-shrink: 0; background: var(--surface-2); border-radius: var(--radius); padding: 12px; }
.kanban-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-soft); display: flex; justify-content: space-between; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; box-shadow: var(--shadow); cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.drag-over { border-color: var(--primary); }
.kanban-col.drop-active { outline: 2px dashed var(--primary); outline-offset: -4px; }

/* ---------- Calendar ---------- */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: .75rem; font-weight: 700; color: var(--text-soft); padding: 6px 0; text-transform: uppercase; }
.cal-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-height: 92px; padding: 6px; font-size: .8rem; }
.cal-cell.other { opacity: .4; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-date { font-weight: 700; font-size: .78rem; margin-bottom: 4px; }
.cal-event { background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 2px 6px; margin-bottom: 3px; font-size: .72rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,12,20,.5); z-index: 60; display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; }
.modal.lg { max-width: 780px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Misc ---------- */
.example-box { border-left: 4px solid var(--border); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 12px 0; background: var(--surface-2); }
.example-box.good { border-color: var(--accent); background: #eafaf4; }
.example-box.bad { border-color: var(--danger); background: #fdeeec; }
html[data-theme="dark"] .example-box.good { background: #10261f; }
html[data-theme="dark"] .example-box.bad { background: #2a1815; }
.example-box .label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.example-box.good .label { color: var(--accent); }
.example-box.bad .label { color: var(--danger); }
.redflag-box { border-left: 4px solid var(--warn); background: #fef6e7; padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 12px 0; }
html[data-theme="dark"] .redflag-box { background: #33290f; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); font-size: .85rem; cursor: pointer; user-select: none; }
.chip.selected, .chip:hover { border-color: var(--primary); color: var(--primary); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-soft); }
.empty-state .emoji { font-size: 2.4rem; display: block; margin-bottom: 10px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: none; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 20px; }
.text-center { text-align: center; }
.wrap-anywhere { overflow-wrap: anywhere; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-page { text-align: center; color: #fff; }
.error-code { font-size: 5rem; font-weight: 800; }
.error-page h1 { color: #fff; }
.error-page .btn { margin-top: 16px; }
.lesson-content h2 { margin-top: 1.4em; }
.lesson-content ul, .lesson-content ol { padding-left: 1.3em; }
.lesson-content blockquote { border-left: 4px solid var(--primary); padding: 6px 16px; margin: 12px 0; background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text-soft); }
.lesson-content code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: .88em; }
.lesson-content pre { background: var(--surface-2); padding: 14px; border-radius: 10px; overflow-x: auto; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(10,12,20,.5); z-index: 39; }
.sidebar-backdrop.show { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    :root { --sidebar-w: 260px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .user-name-sm { display: none; }
    .content { padding: 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; }
}
@media (max-width: 480px) {
    body { font-size: 14px; }
    .content { padding: 13px; }
    .card { padding: 15px; }
}
