/* ==========================================================================
   Gerilla TV — Yönetici Paneli Stilleri
   ========================================================================== */

/* --------------------------------------------------------------------------
   Uygulama İskeleti
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: rgba(6, 8, 15, 0.76);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--stroke);
}
.app-header .brand { display: flex; align-items: center; gap: 12px; }
.app-header .brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 19px; background: linear-gradient(135deg, var(--brand-red), var(--brand-amber-soft));
  box-shadow: var(--shadow-red);
}
.app-header .brand-name { font-weight: 800; font-size: 0.98rem; line-height: 1.1; }
.app-header .brand-sub { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.app-main { max-width: 1240px; margin: 0 auto; padding: 26px 22px 70px; }

/* --------------------------------------------------------------------------
   İstatistik Kartları
   -------------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--radius-lg); padding: 20px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: transform var(--t), border-color var(--t);
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--stroke-strong); }
.stat-card .ic {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-size: 18px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke);
}
.stat-card .label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-card .value { font-size: 2rem; font-weight: 800; margin-top: 8px; line-height: 1; }
.stat-card .delta { font-size: 0.76rem; margin-top: 8px; color: var(--muted); }
.stat-card.accent-red .value { background: linear-gradient(135deg, var(--brand-red-soft), var(--brand-amber-soft)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-card.accent-green .value { background: linear-gradient(135deg, var(--brand-green-soft), var(--brand-blue)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-card.accent-amber .value { background: linear-gradient(135deg, var(--brand-amber-soft), #fff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* --------------------------------------------------------------------------
   Bölüm Başlıkları
   -------------------------------------------------------------------------- */
.sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.98rem; font-weight: 700; margin: 32px 0 16px;
}
.sec-title::before { content: ""; width: 4px; height: 18px; border-radius: 3px; background: linear-gradient(var(--brand-red), var(--brand-amber-soft)); }
.sec-title .count { font-size: 0.76rem; color: var(--muted); font-weight: 500; }

/* --------------------------------------------------------------------------
   Grafikler (saf CSS/SVG)
   -------------------------------------------------------------------------- */
