@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* =========================================================
   🧠 BİLİŞSEL ERGONOMİ & GÖZ DOSTU ÇİFT TEMA SİSTEMİ
   1. Warm Nordic Slate (🌙 Gece Odak - Halation/Parlama Yapmaz)
   2. Warm Kindle Paper (☀️ Gündüz Kağıt - Mavi Işık Yorgunluğunu Önler)
   ========================================================= */
:root,
body[data-theme="slate"] {
  --bg: #151e2e;
  --bg-radial: radial-gradient(circle at 50% 0%, #202d46 0%, #151e2e 75%);
  --bg-header: rgba(21, 30, 46, 0.88);
  --bg-card: #1e293b;
  --bg-card-grad: linear-gradient(165deg, #243249 0%, #1b2638 100%);
  --bg-stack-1: #192334;
  --bg-stack-2: #141c2b;
  --bg-elevated: #28364d;
  --border: rgba(148, 163, 184, 0.18);
  --border-highlight: rgba(99, 102, 241, 0.45);
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-glow: rgba(79, 70, 229, 0.32);

  /* Doğru Cevap: Hafıza Kodlayıcı Zümrüt Yeşili */
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.16);
  --emerald-border: rgba(16, 185, 129, 0.48);
  --emerald-text: #ecfdf5;
  --emerald-sub: #a7f3d0;

  /* Anahtar Kelime & Hoca Tüyosu: Dikkat Tetikleyici Kehribar */
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.15);
  --amber-border: rgba(245, 158, 11, 0.45);
  --amber-text: #fef3c7;
  --kw-bg: rgba(245, 158, 11, 0.26);
  --kw-text: #fde68a;

  /* Sınav Tuzağı / Kelime Köprüsü: Mercan Turuncu */
  --trap-bg: rgba(249, 115, 22, 0.15);
  --trap-border: rgba(249, 115, 22, 0.45);
  --trap-text: #ffedd5;

  --rose: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.16);
  --card-shadow: 0 18px 38px rgba(7, 11, 20, 0.45);
  --radius: 24px;
}

/* ☀️ Gündüz / Kindle Kağıt Modu (Göz Yormayan Sıcak Fildişi) */
body[data-theme="paper"] {
  --bg: #f4f1ea;
  --bg-radial: radial-gradient(circle at 50% 0%, #faf8f5 0%, #efeae0 80%);
  --bg-header: rgba(244, 241, 234, 0.9);
  --bg-card: #ffffff;
  --bg-card-grad: linear-gradient(165deg, #ffffff 0%, #fcfbf7 100%);
  --bg-stack-1: #ebe6dc;
  --bg-stack-2: #e2dcd0;
  --bg-elevated: #ece8df;
  --border: rgba(30, 41, 59, 0.12);
  --border-highlight: rgba(79, 70, 229, 0.35);
  --text: #1e293b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-light: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.22);

  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #6ee7b7;
  --emerald-text: #064e3b;
  --emerald-sub: #047857;

  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fcd34d;
  --amber-text: #78350f;
  --kw-bg: #fef08a;
  --kw-text: #854d0e;

  --trap-bg: #fff7ed;
  --trap-border: #fdba74;
  --trap-text: #9a3412;

  --rose: #e11d48;
  --rose-bg: #fff1f2;
  --card-shadow: 0 14px 32px rgba(30, 41, 59, 0.09);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-radial);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 80px;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.protected-content {
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.watermark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-content: space-around;
  justify-content: space-around;
  opacity: 0.035;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transform: rotate(-14deg);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}

.header-inner {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e11d48 0%, #4f46e5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  box-shadow: 0 5px 14px rgba(79, 70, 229, 0.35);
}

.brand-title {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: 0.2s ease;
}

.badge-vip {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald);
}

.badge-demo {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--amber);
}

.container {
  max-width: 580px;
  margin: 0 auto;
  padding: 10px 14px;
}

/* Progress Filter Bar */
.stats-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 7px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.stat-box {
  padding: 6px 4px;
  border-radius: 12px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: 0.18s ease;
}

.stat-box.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.12);
}

.stat-num {
  font-size: 15.5px;
  font-weight: 800;
  display: block;
}

.stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
}

/* Mode Switcher */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  background: var(--bg-card);
  padding: 5px;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.mode-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: 0.2s;
  position: relative;
}

.mode-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.lock-pill {
  font-size: 9px;
  background: rgba(245, 158, 11, 0.25);
  color: var(--amber);
  padding: 1px 5px;
  border-radius: 6px;
}

/* Controls Panel */
.controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls-row {
  display: flex;
  gap: 8px;
}

.select-input,
.search-input {
  flex: 1;
  min-width: 110px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
}

.toggles-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
}

.toggle-chip.active {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald);
}

/* ==========================================
   🔥 TINDER SWIPE DECK UI
   ========================================== */
