/* ═══════════════════════════════════════════════════════════════
   ALES KOÇU — DESIGN SYSTEM
   Tema: Turuncu Alev | Dark Mode | Gamified
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── TOKENS ── */
:root {
  --orange-primary: #FF6B35;
  --orange-light:   #FF8C42;
  --orange-glow:    #FF6B3540;
  --orange-deep:    #E85D2F;
  --gold:           #F7931E;
  --gold-light:     #FFB347;

  --bg-base:    #0D0F1A;
  --bg-card:    #141728;
  --bg-card-2:  #1C2038;
  --bg-hover:   #222640;
  --border:     #2A2E4A;
  --border-light: #353A60;

  --green:  #00C897;
  --green-bg: #00C89720;
  --red:    #FF4757;
  --red-bg: #FF475720;
  --blue:   #4ECDC4;
  --purple: #A78BFA;

  --text-primary:   #F0F0F5;
  --text-secondary: #9A9DC0;
  --text-muted:     #5A5E80;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-orange: 0 0 30px rgba(255,107,53,0.25);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --transition:    all 0.2s cubic-bezier(0.4,0,0.2,1);

  --sidebar-w: 240px;
  --header-h:  60px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea { font-family: inherit; outline: none; }
img { max-width: 100%; display: block; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange-primary); }

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--orange-primary), var(--orange-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px var(--orange-glow);
  flex-shrink: 0;
}

.logo-text { line-height: 1.2; }
.logo-text strong { display: block; font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.logo-text span { font-size: 0.7rem; color: var(--orange-primary); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

/* User XP Card in Sidebar */
.sidebar-xp {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.xp-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.xp-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--orange-primary), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.xp-info { flex: 1; min-width: 0; }
.xp-level { font-size: 0.75rem; font-weight: 700; color: var(--orange-light); }
.xp-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.xp-bar-wrap { margin-bottom: 6px; }
.xp-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange-primary), var(--gold));
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 8px var(--orange-glow);
}
.xp-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.sidebar-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #FF8C42;
  font-weight: 600;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(247,147,30,0.1));
  border-color: rgba(255,107,53,0.3);
  color: var(--orange-light);
}

.nav-item.active .nav-icon { color: var(--orange-primary); }

.nav-icon {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--orange-primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer p {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOP BAR ── */
.topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}
.topbar-left p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

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

.topbar-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.hamburger {
  display: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 4px 8px;
}

/* ── PAGE CONTENT ── */
.page-content {
  padding: 24px;
  flex: 1;
}

/* ══════════════════════════════════════
   COMPONENTS
══════════════════════════════════════ */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-orange {
  background: linear-gradient(135deg, #1f1508 0%, #2a1a0a 100%);
  border-color: rgba(255,107,53,0.3);
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange-primary), var(--orange-light));
  color: #fff;
  box-shadow: 0 0 20px var(--orange-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px var(--orange-glow);
}

.btn-secondary {
  background: var(--bg-card-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--orange-primary);
  border: 1px solid rgba(255,107,53,0.3);
}
.btn-ghost:hover { background: rgba(255,107,53,0.1); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ── STAT CARDS ── */
.stat-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--orange-primary); }

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── HERO CARD ── */
.hero-card {
  background: linear-gradient(135deg, #1a0e05 0%, #200d00 50%, #1a1205 100%);
  border: 1px solid rgba(255,107,53,0.3);
  border-radius: var(--radius-xl);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,53,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 20%;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247,147,30,0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* ── TOPIC CARDS ── */
.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.topic-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.topic-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.topic-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.topic-title { font-size: 0.95rem; font-weight: 700; }

.topic-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}

.topic-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* ── QUESTION CARD ── */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.q-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.q-tag-hard { background: rgba(255,71,87,0.2); color: var(--red); }
.q-tag-medium { background: rgba(255,107,53,0.2); color: var(--orange-light); }
.q-tag-easy { background: rgba(0,200,151,0.2); color: var(--green); }

.q-year-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(167,139,250,0.15);
  color: var(--purple);
  border: 1px solid rgba(167,139,250,0.3);
}

