/* ════════════════════════════════════════
   BranşDeneme — Ortak Stiller (Açık Tema)
   ════════════════════════════════════════ */

/* Google Fonts — sayfalarda link ile yüklenir */
/* DM Sans + JetBrains Mono */

:root {
  /* Arkaplan */
  --bg: #f4f4f4;
  --bg-alt: #eaeaea;
  
  /* Yüzeyler */
  --card: #ffffff;
  --card-hover: #fafafa;
  --card-border: #e5e5e5;
  
  /* Marka renkleri */
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  
  /* Durum renkleri */
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  
  /* Metin */
  --text: #1a1a1a;
  --text-secondary: #525252;
  --text-muted: #a3a3a3;
  --text-inverse: #ffffff;
  
  /* Çizgiler */
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  
  /* Tipografi */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Boyutlar */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.1);
  
  /* Animasyon */
  --ease: .2s cubic-bezier(.4,0,.2,1);
}

/* ═══ RESET ═══ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
button { font-family: var(--font); cursor: pointer; border: none; }
img { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea { font-family: var(--font); }

/* ═══ LAYOUT ═══ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ═══ TOPBAR ═══ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.topbar-brand {
  font-weight: 700; font-size: 16px; color: var(--primary);
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.topbar-brand:hover { text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { font-size: 13px; color: var(--text-secondary); }
.topbar-user strong { color: var(--text); }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--border);
  object-fit: cover;
}

/* ═══ NAV TABS ═══ */
.nav-tabs {
  display: flex; gap: 0; padding: 0 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.nav-tab {
  padding: 14px 20px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); background: transparent;
  border-bottom: 2px solid transparent;
  transition: all var(--ease);
}
.nav-tab:hover { color: var(--text-secondary); }
.nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ═══ CONTENT ═══ */
.content { flex: 1; padding: 24px; max-width: 1100px; width: 100%; margin: 0 auto; }
.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); }

/* ═══ CARDS ═══ */
.card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
}
.card-clickable { cursor: pointer; }
.card-clickable:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ═══ GRID ═══ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ═══ STAT CARDS ═══ */
.stat-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted); margin-bottom: 8px;
}
.stat-value { font-family: var(--mono); font-size: 28px; font-weight: 700; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }
.stat-value.warning { color: var(--warning); }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: all var(--ease);
}
.btn-primary {
  background: var(--primary); color: var(--text-inverse);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-danger { background: var(--danger); color: var(--text-inverse); }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px;
  outline: none; transition: border var(--ease), box-shadow var(--ease);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ═══ STATUS BADGES ═══ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-muted { background: var(--bg-alt); color: var(--text-muted); }

/* ═══ COUNTDOWN ═══ */
.countdown-section { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.countdown-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 20px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.countdown-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; }
.countdown-row { display: flex; gap: 10px; justify-content: center; }
.cd-block { text-align: center; }
.cd-num {
  font-family: var(--mono); font-size: 24px; font-weight: 700;
  color: var(--primary);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 52px; height: 46px;
  display: grid; place-items: center;
}
.cd-label { font-size: 9px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* ═══ BOOK CARD ═══ */
.book-card { text-align: center; }
.book-cover {
  width: 80px; height: 100px; object-fit: cover;
  border-radius: 8px; margin: 0 auto 12px;
  background: var(--bg-alt); border: 1px solid var(--border);
}
.book-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.book-meta { font-size: 12px; color: var(--text-muted); }

/* ═══ DENEME CARD ═══ */
.deneme-card { text-align: center; }
.deneme-num { font-family: var(--mono); font-size: 32px; font-weight: 700; color: var(--primary); }
.deneme-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.deneme-info { font-size: 11px; color: var(--text-muted); margin-top: 10px; display: flex; justify-content: center; gap: 12px; }
.deneme-status { margin-top: 12px; }

/* ═══ EXAM UI ═══ */
.exam-wrap { display: flex; flex-direction: column; height: calc(100vh - 56px); height: calc(100dvh - 56px); overflow: hidden; }

.exam-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.exam-timer { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--text); }
.exam-timer.warn { color: var(--warning); }
.exam-timer.crit { color: var(--danger); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: .4; } }
.exam-progress { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.q-nav {
  display: flex; gap: 6px; padding: 10px 20px;
  background: var(--card); border-bottom: 1px solid var(--border);
  flex-shrink: 0; flex-wrap: wrap; justify-content: center;
}
.q-nav-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); transition: all var(--ease);
}
.q-nav-btn:hover { border-color: var(--primary); }
.q-nav-btn.answered { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.q-nav-btn.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); color: var(--text); }
.q-nav-btn.correct-mark { background: var(--success-light); border-color: var(--success); color: var(--success); }
.q-nav-btn.wrong-mark { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.q-nav-btn.empty-mark { background: var(--bg); border-color: var(--text-muted); color: var(--text-muted); }

.q-slide-area { flex: 1; overflow: hidden; position: relative; }
.q-slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 20px; overflow-y: auto;
  transition: transform .3s ease, opacity .25s ease;
}
.q-slide.hidden-left { transform: translateX(-100%); opacity: 0; pointer-events: none; }
.q-slide.hidden-right { transform: translateX(100%); opacity: 0; pointer-events: none; }
.q-slide.visible { transform: translateX(0); opacity: 1; }

.q-badge {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--primary); background: var(--primary-light);
  padding: 4px 14px; border-radius: 8px; margin-bottom: 12px;
}

