/* ============================================================
   Öğrenci Test Takip & Analiz — Ana Stil
   Tema: body.tema-kiz (pembe) / body.tema-erkek (mavi)
   ============================================================ */

:root {
  --bg:        #f4f5fb;
  --card:      #ffffff;
  --text:      #1e293b;
  --text-soft: #64748b;
  --line:      #e9ebf3;
  --ok:        #22c55e;
  --err:       #ef4444;
  --warn:      #f59e0b;
  --radius:    16px;
  --shadow:    0 10px 30px rgba(30, 41, 59, .06);
  --shadow-lg: 0 24px 60px rgba(30, 41, 59, .14);
}

/* --- Kız teması (pembe) --- */
body.tema-kiz {
  --brand:    #ec4899;
  --brand-2:  #d946ef;
  --brand-dk: #be185d;
  --brand-soft:#fce7f3;
  --grad:     linear-gradient(135deg, #f472b6 0%, #db2777 60%, #a21caf 100%);
  --grad-soft:linear-gradient(135deg, #fdf2f8, #fbe4f3);
}

/* --- Erkek teması (mavi) --- */
body.tema-erkek {
  --brand:    #2563eb;
  --brand-2:  #06b6d4;
  --brand-dk: #1e40af;
  --brand-soft:#dbeafe;
  --grad:     linear-gradient(135deg, #38bdf8 0%, #2563eb 60%, #4f46e5 100%);
  --grad-soft:linear-gradient(135deg, #eff6ff, #e0f2fe);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Giriş / Kayıt ekranı
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-yan {
  background: var(--grad);
  color: #fff;
  padding: 60px 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-yan::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 45%),
              radial-gradient(circle at 10% 90%, rgba(255,255,255,.12), transparent 40%);
}
.auth-yan .logo { font-size: 30px; font-weight: 800; letter-spacing: -.5px; position: relative; }
.auth-yan h1 { font-size: 40px; line-height: 1.1; margin: 22px 0 12px; position: relative; }
.auth-yan p  { font-size: 17px; opacity: .92; max-width: 400px; position: relative; }
.auth-ozellikler { margin-top: 34px; position: relative; display: grid; gap: 14px; }
.auth-ozellikler div { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.auth-ozellikler span.ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.2); flex: none; font-size: 17px;
}
.auth-form {
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; margin: 0 0 6px; }
.auth-card .alt { color: var(--text-soft); margin: 0 0 26px; }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-yan { display: none; }
}

/* ============================================================
   Form elemanları
   ============================================================ */
.alan { margin-bottom: 16px; }
.alan label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-soft); }
.girdi, select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.girdi:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent);
}
textarea { resize: vertical; min-height: 72px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: none; border-radius: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: transform .08s, box-shadow .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-esas { background: var(--grad); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn-esas:hover { box-shadow: 0 12px 26px color-mix(in srgb, var(--brand) 45%, transparent); }
.btn-sade { background: var(--card); color: var(--text); border: 1.5px solid var(--line); }
.btn-sade:hover { border-color: var(--brand); color: var(--brand); }
.btn-tehlike { background: #fef2f2; color: var(--err); border: 1.5px solid #fecaca; }
.btn-tehlike:hover { background: var(--err); color: #fff; }
.btn-blok { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }

/* Cinsiyet seçici (kayıt) */
.cinsiyet-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cinsiyet-sec label {
  border: 2px solid var(--line); border-radius: 14px; padding: 16px; text-align: center;
  cursor: pointer; font-weight: 600; transition: all .15s; margin: 0; color: var(--text);
}
.cinsiyet-sec input { display: none; }
.cinsiyet-sec .kiz.sec, .cinsiyet-sec input:checked + .kutu.kiz { }
.cinsiyet-sec label.kiz.aktif  { border-color: #ec4899; background: #fdf2f8; color: #be185d; }
.cinsiyet-sec label.erkek.aktif{ border-color: #2563eb; background: #eff6ff; color: #1e40af; }
.cinsiyet-sec .emoji { font-size: 26px; display: block; margin-bottom: 6px; }

/* ============================================================
   Uygulama düzeni (sidebar + içerik)
   ============================================================ */
.kabuk { display: flex; min-height: 100vh; }

.yan-menu {
  width: 250px; background: var(--card); border-right: 1px solid var(--line);
  padding: 22px 16px; position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  display: flex; flex-direction: column; transition: transform .25s;
}
.yan-menu .marka {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 800; font-size: 18px;
}
.yan-menu .marka .rozet {
  width: 38px; height: 38px; border-radius: 11px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 20px;
}
.menu-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: var(--text-soft); font-weight: 600; margin-bottom: 4px; transition: all .15s;
}
.menu-link:hover { background: var(--grad-soft); color: var(--brand-dk); text-decoration: none; }
.menu-link.aktif { background: var(--grad); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 30%, transparent); }
.menu-link .ic { font-size: 18px; width: 22px; text-align: center; }
.menu-alt { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.menu-kul { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.menu-kul .ad { font-weight: 600; font-size: 14px; }
.menu-kul .mail { font-size: 12px; color: var(--text-soft); }

.icerik { flex: 1; margin-left: 250px; padding: 26px 32px 60px; max-width: 1280px; }

/* Üst bar (mobil hamburger) */
.ust-bar {
  display: none; align-items: center; justify-content: space-between;
  background: var(--card); padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.hamburger { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }
.perde { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 39; }

@media (max-width: 900px) {
  .yan-menu { transform: translateX(-100%); }
  body.menu-acik .yan-menu { transform: translateX(0); }
  body.menu-acik .perde { display: block; }
  .icerik { margin-left: 0; padding: 18px; }
  .ust-bar { display: flex; }
}

/* ============================================================
   Sayfa başlığı
   ============================================================ */
.sayfa-bas { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.sayfa-bas h1 { font-size: 22px; margin: 0; }
.sayfa-bas .ac { color: var(--text-soft); margin: 4px 0 0; font-size: 14px; }

/* ============================================================
   Kartlar & istatistik
   ============================================================ */
.kart {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; border: 1px solid var(--line);
}
.kart-bas { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kart-bas h3 { margin: 0; font-size: 17px; }

.izgara { display: grid; gap: 12px; }
.izgara.k2 { grid-template-columns: repeat(2, 1fr); }
.izgara.k3 { grid-template-columns: repeat(3, 1fr); }
.izgara.k4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px){ .izgara.k4 { grid-template-columns: repeat(2,1fr);} .izgara.k3{grid-template-columns:1fr 1fr;} }
@media (max-width: 640px){ .izgara.k2,.izgara.k3,.izgara.k4 { grid-template-columns: 1fr; } }

.istat {
  background: var(--card); border-radius: var(--radius); padding: 16px; border: 1px solid var(--line);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.istat .ic-kutu {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 14px; background: var(--grad-soft); color: var(--brand);
}
.istat .deger { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.istat .etiket { color: var(--text-soft); font-size: 13px; margin-top: 6px; }
.istat.vurgu { background: var(--grad); color: #fff; border: none; }
.istat.vurgu .etiket { color: rgba(255,255,255,.85); }
.istat.vurgu .ic-kutu { background: rgba(255,255,255,.22); color: #fff; }

/* ============================================================
   Tablo
   ============================================================ */
.tablo-sar { overflow-x: auto; border-radius: var(--radius); }
table.tablo { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tablo th {
  text-align: left; padding: 12px 14px; color: var(--text-soft); font-weight: 600;
  border-bottom: 2px solid var(--line); white-space: nowrap; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px;
}
table.tablo td { padding: 13px 14px; border-bottom: 1px solid var(--line); }
table.tablo tr:hover td { background: var(--grad-soft); }
table.tablo tr:last-child td { border-bottom: none; }

.rozet { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.ders-nokta { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip-ders { background: color-mix(in srgb, var(--_c, #999) 14%, #fff); color: var(--_c, #333); }

.oran-cubuk { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 90px; }
.oran-cubuk i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }

/* ============================================================
   Modal
   ============================================================ */
.modal-perde {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55);
  z-index: 60; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-perde.acik { display: flex; }
.modal {
  background: var(--card); border-radius: 20px; width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg); animation: modalGir .2s ease; margin: auto;
}
.modal.genis { max-width: 860px; }
@keyframes modalGir { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-bas { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-bas h3 { margin: 0; font-size: 19px; }
.modal-kapat { background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--text-soft); }
.modal-govde { padding: 24px; }
.modal-alt { padding: 18px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.satir { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px){ .satir { grid-template-columns: 1fr; } }

/* ============================================================
   Soru ızgarası (test giriş)
   ============================================================ */
.soru-arac { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.soru-sayac { display: flex; gap: 8px; flex-wrap: wrap; }
.sayac-rozet { padding: 6px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.sayac-rozet.d { background: #dcfce7; color: #15803d; }
.sayac-rozet.y { background: #fee2e2; color: #b91c1c; }
.sayac-rozet.b { background: #f1f5f9; color: #475569; }
.sayac-rozet.n { background: var(--grad-soft); color: var(--brand-dk); }

.soru-izgara { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px; }
.soru-btn {
  aspect-ratio: 1; border: 2px solid var(--line); border-radius: 11px; background: #fff;
  font-weight: 700; font-size: 14px; cursor: pointer; color: var(--text-soft);
  display: grid; place-items: center; transition: all .12s; user-select: none; position: relative;
}
.soru-btn small { position: absolute; top: 3px; left: 5px; font-size: 9px; opacity: .6; font-weight: 600; }
.soru-btn.d { background: var(--ok); border-color: var(--ok); color: #fff; }
.soru-btn.y { background: var(--err); border-color: var(--err); color: #fff; }
.soru-btn.b { background: #fff; border-color: var(--line); color: #cbd5e1; }
.soru-ipucu { font-size: 12.5px; color: var(--text-soft); margin-top: 10px; }
.hizli-btnlar { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tam genişlik modal (cevap kağıdı / detay / anahtar) */
.modal.tam { max-width: 1000px; }

/* Çözme ekranı başlığı + süre sayacı */
.coz-bas { align-items: center; }
.coz-sag { display: flex; align-items: center; gap: 14px; }
.zaman-kutu {
  font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 800; font-size: 22px;
  background: var(--grad); color: #fff; padding: 8px 16px; border-radius: 12px; letter-spacing: 1px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent);
}
.zaman-kutu.doldu { background: #dc2626; animation: yanip 1s infinite; box-shadow: none; }
@keyframes yanip { 50% { opacity: .55; } }
.isaret-bilgi { font-size: 13px; color: var(--text-soft); white-space: nowrap; }
@media (max-width: 560px) { .zaman-kutu { font-size: 18px; padding: 6px 12px; } .isaret-bilgi { display: none; } }

/* Optik cevap kağıdı ızgarası */
.optik-izgara { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 18px; }
.optik-satir {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}
.optik-no { width: 26px; text-align: right; font-weight: 700; color: var(--text-soft); flex: none; font-size: 13px; }
.optik-btn {
  width: 30px; height: 30px; border: 1.5px solid var(--line); border-radius: 50%; background: #fff;
  font-weight: 700; font-size: 12.5px; cursor: pointer; color: var(--text-soft); transition: all .1s;
}
.optik-btn:hover { border-color: var(--brand); }
.optik-btn.sec { background: var(--brand); border-color: var(--brand); color: #fff; }
.optik-btn.key.sec { background: #334155; border-color: #334155; color: #fff; }

/* Cevap anahtarı ızgarası */
.mod-sec { margin-bottom: 4px; }
.anahtar-izgara { display: grid; gap: 8px; max-height: 400px; overflow-y: auto; padding: 4px; }
.anahtar-satir {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; flex-wrap: wrap;
}
.anahtar-no { width: 26px; text-align: center; font-weight: 700; color: var(--text-soft); flex: none; }
.anahtar-grup { display: flex; align-items: center; gap: 4px; }
.grup-et { font-size: 10.5px; color: var(--text-soft); margin-right: 3px; min-width: 34px; text-transform: uppercase; letter-spacing: .3px; }
.harf-btn {
  width: 32px; height: 32px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff;
  font-weight: 700; font-size: 13px; cursor: pointer; color: var(--text-soft); transition: all .1s;
}
.harf-btn:hover { border-color: var(--brand); }
.harf-btn.senin.sec { background: var(--brand); border-color: var(--brand); color: #fff; }
.harf-btn.key.sec   { background: #334155; border-color: #334155; color: #fff; }
.harf-btn.senin.sec.dogru  { background: #22c55e; border-color: #22c55e; color: #fff; }
.harf-btn.senin.sec.yanlis { background: #ef4444; border-color: #ef4444; color: #fff; }
.anahtar-sonuc { margin-left: auto; font-weight: 800; font-size: 17px; padding-left: 6px; }
.anahtar-sonuc.d { color: #16a34a; } .anahtar-sonuc.y { color: #dc2626; } .anahtar-sonuc.b { color: #94a3b8; }
.anahtar-satir.sonuc-d { border-color: #bbf7d0; background: #f0fdf4; }
.anahtar-satir.sonuc-y { border-color: #fecaca; background: #fef2f2; }
.anahtar-banner {
  background: var(--grad-soft); color: var(--brand-dk); padding: 11px 15px; border-radius: 10px;
  font-size: 13.5px; margin-bottom: 12px;
}
@media (max-width: 560px) { .grup-et { min-width: 0; } .harf-btn { width: 30px; height: 30px; } }

/* Legend */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ============================================================
   Hedef kartları / ilerleme
   ============================================================ */
.hedef-kart { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.hedef-kart .ust { display: flex; justify-content: space-between; align-items: start; margin-bottom: 12px; }
.hedef-kart .ilerleme { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.hedef-kart .ilerleme i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .5s; }
.hedef-kart.tamam .ilerleme i { background: linear-gradient(135deg,#22c55e,#16a34a); }
.hedef-kart .yuzde { font-size: 13px; color: var(--text-soft); margin-top: 8px; display: flex; justify-content: space-between; }
.hedef-tamam-rozet { background: #dcfce7; color: #15803d; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* Boş durum */
.bos-durum { text-align: center; padding: 50px 20px; color: var(--text-soft); }
.bos-durum .emoji { font-size: 46px; display: block; margin-bottom: 12px; }

/* Flash */
.flash-alan { position: fixed; top: 18px; right: 18px; z-index: 90; display: grid; gap: 10px; max-width: 340px; }
.flash { padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: flashGir .3s; background: #fff; border-left: 4px solid var(--brand); }
.flash.ok  { border-left-color: var(--ok); }
.flash.err { border-left-color: var(--err); }
@keyframes flashGir { from { opacity: 0; transform: translateX(20px); } }

/* Yardımcılar */
.mt { margin-top: 18px; } .mt-l { margin-top: 28px; }
.metin-soft { color: var(--text-soft); }
.aralik { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.davet-kutu { display: flex; gap: 8px; }
.davet-kutu input { font-family: monospace; letter-spacing: .5px; }
.filtre-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filtre-bar select, .filtre-bar input { width: auto; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg a { padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--text-soft); }
.seg a.aktif { background: var(--grad); color: #fff; }

/* ============================================================
   Chart.js / Grafikler
   ============================================================ */
canvas { max-height: 100%; display: block; }
/* Dashboard grafikleri (trend) */
#trendGrafik { max-height: 200px; }
/* Analiz grafikleri */
#grafDers, #grafDagilim { max-height: 220px; }
#grafZaman { max-height: 160px; }
#grafOran { max-height: 180px; }
.seg a:hover { text-decoration: none; }

/* ============================================================
   Rapor başlığı & Yazdırma
   ============================================================ */
.rapor-bas { display: none; }
.rapor-bas h2 { margin: 0 0 4px; }
.rapor-bas p { margin: 0; color: var(--text-soft); }

@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .yan-menu, .ust-bar, .perde, .no-print, .filtre-bar, .flash-alan { display: none !important; }
  .icerik { margin: 0 !important; padding: 0 !important; max-width: none; }
  .kabuk { display: block; }
  .rapor-bas { display: block; margin-bottom: 16px; border-bottom: 2px solid #000; padding-bottom: 10px; }
  .kart, .istat { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .izgara { gap: 10px; }
  canvas { max-height: 260px; }
  a[href]::after { content: ""; }
}