.q-text {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 18px;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.925rem;
}

.q-option:hover:not(.answered) {
  border-color: var(--orange-primary);
  background: rgba(255,107,53,0.08);
  color: var(--text-primary);
}

.q-option.correct {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.q-option.wrong {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

.q-option.passive {
  opacity: 0.45;
}

.option-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  flex-shrink: 0;
  transition: var(--transition);
}

.q-option.correct .option-letter {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.q-option.wrong .option-letter {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.q-explanation {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255,107,53,0.06);
  border: 1px solid rgba(255,107,53,0.2);
  border-left: 4px solid var(--orange-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  animation: fadeIn 0.3s ease;
}

.q-explanation-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--orange-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.q-explanation-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.q-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.q-dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.q-dot {
  width: 20px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: var(--transition);
}
.q-dot.done { background: var(--orange-primary); }
.q-dot.correct-dot { background: var(--green); }
.q-dot.wrong-dot { background: var(--red); }

/* ── KONU ANLATIMI ── */
.topic-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.topic-content h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--orange-light);
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.topic-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-content h3::before {
  content: '';
  display: inline-block;
  width: 4px; height: 18px;
  background: var(--orange-primary);
  border-radius: 2px;
}

.topic-content p {
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.8;
  font-size: 0.925rem;
}

.topic-content ul, .topic-content ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.topic-content li {
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.7;
  font-size: 0.925rem;
}

.topic-content li::marker { color: var(--orange-primary); }

.formula-box {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--orange-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin: 14px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--orange-light);
}

.formula-box .formula-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.hap-box {
  background: linear-gradient(135deg, rgba(247,147,30,0.1), rgba(255,107,53,0.05));
  border: 1px solid rgba(247,147,30,0.35);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 18px 0;
}

.hap-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.hap-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hap-list li {
  display: flex;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,107,53,0.1);
}

.hap-list li:last-child { border-bottom: none; }

.hap-list li::before {
  content: '⚡';
  flex-shrink: 0;
}

.warning-box {
  background: rgba(255,71,87,0.08);
  border: 1px solid rgba(255,71,87,0.25);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 0.875rem;
  color: #ff8a94;
}

.warning-box strong { color: var(--red); }

.example-box {
  background: rgba(78,205,196,0.06);
  border: 1px solid rgba(78,205,196,0.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 14px 0;
}

.example-box .ex-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.example-box p { font-size: 0.875rem; color: #8fddda; margin: 0; }

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 9px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--orange-primary);
  color: #fff;
}

/* ── BADGES ── */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.badge-item {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  transition: var(--transition);
}

.badge-item.unlocked {
  background: rgba(255,107,53,0.08);
  border-color: rgba(255,107,53,0.35);
  box-shadow: 0 0 15px rgba(255,107,53,0.1);
}

.badge-emoji {
  font-size: 1.75rem;
  margin-bottom: 6px;
  display: block;
  filter: grayscale(0);
}

.badge-item:not(.unlocked) .badge-emoji { filter: grayscale(1); opacity: 0.4; }

.badge-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.badge-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── LEADERBOARD ── */
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-bottom: 4px;
}

.lb-row.is-user {
  background: rgba(255,107,53,0.1);
  border: 1px solid rgba(255,107,53,0.25);
}

.lb-row:not(.is-user):hover { background: var(--bg-hover); }

.lb-rank {
  width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.lb-avatar { font-size: 1.3rem; }

.lb-info { flex: 1; }
.lb-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.lb-sub { font-size: 0.72rem; color: var(--text-muted); }

.lb-xp { font-size: 0.875rem; font-weight: 800; color: var(--gold); }

/* ── AI TUTOR ── */
.ai-chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 48px);
  min-height: 500px;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideUp 0.3s ease;
}

.ai-msg.user { justify-content: flex-end; }