.q-img-container { position: relative; cursor: pointer; display: inline-block; }
.q-img-container::after {
  content: '🔍 Büyütmek için tıkla';
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 10px; padding: 4px 10px; border-radius: 6px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.q-img-container:hover::after { opacity: 1; }
.q-img {
  max-width: 100%; max-height: 70vh;
  border-radius: var(--radius); border: 1px solid var(--border);
  padding: 4px; background: #fff;
}

/* Kompakt şıklar */
.opts-row { display: flex; gap: 8px; margin-top: 16px; justify-content: center; }
.opt-btn {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  background: var(--card); border: 2px solid var(--border);
  color: var(--text-secondary); transition: all var(--ease); user-select: none;
}
.opt-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.opt-btn.sel { border-color: var(--primary); background: var(--primary-light); color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.opt-btn.ok { border-color: var(--success)!important; background: var(--success-light)!important; color: var(--success)!important; }
.opt-btn.no { border-color: var(--danger)!important; background: var(--danger-light)!important; color: var(--danger)!important; }
.opt-btn.reveal { border-color: var(--success)!important; background: rgba(22,163,74,.05)!important; color: var(--success)!important; }

/* Ok butonları */
.q-arrows { display: flex; gap: 10px; margin-top: 18px; }
.arr {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 18px;
  transition: all var(--ease);
}
.arr:hover { border-color: var(--primary); color: var(--primary); }
.arr:disabled { opacity: .3; pointer-events: none; }

/* ═══ RESULTS ═══ */
.result-summary {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 36px;
  text-align: center; margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.result-score {
  font-family: var(--mono); font-size: 56px; font-weight: 700;
  color: var(--primary);
}
.result-label { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.result-stats { display: flex; justify-content: center; gap: 32px; margin-top: 20px; }
.rs-item { text-align: center; }
.rs-value { font-family: var(--mono); font-size: 22px; font-weight: 700; }
.rs-value.c { color: var(--success); }
.rs-value.w { color: var(--danger); }
.rs-value.e { color: var(--text-muted); }
.rs-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ═══ VIDEO BUTTON ═══ */
.btn-video {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 8px;
  background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 600;
  border: 1px solid rgba(37,99,235,.2);
  transition: all var(--ease);
}
.btn-video:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* ═══ WRONG QUESTIONS LIST ═══ */
.wrong-q-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 16px;
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.wrong-q-thumb {
  width: 80px; min-height: 60px; object-fit: contain;
  background: #fff; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; flex-shrink: 0;
}
.wrong-q-info { flex: 1; }
.wrong-q-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.wrong-q-answers { font-size: 13px; margin-bottom: 6px; }
.wrong-q-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.checkbox-understood {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary); cursor: pointer;
}
.checkbox-understood input { accent-color: var(--success); width: 16px; height: 16px; cursor: pointer; }

/* ═══ LIGHTBOX ═══ */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 95vw; max-height: 90vh;
  border-radius: 12px; background: #fff; padding: 8px;
  touch-action: pinch-zoom;
}
.lightbox-close {
  position: fixed; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: none;
  color: #fff; font-size: 20px;
  display: grid; place-items: center;
  cursor: pointer; z-index: 301;
}
.lightbox-close:hover { background: rgba(255,255,255,.35); }

/* ═══ VIDEO MODAL ═══ */
.video-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.8);
  display: grid; place-items: center;
}
.video-modal-inner {
  width: 90vw; max-width: 800px;
  background: #000; border-radius: 12px; overflow: hidden;
  position: relative;
}
.video-modal-inner iframe,
.video-modal-inner video {
  width: 100%; aspect-ratio: 16/9; display: block;
}
.video-modal-close {
  position: absolute; top: -40px; right: 0;
  background: rgba(255,255,255,.2); border: none;
  color: #fff; font-size: 18px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
}
.video-modal-title {
  padding: 10px 16px; background: #111;
  color: #fff; font-size: 13px; font-weight: 500;
}

/* ═══ MODAL / OVERLAY ═══ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: grid; place-items: center; z-index: 200;
}
.modal-box {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 28px; max-width: 400px; width: 90%;
  text-align: center; box-shadow: var(--shadow-lg);
}
.modal-box h3 { font-size: 17px; margin-bottom: 8px; }
.modal-box p { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ═══ LOGIN/REGISTER ═══ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px; background: var(--bg);
}
.auth-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 44px 36px;
  width: 100%; max-width: 420px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth-brand { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.auth-footer { margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 500; }

/* ═══ EMPTY STATE ═══ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ═══ TOAST ═══ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; z-index: 999;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
@keyframes slideUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; height: 52px; }
  .nav-tabs { padding: 0 16px; overflow-x: auto; }
  .nav-tab { padding: 12px 14px; font-size: 12px; white-space: nowrap; }
  .content { padding: 16px; }
  .countdown-section { grid-template-columns: 1fr; }
  .cd-num { font-size: 20px; width: 44px; height: 38px; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .q-nav { padding: 8px 12px; gap: 4px; }
  .q-nav-btn { width: 30px; height: 30px; font-size: 11px; }
  .opt-btn { width: 44px; height: 44px; font-size: 14px; }
  .result-score { font-size: 40px; }
  .result-stats { gap: 20px; }
  .wrong-q-card { flex-direction: column; }
  .wrong-q-thumb { width: 100%; max-height: 200px; }
  .stat-value { font-size: 22px; }
}
@media (max-width: 380px) {
  .grid-stats { grid-template-columns: 1fr; }
  .countdown-section { gap: 10px; }
  .auth-card { padding: 32px 20px; }
}
