/* İletişim ve Liderlik — öğrenme platformu */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e8ebf0;
  --text: #1b2130;
  --text-muted: #5a6476;
  --border: #dfe3ea;
  --accent: #1f5fbf;
  --accent-strong: #174a96;
  --accent-soft: #e8f0fc;
  --on-accent: #ffffff;
  --success: #1e8a4c;
  --success-soft: #e5f4eb;
  --warn: #b26a00;
  --warn-soft: #fff3df;
  --danger-soft: #fdeceb;
  --tag-pdf: #1f5fbf;
  --tag-pdf-bg: #e8f0fc;
  --tag-ek: #1e7d48;
  --tag-ek-bg: #e3f3e9;
  --tag-fix: #a25b00;
  --tag-fix-bg: #fff0d9;
  --cat-1: #1f5fbf;
  --cat-2: #c2571a;
  --cat-3: #1e7d48;
  --cat-4: #6b46c1;
  --cat-5: #b4234a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, .14);
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --surface: #161a22;
    --surface-2: #1c212b;
    --surface-3: #242a36;
    --text: #e6e9ef;
    --text-muted: #9ba4b4;
    --border: #2a303c;
    --accent: #6ea1ff;
    --accent-strong: #9bbdff;
    --accent-soft: #1a2740;
    --on-accent: #0b1220;
    --success: #4cc283;
    --success-soft: #15291f;
    --warn: #f0a742;
    --warn-soft: #2d2412;
    --danger-soft: #2e1719;
    --tag-pdf: #8db5ff;
    --tag-pdf-bg: #1a2740;
    --tag-ek: #6fd39c;
    --tag-ek-bg: #15291f;
    --tag-fix: #f3b866;
    --tag-fix-bg: #2d2412;
    --cat-1: #6ea1ff;
    --cat-2: #f08a50;
    --cat-3: #4cc283;
    --cat-4: #a98bf0;
    --cat-5: #f0718f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #161a22;
  --surface-2: #1c212b;
  --surface-3: #242a36;
  --text: #e6e9ef;
  --text-muted: #9ba4b4;
  --border: #2a303c;
  --accent: #6ea1ff;
  --accent-strong: #9bbdff;
  --accent-soft: #1a2740;
  --on-accent: #0b1220;
  --success: #4cc283;
  --success-soft: #15291f;
  --warn: #f0a742;
  --warn-soft: #2d2412;
  --danger-soft: #2e1719;
  --tag-pdf: #8db5ff;
  --tag-pdf-bg: #1a2740;
  --tag-ek: #6fd39c;
  --tag-ek-bg: #15291f;
  --tag-fix: #f3b866;
  --tag-fix-bg: #2d2412;
  --cat-1: #6ea1ff;
  --cat-2: #f08a50;
  --cat-3: #4cc283;
  --cat-4: #a98bf0;
  --cat-5: #f0718f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Üst çubuk ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14px; letter-spacing: .5px; }
