/* ═══════════════════════════════════════════════════════
   main.css — SPK Sınav Sistemi
   Ortak stiller, değişkenler, reset, bileşenler
   ═══════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ── CSS DEĞİŞKENLERİ ─────────────────────────────────── */
:root {
  /* Arka planlar */
  --bg:        #0c0c0c;
  --bg2:       #141414;
  --bg3:       #1a1a1a;
  --bg4:       #222222;

  /* Kenarlıklar */
  --border:    #262626;
  --border2:   #303030;

  /* Metin */
  --text:      #ebebeb;
  --text2:     #888888;
  --text3:     #444444;

  /* Vurgu */
  --accent:     #c8ff00;
  --accent-dim: rgba(200, 255, 0, 0.07);
  --accent-mid: rgba(200, 255, 0, 0.18);

  /* Durum renkleri */
  --green:     #3fb950;
  --amber:     #e3b341;
  --red:       #f85149;
  --blue:      #58a6ff;

  --green-dim: rgba(63,  185, 80,  0.08);
  --amber-dim: rgba(227, 179, 65,  0.08);
  --red-dim:   rgba(248, 81,  73,  0.08);
  --blue-dim:  rgba(88,  166, 255, 0.08);

  /* Tipografi */
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;

  /* Boyutlar */
  --topbar-h:    52px;
  --radius:      8px;
  --radius-sm:   5px;
  --radius-lg:   12px;
}

/* ── RESET ────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 14px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── SCROLLBAR ────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── TOPBAR ───────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text);
}

.logo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.75); }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── BUTONLAR ─────────────────────────────────────────── */
.btn {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-accent {
  background: var(--accent);
  color: #0c0c0c;
  font-weight: 600;
}
.btn-accent:hover:not(:disabled) {
  background: #d6ff1c;
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--border2);
  color: var(--text);
  background: var(--bg4);
}

.btn-danger {
  background: var(--red-dim);
  border: 1px solid rgba(248, 81, 73, 0.25);
  color: var(--red);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 81, 73, 0.15);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
}

/* ── FORM ELEMENTLERİ ─────────────────────────────────── */
.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text2);
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}

.input:focus {
  border-color: var(--accent);
}

.input::placeholder {
  color: var(--text3);
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23555' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
  cursor: pointer;
}

select.input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

select.input option {
  background: var(--bg3);
}

/* ── KARTLAR ──────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 1.5rem;
}

/* ── ROZETLER ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
}

.badge-kolay {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.2);
}

.badge-orta {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(227, 179, 65, 0.2);
}

.badge-zor {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.2);
}

.badge-admin {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
}

.badge-user {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(88, 166, 255, 0.2);
}

/* ── BÖLÜM ETİKETİ ────────────────────────────────────── */
.sec-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── LOADING OVERLAY ──────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, 0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(2px);
}

.loading-overlay.on {
  display: flex;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
  letter-spacing: 0.06em;
}

/* ── TOAST ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  display: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

.toast.on { display: block; }

.toast-info {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
}

.toast-error {
  background: var(--red-dim);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--red);
}

.toast-success {
  background: var(--green-dim);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--green);
}

/* ── CHIP / İSTATİSTİK ────────────────────────────────── */
.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--text2);
}

.chip b {
  color: var(--text);
  font-weight: 600;
}

/* ── PERFORMANS BARI ──────────────────────────────────── */
.perf-row {
  margin-bottom: 1rem;
}

.perf-row:last-child {
  margin-bottom: 0;
}

.perf-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 5px;
}

.perf-row-head span:last-child {
  font-family: var(--mono);
  color: var(--text3);
}

.perf-bar-bg {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.perf-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ── AYRAÇ ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── YARDIMCI SINIFLAR ────────────────────────────────── */
.mono  { font-family: var(--mono); }
.muted { color: var(--text3); }
.small { font-size: 11px; }

.text-green  { color: var(--green); }
.text-amber  { color: var(--amber); }
.text-red    { color: var(--red); }
.text-accent { color: var(--accent); }
.text-blue   { color: var(--blue); }

.hidden  { display: none !important; }
.visible { display: block !important; }

/* ── JSON SYNTAX ──────────────────────────────────────── */
.jk { color: var(--blue); }
.js { color: var(--green); }
.jn { color: var(--amber); }
.jb { color: var(--accent); }