.ai-msg-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ai-msg-avatar.bot { background: linear-gradient(135deg, var(--green), #00a37a); }
.ai-msg-avatar.user { background: linear-gradient(135deg, var(--orange-primary), var(--gold)); }

.ai-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.ai-bubble.bot {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 4px var(--radius) var(--radius) var(--radius);
  color: var(--text-secondary);
}

.ai-bubble.user {
  background: linear-gradient(135deg, rgba(255,107,53,0.25), rgba(247,147,30,0.15));
  border: 1px solid rgba(255,107,53,0.35);
  border-radius: var(--radius) 4px var(--radius) var(--radius);
  color: #ffd4c2;
}

.ai-input-row {
  display: flex;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.ai-input {
  flex: 1;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: none;
  transition: var(--transition);
  height: 48px;
  max-height: 120px;
}

.ai-input:focus { border-color: var(--orange-primary); }

.ai-send-btn {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--orange-primary), var(--orange-light));
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 0 15px var(--orange-glow);
}

.ai-send-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-orange); }
.ai-send-btn:disabled { opacity: 0.4; transform: none; }

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.ai-suggestion-chip {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 0.775rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.ai-suggestion-chip:hover {
  border-color: var(--orange-primary);
  color: var(--orange-light);
  background: rgba(255,107,53,0.08);
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--orange-primary);
  animation: typingPulse 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  animation: slideInRight 0.35s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 320px;
}

.toast.xp { border-color: var(--gold); color: var(--gold); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.badge { border-color: var(--purple); color: var(--purple); }

.toast.hide { animation: slideOutRight 0.25s ease forwards; }

/* ── LEVEL UP OVERLAY ── */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.levelup-card {
  background: linear-gradient(135deg, #1f1005, #150a00);
  border: 2px solid var(--orange-primary);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-orange);
  animation: scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.levelup-icon { font-size: 4rem; margin-bottom: 16px; animation: bounce 0.5s ease; }
.levelup-title { font-size: 1.75rem; font-weight: 900; color: var(--orange-primary); margin-bottom: 6px; }
.levelup-sub { font-size: 1rem; color: var(--text-secondary); margin-bottom: 24px; }

/* ── PARTICLES ── */
.particle {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  animation: particleFly 1s ease-out forwards;
}

/* ── SECTION HEADERS ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── TIMER ── */
.timer-badge {
  background: rgba(255,71,87,0.15);
  border: 1px solid rgba(255,71,87,0.3);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red);
  font-family: 'JetBrains Mono', monospace;
}

/* ── CIKMIS SORU BADGE ── */
.cikmis-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(167,139,250,0.15);
  border: 1px solid rgba(167,139,250,0.35);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--purple);
}

/* ── MODE SELECTOR ── */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.mode-card {
  background: var(--bg-card-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.mode-card:hover { border-color: var(--orange-primary); transform: translateY(-2px); }
.mode-card.selected { border-color: var(--orange-primary); background: rgba(255,107,53,0.08); }
.mode-card .mode-icon { font-size: 2rem; margin-bottom: 10px; }
.mode-card .mode-name { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.mode-card .mode-desc { font-size: 0.775rem; color: var(--text-muted); }

/* ── BACK BTN ── */
.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--orange-primary);
  font-size: 0.875rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 18px;
  transition: var(--transition);
}

.back-btn:hover { opacity: 0.8; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; }

/* ══════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutRight { to { opacity: 0; transform: translateX(60px); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes typingPulse { 0%,100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes particleFly { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-180px) scale(0.2); } }
@keyframes flamePulse { 0%,100% { text-shadow: 0 0 8px #ff6b35; } 50% { text-shadow: 0 0 20px #ff6b35, 0 0 40px #f7931e; } }

.flame-anim { animation: flamePulse 1.5s ease-in-out infinite; }

/* ══════════════════════════════════════
   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: 0px; }

  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199;
  }

  .sidebar-overlay.visible { display: block; }

  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .page-content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-card { padding: 18px; }
  .topbar { padding: 0 16px; }
  .ai-bubble { max-width: 90%; }
}

@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-right .topbar-stat:last-child { display: none; }
}

/* PWA Safe Areas */
@supports (padding-top: env(safe-area-inset-top)) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
}