.edition { font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.search { flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; color: var(--text-muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; border: 0; background: transparent; color: var(--text); padding: 9px 0; font: inherit; min-width: 0; }
.search input:focus { outline: none; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 15px; padding: 8px 10px; border-radius: 8px; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Genel düzen ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 24px 16px 64px; }
.muted { color: var(--text-muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }

.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.progress.done > span { background: var(--success); }

/* ---------- Ana sayfa ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
  border: 1px solid var(--border); border-radius: 18px; padding: 36px; box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; margin: 6px 0 12px; letter-spacing: -.5px; }
.hero p.lead { font-size: 18px; color: var(--text-muted); margin: 0 0 20px; max-width: 58ch; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.2px; font-size: 12.5px; font-weight: 750; color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 28px; line-height: 1.1; }
.stat span { color: var(--text-muted); font-size: 14px; }
.overall { margin-top: 18px; }
.overall .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); margin-bottom: 6px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 14px; }
.section-head h2 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.cat-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--card-color, var(--accent)); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--card-color, var(--accent)) 40%, var(--border)); color: var(--text); }
.card .kicker { font-size: 12.5px; font-weight: 750; color: var(--card-color, var(--accent)); text-transform: uppercase; letter-spacing: .8px; }
.card h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.card p { margin: 0; color: var(--text-muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-muted); }
.status { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.status.started { background: var(--accent-soft); color: var(--accent); }
.status.done { background: var(--success-soft); color: var(--success); }
.card.capstone { --card-color: var(--warn); }

.footer-note { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- Ders görünümü ---------- */
.course-layout { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; }
.sidebar {
  position: sticky; top: 59px; align-self: start; height: calc(100vh - 59px); overflow-y: auto;
  border-right: 1px solid var(--border); padding: 20px 14px 40px 16px; background: var(--bg);
}
.side-head { padding: 4px 6px 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.side-head .kicker { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .8px; }
.side-head h2 { font-size: 17px; margin: 4px 0 10px; line-height: 1.3; }
.side-head .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.side-group { margin: 14px 0 4px; padding: 0 8px; font-size: 12px; font-weight: 750; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); }
.unit-list { list-style: none; margin: 0; padding: 0; }
.unit-list a {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 8px;
  padding: 8px 8px; border-radius: 9px; text-decoration: none; color: var(--text); font-size: 14.5px; line-height: 1.35;
}
.unit-list a:hover { background: var(--surface-2); color: var(--text); }
.unit-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.unit-list .mins { font-size: 12px; color: var(--text-muted); padding-top: 2px; white-space: nowrap; }
.tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); display: inline-grid; place-items: center; margin-top: 1px; }
.tick.done { background: var(--success); border-color: var(--success); }
.tick.done::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.unit-list a.instructor .tick { border-style: dashed; }

.content-col { min-width: 0; padding: 24px 32px 80px; }
.crumbs { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.unit-head { max-width: 800px; margin-bottom: 18px; }
.unit-head .label { font-size: 13px; font-weight: 750; color: var(--accent); text-transform: uppercase; letter-spacing: .8px; }
.unit-head h1 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.2; margin: 6px 0 8px; letter-spacing: -.3px; }
.unit-head .meta { color: var(--text-muted); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.instructor-flag { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 4px 10px; border-radius: 8px; }
.kazanim { max-width: 800px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.kazanim b { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); margin-bottom: 4px; }

.toc { max-width: 800px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 24px; }
.toc b { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); }
.toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc li { margin: 3px 0; break-inside: avoid; font-size: 14.5px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- Okunan içerik ---------- */
.prose { max-width: 800px; font-size: 17px; line-height: 1.72; }
.prose h2 { font-size: 24px; margin: 36px 0 12px; line-height: 1.3; }
.prose h3 { font-size: 20px; margin: 32px 0 10px; line-height: 1.35; scroll-margin-top: 80px; }
.prose h4 { font-size: 17.5px; margin: 24px 0 8px; scroll-margin-top: 80px; }
.prose h5, .prose h6 { font-size: 16px; margin: 20px 0 6px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 6px; }
.prose li.check { list-style: none; margin-left: -22px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.prose strong { font-weight: 700; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
.prose a { word-break: break-word; }
.table-wrap { overflow-x: auto; margin: 6px 0 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface-2); font-weight: 700; font-size: 14px; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

.prose blockquote { margin: 0 0 18px; padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; border-left: 4px solid var(--border); background: var(--surface); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote.quote { border-left-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--surface-2); }
.prose blockquote.callout-new { border-left-color: var(--warn); background: var(--warn-soft); }
.prose blockquote.callout-note { border-left-color: var(--accent); background: var(--accent-soft); }
.prose blockquote.callout-info { border-left-color: var(--text-muted); background: var(--surface-2); font-size: 15.5px; }

.template { position: relative; margin: 6px 0 20px; }
.template pre { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 42px 16px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; }
.template code { background: none; border: 0; padding: 0; font-size: inherit; }
.copy-btn { position: absolute; top: 8px; right: 8px; font-size: 12.5px; font-weight: 650; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; }
.copy-btn:hover { color: var(--text); }
.copy-btn.ok { color: var(--success); border-color: var(--success); }

.tags { display: inline-flex; gap: 4px; vertical-align: 1px; }
.tag { font-size: 11px; font-weight: 800; letter-spacing: .4px; padding: 1px 6px; border-radius: 5px; line-height: 1.6; }
.tag-pdf { color: var(--tag-pdf); background: var(--tag-pdf-bg); }
.tag-ek { color: var(--tag-ek); background: var(--tag-ek-bg); }
.tag-fix { color: var(--tag-fix); background: var(--tag-fix-bg); }
.src { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 0 5px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); line-height: 1.6; cursor: pointer; }
.src:hover { border-color: var(--accent); color: var(--accent); }
.cb { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--text-muted); border-radius: 3px; vertical-align: -2px; }
mark { background: #ffe58a; color: #1b2130; border-radius: 3px; padding: 0 1px; }
.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 40% { background: var(--warn-soft); } 100% { background: transparent; } }

/* ---------- Notlar ve gezinme ---------- */
.notes { max-width: 800px; margin-top: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.notes summary { cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.notes summary span { font-weight: 500; font-size: 13px; color: var(--text-muted); }
.notes textarea { display: block; width: calc(100% - 32px); margin: 0 16px 16px; min-height: 140px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font: inherit; font-size: 15px; background: var(--surface-2); color: var(--text); }
.unit-nav { max-width: 800px; margin-top: 24px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.unit-nav .prev, .unit-nav .next { text-decoration: none; color: var(--text-muted); font-size: 14px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; }
.unit-nav .prev:hover, .unit-nav .next:hover { border-color: var(--border); background: var(--surface); }
.unit-nav .next { text-align: right; }
.unit-nav b { color: var(--text); font-size: 15px; }
.unit-nav .center { display: flex; justify-content: center; }

.mobile-bar { display: none; }
.drawer-backdrop { display: none; }

/* ---------- Arama ve ilerleme ---------- */
.results { max-width: 860px; }
.result { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; text-decoration: none; color: var(--text); }
.result:hover { border-color: var(--accent); color: var(--text); }
.result small { color: var(--text-muted); font-size: 13px; }
.result b { display: block; margin: 2px 0 4px; }
.result p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.big-search { display: flex; gap: 8px; margin: 10px 0 20px; max-width: 860px; }
.big-search input { flex: 1; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.prog-table { width: 100%; max-width: 900px; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.prog-table td, .prog-table th { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 15px; }
.prog-table th { background: var(--surface-2); font-size: 13.5px; }
.prog-table .progress { min-width: 120px; }

/* ---------- Duyarlı tasarım ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .course-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(330px, 88vw); height: 100vh; z-index: 60;
    background: var(--surface); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .drawer-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 55; }
  .content-col { padding: 16px 16px 72px; }
  .mobile-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
  .toc ol { columns: 1; }
}
@media (max-width: 640px) {
  .topbar-inner { gap: 8px; padding: 8px 12px; }
  .brand-text { display: none; }
  .topnav a { display: none; }
  .edition { font-size: 11px; padding: 2px 6px; }
  .page { padding: 16px 16px 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 22px; }
  .prose { font-size: 16.5px; }
  .unit-nav { grid-template-columns: 1fr 1fr; }
  .unit-nav .center { grid-column: 1 / -1; grid-row: 1; }
  .unit-nav .center .btn { width: 100%; justify-content: center; }
}

/* ---------- Yazdırma ---------- */
@media print {
  .topbar, .sidebar, .mobile-bar, .notes, .unit-nav, .copy-btn, .crumbs, .toc { display: none !important; }
  .course-layout { display: block; }
  .content-col { padding: 0; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; font-size: 12pt; }
}