.swipe-stage {
  position: relative;
  width: 100%;
  min-height: 500px;
  margin: 2px 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.swipe-progress-line {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 4px;
  font-weight: 700;
}

.progress-track {
  flex: 1;
  height: 7px;
  background: var(--bg-elevated);
  border-radius: 99px;
  margin: 0 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #10b981);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.deck-stack {
  position: relative;
  width: 100%;
  min-height: 430px;
}

.swipe-card-bg-1 {
  position: absolute;
  inset: 0;
  background: var(--bg-stack-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transform: scale(0.955) translateY(11px);
  z-index: 1;
  pointer-events: none;
}

.swipe-card-bg-2 {
  position: absolute;
  inset: 0;
  background: var(--bg-stack-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transform: scale(0.91) translateY(22px);
  z-index: 0;
  pointer-events: none;
}

.swipe-card-active {
  position: relative;
  z-index: 5;
  width: 100%;
  background: var(--bg-card-grad);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--card-shadow);
  cursor: grab;
  touch-action: pan-y;
  will-change: transform;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
  overflow: hidden;
}

.swipe-card-active.dragging {
  transition: none;
  cursor: grabbing;
}

.swipe-stamp {
  position: absolute;
  top: 20px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.stamp-right {
  left: 16px;
  border: 3px solid #10b981;
  color: #10b981;
  background: rgba(6, 40, 30, 0.9);
  transform: rotate(-11deg);
}

.stamp-left {
  right: 16px;
  border: 3px solid #f59e0b;
  color: #f59e0b;
  background: rgba(45, 25, 4, 0.9);
  transform: rotate(11deg);
}

.swipe-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  width: 100%;
}

.dock-btn {
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease;
}

.dock-btn:active {
  transform: scale(0.94);
}

.dock-btn-left {
  background: var(--amber-bg);
  border: 1.5px solid var(--amber-border);
  color: var(--amber-text);
  padding: 13px 16px;
  font-size: 13px;
  flex: 1;
}

.dock-btn-undo {
  width: 44px;
  height: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
}

.dock-btn-right {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  padding: 13px 16px;
  font-size: 13px;
  flex: 1;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* Card Typography & Components */
.q-card {
  background: var(--bg-card-grad);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.q-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.q-num-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(79, 70, 229, 0.14);
  color: var(--primary-light);
}

.q-cat-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  flex: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-image-wrap {
  margin: 8px 0 12px;
  display: flex;
  justify-content: center;
  background: #ffffff;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.q-image-wrap img {
  max-height: 140px;
  max-width: 100%;
  object-fit: contain;
}

.q-title-en {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.q-title-tr {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  font-weight: 500;
}

.kw-highlight {
  background: var(--kw-bg);
  color: var(--kw-text);
  padding: 1px 5px;
  border-radius: 5px;
  font-weight: 800;
}

/* Correct Answer Box */
.correct-answer-box {
  background: var(--emerald-bg);
  border: 1.5px solid var(--emerald-border);
  border-radius: 15px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.correct-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--emerald);
  margin-bottom: 3px;
}

.correct-text-en {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--emerald-text);
}

.correct-text-en img,
.option-item img {
  max-height: 85px;
  background: #fff;
  padding: 6px;
  border-radius: 8px;
  margin-top: 4px;
}

.correct-text-tr {
  font-size: 13px;
  color: var(--emerald-sub);
  margin-top: 3px;
  font-weight: 600;
}

/* Memory Hack & Trap Word Alert */
.memory-hack-box {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: 14px;
  padding: 10px 13px;
  margin-bottom: 8px;
  font-size: 12.8px;
  color: var(--amber-text);
}

.trap-alert-box {
  background: var(--trap-bg);
  border: 1px solid var(--trap-border);
  border-radius: 12px;
  padding: 9px 12px;
  margin-bottom: 8px;
  font-size: 12.2px;
  color: var(--trap-text);
}

.vocab-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.vocab-pill {
  font-size: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 8px;
}

.card-details-toggle {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.mini-toggle-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
}

.explanation-drawer {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.explanation-drawer p + p {
  margin-top: 6px;
}

.triage-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.triage-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.triage-btn.btn-known.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.triage-btn.btn-hard.active {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}

/* Mock Test Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.option-item {
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.option-item.correct {
  background: var(--emerald-bg);
  border-color: var(--emerald);
  color: var(--emerald-text);
}

.option-item.wrong {
  background: var(--rose-bg);
  border-color: var(--rose);
  color: var(--rose);
}

/* Cheat Sheets */
.cheat-card {
  background: var(--bg-card-grad);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--card-shadow);
}

.cheat-card h3 {
  font-size: 15.5px;
  margin-bottom: 8px;
  color: var(--primary-light);
}

.cheat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 8px;
}

.cheat-table th,
.cheat-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.cheat-table th {
  background: var(--bg-elevated);
  color: var(--text);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 28, 0.82);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: 22px;
  max-width: 450px;
  width: 100%;
  padding: 22px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.cta-primary {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5, #10b981);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 13px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
}

.cta-secondary {
  width: 100%;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 11px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