.chart-card { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 22px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; margin-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-col .bar {
  width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--brand-amber-soft), var(--brand-red));
  min-height: 4px; transition: height 0.7s var(--ease);
  position: relative;
}
.bar-col .bar:hover::after {
  content: attr(data-val); position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  background: var(--surface-solid); border: 1px solid var(--stroke-strong);
  padding: 3px 8px; border-radius: 7px; font-size: 0.72rem; white-space: nowrap;
}
.bar-col .lbl { font-size: 0.68rem; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Halka (donut) grafik */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex-shrink: 0; }
.donut circle { fill: none; stroke-width: 16; stroke-linecap: round; }
.donut .track { stroke: rgba(255, 255, 255, 0.07); }
.donut .val { stroke: url(#donutGrad); transition: stroke-dashoffset 0.8s var(--ease); }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-legend .li { display: flex; align-items: center; gap: 9px; font-size: 0.86rem; }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 4px; }

/* --------------------------------------------------------------------------
   Aktif Sohbet Kartı
   -------------------------------------------------------------------------- */
.chat-card {
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--radius-lg); padding: 20px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  animation: rise var(--t-slow) var(--ease) both;
}
.chat-head { display: flex; align-items: center; gap: 13px; }
.chat-head .cover {
  width: 56px; height: 56px; border-radius: 13px; object-fit: cover; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(225,29,46,0.3), rgba(245,158,11,0.25));
  display: grid; place-items: center; font-size: 22px;
}
.chat-head .meta { flex: 1; min-width: 0; }
.chat-head .meta .t { font-weight: 700; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .meta .s { font-size: 0.8rem; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-id { font-size: 0.7rem; color: var(--muted); background: rgba(255,255,255,0.05); padding: 4px 9px; border-radius: 8px; font-family: var(--font-mono); }
.chat-meta-row { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin: 14px 0 7px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.queue-list { margin-top: 16px; border-top: 1px solid var(--stroke); padding-top: 8px; }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 0.84rem; border-bottom: 1px solid var(--stroke); }
.queue-item:last-child { border-bottom: none; }
.queue-item .idx { width: 20px; color: var(--muted-2); font-family: var(--font-mono); font-size: 0.76rem; }
.queue-item .qt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item .qr { color: var(--muted); font-size: 0.74rem; }

/* --------------------------------------------------------------------------
   Sıralama Listesi
   -------------------------------------------------------------------------- */
.rank-list { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius-lg); padding: 20px; }
.rank-item { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--stroke); }
.rank-item:last-child { border-bottom: none; }
.rank-no {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 800; background: rgba(255, 255, 255, 0.06); flex-shrink: 0;
}
.rank-no.top { background: linear-gradient(135deg, var(--brand-red), var(--brand-amber-soft)); color: #fff; }
.rank-item .rt { flex: 1; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item .rv { font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   İki Sütun Yerleşim
   -------------------------------------------------------------------------- */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .cols-2 { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Boş Durum
   -------------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state .ic { font-size: 2.6rem; margin-bottom: 14px; opacity: 0.6; }
.empty-state p { font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Giriş Sayfası
   -------------------------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 410px;
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--radius-xl); padding: 38px 32px 30px;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-lg);
  animation: rise 0.6s var(--ease) both;
}
.login-logo {
  width: 70px; height: 70px; margin: 0 auto 20px; border-radius: 20px;
  display: grid; place-items: center; font-size: 32px;
  background: linear-gradient(135deg, var(--brand-red), var(--brand-amber-soft));
  box-shadow: var(--shadow-red);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow-red); }
  50% { transform: scale(1.05); box-shadow: 0 18px 48px rgba(225, 29, 46, 0.6); }
}
.login-card h1 { font-size: 1.35rem; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 0.86rem; margin: 9px 0 28px; }
.login-error {
  margin-top: 16px; padding: 12px 15px; border-radius: var(--radius-sm);
  background: rgba(225, 29, 46, 0.12); border: 1px solid rgba(225, 29, 46, 0.36);
  color: #ffb4b4; font-size: 0.84rem; text-align: center; display: none;
}
.login-error.show { display: block; animation: shake 0.4s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.login-foot { text-align: center; color: var(--muted); font-size: 0.74rem; margin-top: 24px; }
.login-foot b { color: var(--brand-amber-soft); }

/* --------------------------------------------------------------------------
   Sekmeler
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 9px 16px; border-radius: var(--radius-pill); font-size: 0.86rem; font-weight: 600;
  color: var(--muted); border: 1px solid transparent; transition: all var(--t-fast);
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tab.active { color: #fff; background: linear-gradient(135deg, var(--brand-red), var(--brand-amber-soft)); box-shadow: var(--shadow-red); }

/* --------------------------------------------------------------------------
   Dil Seçici
   -------------------------------------------------------------------------- */
.lang-select {
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke);
  color: var(--text); font-size: 0.84rem; font-weight: 600; cursor: pointer;
}
:root[data-theme="light"] .lang-select { background: rgba(15, 23, 42, 0.04); }
.lang-select option { background: var(--surface-solid); color: var(--text); }

