/* ===== TEMEL ===== */
:root {
  --bg-ana:      #0f1117;
  --bg-kart:     #1a1d27;
  --bg-sidebar:  #111318;
  --bg-input:    #252836;
  --border:      #2e3147;
  --primary:     #5865f2;
  --primary-aci: #4752c4;
  --green:       #3ba55d;
  --red:         #ed4245;
  --yellow:      #faa61a;
  --purple:      #9b59b6;
  --text:        #dcddde;
  --text-muted:  #72767d;
  --text-baslik: #ffffff;
  --topbar-h:    56px;
  --sidebar-w:   240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg-ana);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--bg-input); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

/* ===== AUTH ===== */
.auth-page { justify-content: center; align-items: center; }
.auth-container { width: 100%; max-width: 420px; padding: 24px; }
.auth-box {
  background: var(--bg-kart);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
}
.auth-logo { margin-bottom: 16px; }
.auth-box h1 { font-size: 1.5rem; color: var(--text-baslik); margin-bottom: 8px; }
.auth-box p  { color: var(--text-muted); margin-bottom: 28px; }
.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-discord:hover { background: var(--primary-aci); text-decoration: none; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-baslik);
  font-weight: 700;
  font-size: 1rem;
}
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.nav-item:hover  { background: var(--bg-input); color: var(--text); text-decoration: none; }
.nav-item.aktif  { background: var(--primary); color: #fff; }
.nav-ikon { width: 18px; text-align: center; }
.sidebar-alt {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.kullanici-bilgi {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.avatar { width: 28px; height: 28px; border-radius: 50%; }
.btn-cikis {
  display: block;
  text-align: center;
  padding: 7px;
  background: var(--bg-input);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all 0.15s;
}
.btn-cikis:hover { background: var(--red); color: #fff; text-decoration: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  background: var(--bg-kart);
  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;
}
.sidebar-toggle {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.versiyon-badge {
  background: var(--bg-input);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
}
.page-content { padding: 28px 32px; }

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.4rem; color: var(--text-baslik); }
.page-header p  { color: var(--text-muted); margin-top: 4px; }
.detay-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.detay-aksiyonlar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-kart);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.stat-icon.blue   { background: rgba(88,101,242,0.2); }
.stat-icon.green  { background: rgba(59,165,93,0.2); }
.stat-icon.red    { background: rgba(237,66,69,0.2); }
.stat-icon.purple { background: rgba(155,89,182,0.2); }
.stat-icon.yellow { background: rgba(250,166,26,0.2); }
.stat-info { display: flex; flex-direction: column; }
.stat-sayi { font-size: 1.5rem; font-weight: 700; color: var(--text-baslik); }
.stat-etiket { font-size: 0.78rem; color: var(--text-muted); }

/* ===== CARD ===== */
.card {
  background: var(--bg-kart);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 1rem; color: var(--text-baslik); }
.card-header small { color: var(--text-muted); font-size: 0.8rem; }

/* ===== BOT LISTE ===== */
.bot-liste { padding: 8px; }
.bot-kart {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.bot-kart:hover { background: var(--bg-input); }
.bot-kart-sol { display: flex; align-items: center; gap: 12px; }
.bot-kart-sol strong { display: block; color: var(--text-baslik); font-size: 0.9rem; }
.bot-kart-sol small  { color: var(--text-muted); font-size: 0.78rem; }
.bot-kart-sag { display: flex; align-items: center; gap: 8px; }
.bot-durum-nokta {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bot-durum-nokta.yesil   { background: var(--green); box-shadow: 0 0 6px var(--green); }
.bot-durum-nokta.kirmizi { background: var(--red); }
.bot-durum-nokta.sari    { background: #faa81a; box-shadow: 0 0 6px #faa81a; animation: sari-nabiz 1.5s ease-in-out infinite; }
@keyframes sari-nabiz { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
.bos-durum { padding: 40px; text-align: center; color: var(--text-muted); }
.bos-durum p { margin-bottom: 16px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
  color: #fff;
  background: var(--bg-input);
  text-decoration: none !important;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--primary); }
.btn-green    { background: var(--green); }
.btn-red      { background: var(--red); }
.btn-ikincil  { background: var(--bg-input); border: 1px solid var(--border); }
.btn-sm       { padding: 5px 10px; font-size: 0.8rem; }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-basari { background: rgba(59,165,93,0.15); border: 1px solid var(--green); color: #4dca74; }
.alert-hata   { background: rgba(237,66,69,0.15); border: 1px solid var(--red);   color: #f47a7c; }

/* ===== BADGES ===== */
.badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green  { background: rgba(59,165,93,0.2);   color: #4dca74; }
.badge-red    { background: rgba(237,66,69,0.2);   color: #f47a7c; }
.badge-yellow { background: rgba(250,168,26,0.2);  color: #faa81a; }
.badge-gray   { background: rgba(130,130,130,0.2); color: #999; }

/* ===== FORMS ===== */
.form-card  { padding: 24px; }
.form-grup  { margin-bottom: 18px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grup label { display: block; margin-bottom: 6px; font-size: 0.88rem; color: var(--text); font-weight: 500; }
.form-grup input,
.form-grup textarea,
.form-grup select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.9rem;
  transition: border 0.15s;
}
.form-grup input:focus,
.form-grup textarea:focus { outline: none; border-color: var(--primary); }
.form-grup small { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--text-muted); }
.zorunlu { color: var(--red); }
.input-goz { position: relative; }
.input-goz input { padding-right: 44px; }
.goz-btn {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 1rem;
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.json-editor {
  width: 100%;
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  color: #a8ff80;
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
  padding: 16px;
  resize: vertical;
  border-top: none;
}

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.aktif { color: var(--primary); border-bottom-color: var(--primary); }
.tab-icerik { margin-top: 16px; }

/* ===== TABLE ===== */
.tablo { width: 100%; border-collapse: collapse; }
.tablo th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.tablo td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.tablo tr:last-child td { border-bottom: none; }
.tablo tr:hover td { background: var(--bg-input); }
.tablo-aksiyonlar { display: flex; gap: 6px; }

/* ===== LOGS ===== */
.log-kutusu {
  background: #0d0f14;
  border-radius: 0 0 10px 10px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Consolas', monospace;
  font-size: 0.82rem;
  color: #a8ff80;
}
.log-kutusu pre { white-space: pre-wrap; word-break: break-all; }

/* ===== BİLGİ CARD ===== */
.bilgi-card { padding: 20px 24px; }
.bilgi-card h4 { color: var(--text-baslik); margin-bottom: 12px; }
.bilgi-card ol { padding-left: 20px; color: var(--text-muted); }
.bilgi-card li { margin-bottom: 6px; font-size: 0.9rem; }

/* ===== AYAR BÖLÜM ===== */
.ayar-bolum { margin-bottom: 20px; }
.ayar-bolum .form-card { padding: 20px 24px; }

/* ===== TOGGLE SWITCH ===== */
.toggle-satir {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.toggle-baslik {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.toggle-aciklama {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 26px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 4px;
  top: 4px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.35);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.acik { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .toggle-satir { flex-direction: column; align-items: flex-start; }
}
