/* ═══════════════════════════════════════════
   Yaşayan Sözlük — Styles
   ═══════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --primary:     #1d3f5a;   /* logo book: dark teal-navy          */
  --accent:      #2d6a50;   /* logo tree trunk: deep forest green */
  --accent2:     #3d8f6a;   /* logo mid-green                     */
  --accent3:     #74c69d;   /* logo leaf: sage green              */
  --bg:          #ecf4ef;   /* logo background: light sage mint   */
  --card:        #ffffff;
  --border:      #cfe4d9;   /* soft sage-green border             */
  --text:        #1a3050;   /* logo text: dark navy               */
  --muted:       #5a7a6e;   /* muted sage                         */
  --shadow:      0 2px 12px rgba(29,63,90,.08);
  --shadow-lg:   0 8px 32px rgba(29,63,90,.16);
  --radius:      14px;
  --radius-sm:   8px;

  /* Category colours — mirrors the Flutter app */
  --c-plaza:   #1565C0;
  --c-sosyal:  #6A1B9A;
  --c-iliski:  #C62828;
  --c-oyun:    #2E7D32;
  --c-z:       #E65100;

  /* Category gradient pairs */
  --gc-plaza:  linear-gradient(135deg, #1565C0, #42A5F5);
  --gc-sosyal: linear-gradient(135deg, #6A1B9A, #AB47BC);
  --gc-iliski: linear-gradient(135deg, #C62828, #EF5350);
  --gc-oyun:   linear-gradient(135deg, #2E7D32, #66BB6A);
  --gc-z:      linear-gradient(135deg, #E65100, #FF7043);
}

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

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Overlay ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0; visibility: hidden;
  transition: .25s; z-index: 50;
}
.overlay.active { opacity: 1; visibility: visible; }

/* ── Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: -300px;
  width: 280px; height: 100vh;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  transition: left .28s ease;
  z-index: 60; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar.active { left: 0; }

.sidebar-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 18px;
  display: flex; align-items: center; gap: 14px;
}
.sidebar-logo-img {
  width: 52px; height: 52px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.25);
}
.sidebar-title-text { font-size: 14px; font-weight: 800; line-height: 1.2; }
.sidebar-sub { font-size: 10px; opacity: .7; margin-top: 2px; font-style: italic; }

.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-section {
  padding: 10px 18px 4px;
  font-size: 10px; font-weight: 800;
  letter-spacing: 1.5px; color: var(--muted);
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--text); border: none; background: none;
  width: 100%; text-align: left;
  transition: background .2s, color .2s, padding-left .2s;
  border-radius: 0; text-decoration: none;
}
.nav-item:hover { background: #daeee6; padding-left: 22px; }
.nav-item.active { background: #bbd9ce; color: var(--accent); border-left: 3px solid var(--accent); }
.nav-item .icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--border); margin: 6px 0; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Top Bar ── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 0 14px; height: 58px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.topbar-btn {
  width: 40px; height: 40px;
  border: none; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.12); color: #fff;
  cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.topbar-btn:hover { background: rgba(255,255,255,.22); }
.topbar-logo-wrap {
  flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px;
}
.topbar-logo-img {
  width: 38px; height: 38px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.25);
}
.topbar-title-text { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: .3px; }

/* ── Search Bar ── */
.search-wrap { background: var(--primary); padding: 0 14px 14px; display: none; }
.search-wrap.active { display: block; }
.search-inner {
  display: flex; align-items: center;
  background: #fff; border-radius: 10px; padding: 10px 14px; gap: 8px;
}
.search-inner input {
  flex: 1; border: none; outline: none;
  font-size: 15px; font-family: inherit; color: var(--text); background: transparent;
}
.search-clear { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 16px; }

/* ── Main & Pages ── */
.main { max-width: 800px; margin: 0 auto; padding: 16px 14px 90px; }
.page { display: none; }
.page.active { display: block; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius); padding: 24px 20px;
  color: #fff; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute;
  top: -30px; right: -30px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.05); border-radius: 50%;
}
.hero-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.hero-logo {
  width: 64px; height: 64px; border-radius: 14px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; flex-shrink: 0;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 3px 10px; border-radius: 20px;
  margin-bottom: 6px; letter-spacing: .5px; text-transform: uppercase;
}
.hero h1 { font-size: 21px; font-weight: 900; line-height: 1.2; }
.hero p { font-size: 13px; opacity: .82; line-height: 1.6; margin-bottom: 16px; }
.hero-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.hero-stat .num { font-size: 24px; font-weight: 900; }
.hero-stat .lbl { font-size: 11px; opacity: .7; margin-top: 1px; }

/* ── App Promo Banner ── */
.app-promo {
  background: linear-gradient(135deg, #1565C0, #42A5F5);
  border-radius: var(--radius); padding: 16px 18px;
  color: #fff; margin-bottom: 18px;
  display: flex; align-items: center; gap: 16px;
}
.app-promo-icon { font-size: 36px; flex-shrink: 0; }
.app-promo h3 { font-size: 14px; font-weight: 800; margin-bottom: 3px; }
.app-promo p { font-size: 12px; opacity: .85; line-height: 1.5; }

/* ── Word of the Day ── */
.word-of-day {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px;
  margin-bottom: 18px; box-shadow: var(--shadow);
}
.wod-label {
  font-size: 11px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.wod-label::before { content: '✦'; font-size: 10px; }
.wod-word { font-size: 22px; font-weight: 900; color: var(--primary); margin-bottom: 4px; }
.wod-cat {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px; margin-bottom: 10px; color: #fff;
}
.wod-meaning { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.wod-example {
  font-size: 13px; color: var(--muted); font-style: italic;
  border-left: 3px solid var(--border); padding-left: 10px; line-height: 1.5;
}
.wod-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ── Buttons ── */
.btn-sm {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  border: none; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #152e40; }
.btn-outline {
  background: none; color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }

/* ── Section Headers ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 16px; font-weight: 800; color: var(--primary); }
.section-link {
  font-size: 13px; font-weight: 700; color: var(--accent);
  cursor: pointer; border: none; background: none; font-family: inherit;
}

/* ── Category Grid (Home) ── */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.cat-card {
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cat-card-header {
  padding: 16px; color: #fff;
  display: flex; align-items: center; gap: 12px;
}
.cat-card-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.cat-card-name { font-size: 13px; font-weight: 800; margin-bottom: 2px; }
.cat-card-count { font-size: 11px; opacity: .8; font-weight: 600; }

/* ── Expandable Category Sections (Sözlük) ── */
.cat-section { margin-bottom: 12px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cat-section-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; cursor: pointer; color: #fff;
  user-select: none;
}
.cat-section-icon-wrap {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.cat-section-info { flex: 1; min-width: 0; }
.cat-section-name { font-size: 15px; font-weight: 800; }
.cat-section-sub { font-size: 11px; opacity: .78; font-weight: 600; margin-top: 1px; }
.cat-section-arrow {
  font-size: 22px; transition: transform .3s;
  flex-shrink: 0; opacity: .9;
}
.cat-section.open .cat-section-arrow { transform: rotate(180deg); }
.cat-section-body {
  background: var(--card);
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease;
}
.cat-section.open .cat-section-body { max-height: 9999px; }

/* ── Word Cards ── */
.word-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 10px 12px; box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.word-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.word-card-header { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 10px; }
.word-card-main { flex: 1; min-width: 0; }
.word-title { font-size: 17px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.word-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px; color: #fff; margin-bottom: 6px;
}
.word-meaning { font-size: 13px; line-height: 1.6; }
.word-example {
  font-size: 12px; color: var(--muted); font-style: italic;
  border-left: 3px solid var(--border); padding: 6px 10px;
  margin: 0 14px 14px; line-height: 1.5;
  border-radius: 0 4px 4px 0; background: var(--bg);
}
.word-card-actions {
  border-top: 1px solid var(--border); padding: 10px 14px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.vote-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--border); background: none;
  cursor: pointer; font-family: inherit;
  transition: all .15s; color: var(--muted);
}
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn.voted { background: var(--accent); border-color: var(--accent); color: #fff; }
.suggest-btn {
  margin-left: auto; padding: 6px 14px; border-radius: 7px;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--accent2); color: var(--accent2);
  background: none; cursor: pointer; font-family: inherit; transition: all .15s;
}
.suggest-btn:hover { background: var(--accent2); color: #fff; }

/* ── Suggestions Panel ── */
.suggestions-panel {
  background: #e4f2ec; border-top: 1px solid #bbd9ce;
  padding: 10px 14px; display: none;
}
.suggestions-panel.open { display: block; }
.suggestions-panel-title {
  font-size: 11px; font-weight: 800; color: var(--accent2);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px;
}
.suggestion-item {
  padding: 6px 0; border-bottom: 1px solid rgba(42,157,143,.12);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-word { font-size: 13px; font-weight: 700; color: var(--primary); }
.suggestion-note { font-size: 11px; color: var(--muted); margin-top: 1px; }
.suggestion-date { font-size: 10px; color: var(--muted); }

/* ── Filter Chips ── */
.filter-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  margin-bottom: 14px; scrollbar-width: none; -ms-overflow-style: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 7px 16px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--border); background: var(--card);
  cursor: pointer; font-family: inherit; transition: all .15s; color: var(--text);
}
.filter-chip.active { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ── Statistics ── */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  box-shadow: var(--shadow); text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-num { font-size: 28px; font-weight: 900; color: var(--primary); }
.stat-card .stat-lbl { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.chart-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.chart-title { font-size: 14px; font-weight: 800; margin-bottom: 16px; }
.bar-item { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bar-label { font-size: 12px; font-weight: 700; width: 110px; flex-shrink: 0; color: var(--text); }
.bar-track { flex: 1; height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.bar-count { font-size: 11px; font-weight: 700; color: var(--muted); width: 36px; text-align: right; }

/* ── Survey ── */
.survey-tabs {
  display: flex; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 18px;
}
.survey-tab {
  flex: 1; padding: 12px; border: none;
  background: var(--card); font-family: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s; color: var(--muted);
}
.survey-tab.active { background: var(--primary); color: #fff; }
.survey-section { display: none; }
.survey-section.active { display: block; }
.survey-info-box {
  background: linear-gradient(135deg, var(--primary), #2d6a4f);
  color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}
.survey-info-box h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.survey-info-box p { font-size: 13px; opacity: .82; line-height: 1.5; }
.survey-info-stats { display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }
.survey-info-stat { font-size: 22px; font-weight: 900; }
.survey-info-stat span { display: block; font-size: 10px; opacity: .72; margin-top: 2px; font-weight: 600; }
.word-survey-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.word-survey-word { font-size: 16px; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.mini-bars { display: flex; flex-direction: column; gap: 7px; }
.mini-bar-row { display: flex; align-items: center; gap: 8px; }
.mini-bar-lbl { font-size: 11px; font-weight: 700; color: var(--muted); width: 140px; flex-shrink: 0; }
.mini-bar-track { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 3px; transition: width .7s ease; }
.mini-bar-pct { font-size: 11px; font-weight: 700; color: var(--muted); width: 48px; text-align: right; }
.age-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.age-pill {
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--border); background: var(--card);
  cursor: pointer; font-family: inherit; transition: all .15s; color: var(--text);
}
.age-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.new-survey-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.new-survey-q { font-size: 15px; font-weight: 800; color: var(--primary); margin-bottom: 14px; line-height: 1.5; }
.survey-options { display: flex; flex-direction: column; gap: 8px; }
.survey-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; cursor: pointer;
  transition: all .15s; background: none;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
}
.survey-option:hover { border-color: var(--accent); background: #daeee6; }
.survey-option.selected { border-color: var(--accent); background: #bbd9ce; color: var(--primary); }
.survey-option .opt-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.survey-option.selected .opt-dot { border-color: var(--accent); background: var(--accent); }
.survey-option.selected .opt-dot::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 900; }
.survey-submit {
  width: 100%; padding: 13px; background: var(--accent);
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 800; cursor: pointer;
  margin-top: 10px; font-family: inherit; transition: background .15s;
}
.survey-submit:hover { background: #152e40; }
.survey-submit:disabled { background: var(--muted); cursor: not-allowed; }

/* ── Translate / Search Box ── */
.translate-box {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.translate-label {
  font-size: 12px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.translate-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none;
  transition: border-color .15s; color: var(--text); background: var(--bg);
}
.translate-input:focus { border-color: var(--accent); background: #fff; }
.result-card {
  background: var(--card); border-radius: var(--radius);
  border: 2px solid var(--accent2); padding: 18px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.result-label { font-size: 11px; font-weight: 800; color: var(--accent2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.result-word { font-size: 20px; font-weight: 900; color: var(--primary); margin-bottom: 6px; }
.result-meaning { font-size: 14px; line-height: 1.6; }

/* ── Suggest History ── */
.suggest-history-section { margin-top: 24px; }
.suggest-history-title {
  font-size: 13px; font-weight: 800; color: var(--primary);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.suggest-history-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.suggest-history-badge {
  background: var(--accent2); color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 20px; flex-shrink: 0;
}
.suggest-history-word { font-size: 14px; font-weight: 800; color: var(--primary); margin-bottom: 2px; }
.suggest-history-for { font-size: 12px; color: var(--muted); }
.suggest-history-note { font-size: 12px; color: var(--text); font-style: italic; margin-top: 2px; }
.suggest-history-time { font-size: 10px; color: var(--muted); margin-top: 4px; }
.no-history { font-size: 13px; color: var(--muted); text-align: center; padding: 20px; }

/* ── Türk Dünyası ── */
.turkdunya-quote-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius); padding: 24px 22px 20px;
  margin-bottom: 14px; text-align: center; position: relative; overflow: hidden;
}
.turkdunya-quote-card::before {
  content: ''; position: absolute; bottom: -30px; left: -30px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,.05); border-radius: 50%;
}
.turkdunya-quote-mark {
  font-size: 72px; line-height: .6; color: rgba(255,255,255,.25);
  font-family: Georgia, serif; margin-bottom: 8px;
}
.turkdunya-quote {
  font-size: 20px; font-weight: 900; color: #fff;
  line-height: 1.4; margin-bottom: 10px; font-style: italic;
}
.turkdunya-cite {
  font-size: 13px; color: rgba(255,255,255,.72);
  font-weight: 700; font-style: normal; letter-spacing: .3px;
}
.turkdunya-wip {
  text-align: center; margin: 8px 0 18px;
}
.turkdunya-wip-img {
  width: 100%; max-width: 480px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: block; margin: 0 auto 14px;
}
.turkdunya-wip-text {
  font-size: 14px; font-weight: 700; color: var(--muted);
  font-style: italic;
}

/* ── Turkic World / Book cards ── */
.turkic-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.turkic-lang { font-size: 11px; font-weight: 800; color: var(--accent2); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; }
.turkic-word { font-size: 18px; font-weight: 900; color: var(--primary); margin-bottom: 4px; }
.turkic-tr { font-size: 13px; color: var(--muted); }
.book-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px;
  margin-bottom: 12px; box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.book-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.book-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.book-content { flex: 1; min-width: 0; }
.book-title { font-size: 15px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.book-info { font-size: 13px; color: var(--muted); line-height: 1.5; }
.book-download {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; padding: 7px 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border-radius: 8px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 2px 6px rgba(26,58,42,.15);
}
.book-download:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,58,42,.25); }

/* ── Info / Contact / About ── */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff; border-radius: var(--radius); padding: 24px 20px; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.page-header::after {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,.06); border-radius: 50%;
}
.page-header h2 { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.page-header p { font-size: 13px; opacity: .78; line-height: 1.5; }
.info-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.info-icon { font-size: 32px; margin-bottom: 10px; }
.info-title { font-size: 16px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.info-text { font-size: 14px; color: var(--muted); line-height: 1.75; }
.info-text strong { color: var(--text); }
.contact-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.contact-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.contact-title { font-size: 14px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.contact-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── Modal ── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.52);
  z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-bg.active { display: flex; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,.2); overflow: hidden;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(.95); } to { opacity:1; transform:scale(1); } }
.modal-header {
  background: var(--primary); color: #fff;
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 800; }
.modal-close {
  border: none; background: rgba(255,255,255,.15); color: #fff;
  cursor: pointer; border-radius: 6px; width: 30px; height: 30px;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: rgba(255,255,255,.25); }
.modal-body { padding: 20px; }
.modal-field { margin-bottom: 14px; }
.modal-label {
  display: block; font-size: 12px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}
.modal-input, .modal-textarea {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s; color: var(--text); background: var(--bg); resize: none;
}
.modal-input:focus, .modal-textarea:focus { border-color: var(--accent); background: #fff; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-btn {
  flex: 1; padding: 12px; border-radius: 9px;
  font-size: 14px; font-weight: 800; border: none; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.modal-btn-primary { background: var(--accent2); color: #fff; }
.modal-btn-primary:hover { background: #2d6a4f; }
.modal-btn-cancel { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.modal-error { font-size: 12px; color: #e63946; margin-top: 6px; display: none; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-weight: 600; font-size: 15px; }
.empty-state small { display: block; margin-top: 6px; font-size: 13px; }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  box-shadow: 0 -2px 16px rgba(0,0,0,.07);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  border: none; background: none; cursor: pointer;
  padding: 5px 0; font-family: inherit;
  transition: color .15s; color: var(--muted);
}
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item .bn-icon { font-size: 20px; }
.bottom-nav-item .bn-label { font-size: 9px; font-weight: 800; letter-spacing: .3px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 84px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary); color: #fff;
  padding: 10px 22px; border-radius: 22px;
  font-size: 13px; font-weight: 700; z-index: 200;
  opacity: 0; transition: all .3s; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #e63946; }
.toast.success { background: var(--accent2); }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--card);
  cursor: pointer; font-size: 13px; font-weight: 700;
  font-family: inherit; transition: all .15s; color: var(--text);
}
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:hover:not(.active) { background: var(--bg); }

/* ── Sidebar extras ── */
.sidebar-close-btn {
  margin-left: auto; border: none; background: rgba(255,255,255,.15);
  color: #fff; cursor: pointer; border-radius: 6px;
  width: 30px; height: 30px; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-footer {
  padding: 14px 18px; font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--border); text-align: center;
}

/* ── Home extras ── */
.home-cta {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: var(--radius); padding: 20px; margin: 18px 0;
  text-align: center; color: #fff;
}
.home-cta p { font-size: 14px; opacity: .88; margin-bottom: 12px; }

/* ── History badge ── */
.history-badge {
  background: var(--accent2); color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 20px;
}

/* ── About page ── */
.about-logo-img {
  display: block; margin: 0 auto 14px;
  width: 100%; max-width: 240px; height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(29,63,90,.12);
}
.about-list { padding-left: 18px; }
.about-list li { margin-bottom: 6px; }
.about-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.about-cat-chip {
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
}
.tubitak-card {
  background: linear-gradient(135deg, var(--primary), #2d6a4f);
  color: #fff; border-radius: var(--radius); padding: 18px;
  display: flex; align-items: center; gap: 14px;
  margin-top: 14px; font-size: 20px;
}

/* ── Utility ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ═══════════════════════════════════════════
   Auth Modal
   ═══════════════════════════════════════════ */

/* — Auth button in topbar — */
.topbar-auth-btn { position: relative; }
.topbar-auth-btn.logged-in { background: var(--accent2); }
.topbar-auth-btn.logged-in::after {
  content: ''; position: absolute; bottom: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; border: 2px solid var(--primary);
}

/* — Modal shell — */
.auth-modal {
  max-width: 420px; border-radius: 22px;
  padding: 0; overflow: visible; position: relative;
}
.auth-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.06); color: var(--muted);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.auth-close:hover { background: rgba(0,0,0,.12); }

/* — Logo — */
.auth-logo-wrap {
  text-align: center; padding: 28px 20px 8px;
}
.auth-logo {
  width: 140px; height: auto; display: inline-block;
  border-radius: 14px;
}

/* — Tabs — */
.auth-tabs {
  display: flex; margin: 6px 24px 0; border-radius: 12px;
  background: var(--bg); padding: 4px; gap: 4px;
}
.auth-tab {
  flex: 1; padding: 10px 0; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 800; font-family: inherit;
  cursor: pointer; transition: all .2s;
  background: transparent; color: var(--muted);
}
.auth-tab.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(29,63,90,.18);
}

/* — Form — */
.auth-form { display: none; padding: 20px 24px 24px; }
.auth-form.active { display: block; }

.auth-field { margin-bottom: 16px; }
.auth-label {
  display: block; font-size: 12px; font-weight: 800;
  color: var(--text); margin-bottom: 6px;
  letter-spacing: .3px;
}
.auth-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0 14px;
  transition: border-color .2s, box-shadow .2s;
}
.auth-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,63,90,.10);
}
.auth-input-icon { color: var(--muted); flex-shrink: 0; }
.auth-input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 13px 0; font-size: 14px; font-family: inherit;
  color: var(--text);
}
.auth-input::placeholder { color: var(--muted); opacity: .7; }
.auth-eye {
  border: none; background: none; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; padding: 0;
  transition: color .15s;
}
.auth-eye:hover { color: var(--primary); }

/* — Password strength — */
.auth-strength {
  margin-top: 6px; height: 4px; border-radius: 2px;
  background: var(--border); overflow: hidden;
}
.auth-strength-bar {
  height: 100%; border-radius: 2px;
  transition: width .3s, background .3s;
}

/* — Extras row — */
.auth-extras {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.auth-remember {
  font-size: 13px; color: var(--muted); font-weight: 600;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.auth-remember input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary);
  cursor: pointer;
}
.auth-forgot {
  border: none; background: none; font-size: 13px; font-weight: 700;
  color: var(--primary); cursor: pointer; font-family: inherit;
  transition: opacity .15s;
}
.auth-forgot:hover { opacity: .7; }

/* — Submit — */
.auth-submit {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 15px; font-weight: 800;
  font-family: inherit; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(29,63,90,.2);
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29,63,90,.28); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.auth-submit .spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* — Error — */
.auth-error {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; font-size: 13px; font-weight: 600;
  display: none; text-align: center;
}
.auth-error.visible { display: block; }

/* — User menu (logged-in state) — */
.user-menu-modal {
  max-width: 340px; border-radius: 22px; padding: 24px; text-align: center;
}
.user-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 28px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.user-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.user-email { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.user-menu-btn {
  width: 100%; padding: 12px; border: 1.5px solid var(--border);
  border-radius: 10px; background: var(--card); font-size: 14px;
  font-weight: 700; font-family: inherit; cursor: pointer;
  color: var(--text); margin-bottom: 8px; transition: all .15s;
}
.user-menu-btn:hover { border-color: var(--primary); color: var(--primary); }
.user-menu-btn.logout {
  border-color: #fecaca; color: #dc2626; background: #fef2f2;
}
.user-menu-btn.logout:hover { background: #fee2e2; }

/* ── Responsive tweaks ── */
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 18px; }
  .auth-modal { margin: 8px; }
  .auth-tabs { margin: 6px 16px 0; }
  .auth-form { padding: 16px; }
}