/* --------------------------------------------------------------------------
   Araç Çubuğu (toolbar)
   -------------------------------------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-view { animation: fade var(--t) var(--ease) both; }

/* --------------------------------------------------------------------------
   Çalma Geçmişi
   -------------------------------------------------------------------------- */
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--stroke);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.hist-item:hover { border-color: var(--stroke-strong); transform: translateX(3px); }
.hi-ic { font-size: 1.2rem; }
.hi-main { flex: 1; min-width: 0; }
.hi-t { font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-s { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 0.74rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }

/* --------------------------------------------------------------------------
   Canlı Log Görünümü
   -------------------------------------------------------------------------- */
.log-view {
  background: #05070d; border: 1px solid var(--stroke); border-radius: var(--radius);
  padding: 14px; height: 460px; overflow-y: auto;
  font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.55;
}
.log-line { display: flex; gap: 10px; padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.log-line .lt { color: #64748b; flex-shrink: 0; }
.log-line .ll { flex-shrink: 0; width: 62px; font-weight: 700; }
.log-line .lm { color: #cbd5e1; word-break: break-word; }
.log-line.lvl-error .ll, .log-line.lvl-critical .ll { color: #ff6b6b; }
.log-line.lvl-warning .ll { color: #f59e0b; }
.log-line.lvl-info .ll { color: #38bdf8; }
.log-line.lvl-debug .ll { color: #94a3b8; }
/* Açık tema: log görünümü de açık olur, metin renkleri koyulaşır. */
:root[data-theme="light"] .log-view { background: #f8fafc; }
:root[data-theme="light"] .log-line { border-bottom-color: rgba(15, 23, 42, 0.06); }
:root[data-theme="light"] .log-line .lt { color: #94a3b8; }
:root[data-theme="light"] .log-line .lm { color: #1e293b; }
:root[data-theme="light"] .log-line.lvl-error .ll,
:root[data-theme="light"] .log-line.lvl-critical .ll { color: #dc2626; }
:root[data-theme="light"] .log-line.lvl-warning .ll { color: #b45309; }
:root[data-theme="light"] .log-line.lvl-info .ll { color: #0284c7; }
:root[data-theme="light"] .log-line.lvl-debug .ll { color: #64748b; }

/* --------------------------------------------------------------------------
   Bildirimler
   -------------------------------------------------------------------------- */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  padding: 13px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--stroke);
  border-left: 3px solid var(--info);
}
.notif-item.lvl-warn { border-left-color: var(--warn); }
.notif-item.lvl-error { border-left-color: var(--err); }
.notif-item.lvl-ok { border-left-color: var(--ok); }
.ni-t { font-size: 0.9rem; font-weight: 600; }
.ni-s { font-size: 0.74rem; margin-top: 4px; }

/* --------------------------------------------------------------------------
   Mobil
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .app-header { padding: 0 14px; gap: 8px; }
  .app-header .brand-sub { display: none; }
  .app-main { padding: 18px 14px 60px; }
  .stat-card .value { font-size: 1.6rem; }
}

/* --------------------------------------------------------------------------
   Açık Tema İnce Ayarları (Light Theme Overrides)
   Koyu tema için sabitlenmiş (hardcoded) renkleri açık temada düzeltir.
   -------------------------------------------------------------------------- */
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .rank-no,
:root[data-theme="light"] .badge,
:root[data-theme="light"] .stat-card .ic {
  background: rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .donut .track { stroke: rgba(15, 23, 42, 0.10); }
:root[data-theme="light"] .tab:hover { background: rgba(15, 23, 42, 0.06); }
:root[data-theme="light"] .tab.active { color: #fff; }
:root[data-theme="light"] .rank-no.top { color: #fff; }
:root[data-theme="light"] .badge-red { color: #b91c1c; }
:root[data-theme="light"] .btn-danger { color: #b91c1c; }
:root[data-theme="light"] .login-error { color: #b91c1c; background: rgba(225, 29, 46, 0.08); }
:root[data-theme="light"] .notif-item { background: var(--surface-solid); }
:root[data-theme="light"] .hist-item { background: var(--surface-solid); }
:root[data-theme="light"] .chat-card,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .chart-card { background: var(--surface-solid); }
:root[data-theme="light"] .login-card { background: var(--surface-solid); }
:root[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: var(--stroke);
}
:root[data-theme="light"] .mobile-menu { background: var(--surface-solid); }
/* Amber gradyanı açık temada beyazla bitiyordu → görünmez oluyordu. */
:root[data-theme="light"] .stat-card.accent-amber .value {
  background: linear-gradient(135deg, #b45309, var(--brand-red));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
