/* nl.xanegeh.com — tek tema, okunabilirlik öncelikli */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c2733;
  --text-soft: #6b7684;
  --accent: #1560bd;
  --accent-dark: #104e9b;
  --border: #dde2e8;
  --error: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 30, 46, .08), 0 4px 14px rgba(16, 30, 46, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---- TR gizle/göster ---- */
.tr-text {
  display: inline-block;
  font-size: .82em;
  color: var(--text-soft);
  font-weight: 400;
}
body.tr-hidden .tr-text { display: none; }

/* ---- Üst bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.tr-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: .35rem .8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tr-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.logout {
  font-size: .85rem;
  color: var(--text-soft);
  text-decoration: none;
}
.logout:hover { color: var(--text); }

/* ---- Yerleşim ---- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

h1 { font-size: 1.6rem; margin: .75rem 0 .25rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
.subtitle { margin: 0 0 1.5rem; color: var(--text-soft); }

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: .9rem;
}
.back-link:hover { text-decoration: underline; }

/* ---- Ana sayfa kart grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .9rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1.15rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .12s, border-color .12s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-nl {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}
.card-tr { font-size: .85rem; }

/* ---- Bölüm sayfası ---- */
.empty-state {
  padding: 2.25rem 1rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 1rem;
}
.empty-nl { font-size: 1.1rem; font-weight: 600; margin: 0 0 .3rem; }
.empty-state .tr-text { display: block; margin: 0; }
body.tr-hidden .empty-state .tr-text { display: none; }

.block { margin-top: 1.25rem; }

.lesson-list {
  padding-left: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1rem 2.2rem;
  margin: 0;
}
.lesson-list li { margin: .3rem 0; }

.word-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.word-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  box-shadow: var(--shadow);
}

.word-head {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}
.word-nl { font-size: 1.15rem; font-weight: 700; }
.word-tr { font-size: .92rem; }

.example {
  margin: .45rem 0 0;
  padding-left: .85rem;
  border-left: 3px solid var(--border);
  font-size: .95rem;
}
.example .tr-text { display: block; }
body.tr-hidden .example .tr-text { display: none; }

.notes {
  margin: .5rem 0 0;
  font-size: .85rem;
  color: var(--text-soft);
  font-style: italic;
}

/* ---- Login ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
}
.login-box h1 {
  margin: 0 0 .25rem;
  color: var(--accent);
  font-size: 1.5rem;
  text-align: center;
}
.login-box .subtitle { text-align: center; }

.login-box label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  margin: .9rem 0 .3rem;
}

.login-box input {
  width: 100%;
  padding: .6rem .75rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.login-box input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.login-box button {
  width: 100%;
  margin-top: 1.25rem;
  padding: .7rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.login-box button:hover { background: var(--accent-dark); }

.error {
  margin: .75rem 0 0;
  padding: .6rem .75rem;
  background: #fdecea;
  color: var(--error);
  border-radius: 8px;
  font-size: .9rem;
}

/* ---- Mobil ---- */
@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 1.35rem; }
  .card { padding: .95rem .85rem; }
  .card-nl { font-size: 1rem; }
}

/* ---- Lezen: metin listesi ---- */
.text-list {
  list-style: none;
  counter-reset: textnum;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.text-list li { counter-increment: textnum; }

.text-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color .12s;
}
.text-item:hover, .text-item:focus-visible { border-color: var(--accent); }

.text-item::before {
  content: counter(textnum);
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
}

.text-title { font-weight: 700; }
.text-meta {
  margin-left: auto;
  font-size: .82rem;
  color: var(--text-soft);
  text-align: right;
}

/* ---- Okuma metni kartı ---- */
.text-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin-top: .75rem;
}
.text-intro {
  margin: 0 0 .9rem;
  font-style: italic;
  color: var(--text-soft);
}
.text-body { font-size: 1.05rem; line-height: 1.7; }
.text-body p { margin: .6rem 0; }

/* ---- Quiz ---- */
.quiz-block { margin-top: 1.75rem; }

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.question-text {
  margin: 0 0 .75rem;
  font-weight: 600;
  font-size: 1.02rem;
}
.q-num { color: var(--accent); font-weight: 700; }

.options {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  min-height: 48px;
  padding: .6rem .8rem;
  font: inherit;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.option-btn:hover:not(:disabled) { border-color: var(--accent); }
.option-btn:disabled { cursor: default; opacity: .85; }

.opt-letter {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
}

.option-btn.is-correct {
  background: #e6f4ea;
  border-color: #1e8e3e;
  opacity: 1;
}
.option-btn.is-correct .opt-letter {
  background: #1e8e3e;
  border-color: #1e8e3e;
  color: #fff;
}

.option-btn.is-wrong {
  background: #fdecea;
  border-color: var(--error);
  opacity: 1;
}
.option-btn.is-wrong .opt-letter {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.explanation {
  margin-top: .7rem;
  padding: .6rem .8rem;
  background: #fff8e6;
  border-left: 3px solid #f2b705;
  border-radius: 6px;
  font-size: .9rem;
}
body.tr-hidden .explanation { display: none; }

.score-bar {
  position: sticky;
  bottom: 0;
  margin-top: 1.25rem;
  padding: .8rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
}
.score-bar strong { color: var(--accent); }

/* ---- Woordenlijst: numara + sayfalama ---- */
.word-num {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  border-radius: 50%;
}

.page-info {
  margin: 0 0 .9rem;
  font-size: .88rem;
  color: var(--text-soft);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.25rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .4rem .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: border-color .12s;
}
.page-btn:hover, .page-btn:focus-visible { border-color: var(--accent); }

.page-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
