/* ============================================================
   BONUS LİSTELEME SİSTEMİ — Styles
   Cloudflare Workers / Pages ready
   ============================================================ */

:root {
  /* === TEMA 1: Dark Red (varsayılan) === */
  --bg:        #18181B;
  --surface:   #27272A;
  --surface-2: #3F3F46;
  --line:      rgba(255,255,255,.07);
  --primary:   #EF4444;
  --primary-d: #DC2626;
  --primary-l: #F87171;
  --primary-rgb: 239,68,68;
  --text:      #FFFFFF;
  --text-sec:  #D4D4D8;
  --muted:     #A1A1AA;
  --gold:      #EAB308;
  --shadow:    0 20px 60px rgba(0,0,0,.5);
}

/* Tema değişkenleri JS tarafından applyTheme() ile enjekte edilir.
   Buraya yeni CSS [data-theme] bloğu eklemeye gerek yok. */

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT
   ============================================================ */
#app { min-height: 100vh; }

.page-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(0,0,0,.0);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px 8px;
}

.header-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}

.logo {
  display: flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 900; letter-spacing: .4px;
}
.logo-dot {
  width: 9px; height: 9px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
  flex-shrink: 0;
}
.logo-img { height: 32px; width: auto; object-fit: contain; }

.header-actions { display: flex; gap: 7px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sec); font-size: 15px;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.13); }
.tg-btn {
  background: rgba(39,195,111,.13);
  border-color: rgba(39,195,111,.28);
  color: #2DC96F;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px 8px;
}
.search-pill {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 5px 10px;
  white-space: nowrap; flex-shrink: 0;
  font-size: 11px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: background .15s;
}
.search-pill:hover { background: rgba(255,255,255,.12); }

.divider-v { width: 1px; height: 20px; background: var(--line); flex-shrink: 0; }

.cats {
  display: flex; gap: 5px;
  overflow-x: auto; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }

.cat {
  display: flex; align-items: center; gap: 3px;
  padding: 5px 10px; border-radius: 8px;
  white-space: nowrap; flex-shrink: 0;
  font-size: 11px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
  user-select: none;
}
.cat:hover { color: var(--text-sec); background: rgba(255,255,255,.07); }
.cat.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
}

/* ============================================================
   CONTENT
   ============================================================ */
.content { padding: 10px 10px 0; }

/* ============================================================
   SECTION DIVIDER
   ============================================================ */
.section-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 0 6px;
}
.sdline {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234,179,8,.45));
}
.sdline.right { background: linear-gradient(270deg, transparent, rgba(234,179,8,.45)); }
.sdline.w { background: linear-gradient(90deg, transparent, rgba(255,255,255,.18)); }
.sdline.w.right { background: linear-gradient(270deg, transparent, rgba(255,255,255,.18)); }
.sdline.p { background: linear-gradient(90deg, transparent, rgba(239,68,68,.35)); }
.sdline.p.right { background: linear-gradient(270deg, transparent, rgba(239,68,68,.35)); }

.section-label {
  font-size: 9px; font-weight: 900;
  letter-spacing: 3px; text-transform: uppercase; white-space: nowrap;
}
.section-label.gold { color: rgba(234,179,8,.9); }
.section-label.white { color: rgba(255,255,255,.75); }
.section-label.primary { color: var(--primary-l); }

/* ============================================================
   PREMIUM BANNERS
   ============================================================ */
/* ============================================================
   CAROUSEL (Premium Siteler)
   Her zaman 3 kart görünür — transform ile kayar
   perSlide=1 → 1 kart adım | perSlide=3 → 3'lü blok
   ============================================================ */

/* Dış kapsayıcı — sadece x kırpar, buton aşağı taşabilir */
.cr-wrap {
  position: relative;
  width: 100%;
  overflow-x: clip;    /* sadece yatay keser */
  overflow-y: visible; /* buton aşağı taşsın */
  margin: 4px 0 22px; /* buton için alan */
  touch-action: pan-y;
}

/* Şerit — flex, transform ile kayar */
.cr-track {
  display: flex;
  gap: 10px;
  transition: transform .42s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

/* Kart — her zaman 3 tanesi görünür */
.cr-card {
  flex: 0 0 calc((100% - 20px) / 3);   /* 100% - 2×gap = 3 kart */
  width: calc((100% - 20px) / 3);
  min-height: 148px;
  border-radius: 14px;
  position: relative;
  overflow: visible;           /* buton aşağı taşabilir */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 0;         /* alt padding 0 — buton taşacak */
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
  transition: box-shadow .2s, transform .2s cubic-bezier(.34,1.3,.64,1);
}
.cr-card:hover  { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.cr-card:active { transform: scale(.97); }

/* İç içerik alanı clip'lensin (parlama overlay için) */
.cr-card::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px;
  pointer-events: none; overflow: hidden;
}

/* Overlay parlama */
.cr-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.13) 0%, rgba(0,0,0,.09) 100%);
  pointer-events: none; z-index: 0;
}

/* Shimmer */
.cr-shine {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.1) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: crShine 4s ease infinite;
}
@keyframes crShine { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Rank */
.cr-rank {
  position: absolute; top: 6px; right: 8px;
  font-size: 16px; line-height: 1; z-index: 2;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.6));
}

/* Logo */
.cr-logo {
  width: 100%; height: 40px; flex-shrink: 0;
  background: rgba(255,255,255,.22);
  border-radius: 8px; border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; z-index: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.cr-logo img  { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.cr-logo-text { font-size: 10px; font-weight: 900; color: #fff; letter-spacing: .5px; }

/* Metin */
.cr-body {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 2px;
  position: relative; z-index: 1;
  padding: 6px 4px 4px;
}
.cr-title  { font-size: 9px;  font-weight: 700; color: rgba(255,255,255,.72); text-transform: uppercase; letter-spacing: .6px; }
.cr-amount { font-size: 17px; font-weight: 900; color: #FFD700; text-shadow: 0 2px 10px rgba(0,0,0,.5); line-height: 1.1; }
.cr-desc   { font-size: 8.5px; color: rgba(255,255,255,.6); }

/* Buton — kartın altından taşar */
.cr-btn {
  display: block; width: 80%; text-align: center;
  background: linear-gradient(135deg, #ff6b35, #dc2600);
  color: #fff; font-size: 7.5px; font-weight: 800;
  padding: 6px 6px; border-radius: 20px;
  white-space: nowrap; letter-spacing: .5px; text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  position: relative; z-index: 10;
  margin-bottom: -11px;
  transition: transform .15s, box-shadow .15s;
}
.cr-card:hover .cr-btn { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.55); }

/* Ok butonları */
.cr-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.18);
  color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.cr-arrow:hover { background: rgba(0,0,0,.8); }
.cr-prev { left: 4px; }
.cr-next { right: 4px; }

/* Nokta navigasyon */
.cr-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 8px 0 14px;
}
.cr-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: none; cursor: pointer; padding: 0;
  transition: background .2s, width .25s;
}
.cr-dot.active { background: var(--primary); width: 22px; border-radius: 4px; }

/* Mobil — kartlar biraz küçülür ama 3 tane görünmeye devam eder */
@media (max-width: 480px) {
  .cr-card   { min-height: 130px; padding: 10px 5px 0; border-radius: 11px; }
  .cr-logo   { height: 30px; }
  .cr-amount { font-size: 13px; }
  .cr-desc   { display: none; }
  .cr-btn    { font-size: 7px; padding: 6px 4px; margin-bottom: -11px; }
  .cr-rank   { font-size: 12px; }
  .cr-arrow  { display: none; }
}

/* ============================================================
   BONUS TABLE
   ============================================================ */
.bonus-table {
  background: var(--surface);
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.bonus-row {
  display: flex; align-items: center;
  padding: 2px 8px 2px 0; min-height: 44px;
  border-top: 1px solid var(--line);
  text-decoration: none; color: inherit;
  position: relative; transition: background .12s;
  cursor: pointer;
}
.bonus-row:first-child { border-top: none; }

/* Sol kırmızı aksan */
.bonus-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2.5px;
  background: linear-gradient(180deg, var(--primary), var(--primary-d));
  opacity: 0; transition: opacity .15s;
}
.bonus-row:hover { background: linear-gradient(90deg, rgba(239,68,68,.07), transparent); }
.bonus-row:hover::before { opacity: 1; }
.bonus-row:active { background: rgba(239,68,68,.1); }

/* LOGO */
.site-logo {
  width: 110px; flex-shrink: 0; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border-radius: 8px; margin: 3px 6px 3px 4px; padding: 3px 7px;
  overflow: hidden;
}
.site-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.site-logo-fallback {
  font-size: 9px; font-weight: 800; color: var(--muted);
  text-align: center; line-height: 1.3;
}

/* CENTER INFO */
.bonus-info {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-width: 0; padding: 0 4px;
}
.bonus-amount {
  font-size: 11px; font-weight: 800;
  background: linear-gradient(90deg, #fff, var(--primary-l), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center; width: 100%; line-height: 1.3;
}
.bonus-desc {
  font-size: 9px; color: var(--muted);
  text-align: center; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}

/* PIN icon */
.pin-icon { position: absolute; right: 54px; top: 5px; font-size: 11px; }

/* CTA BUTTON */
.cta-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; font-size: 10px; font-weight: 700;
  height: 32px; padding: 0 10px; border-radius: 8px;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; position: relative; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  transition: box-shadow .15s, transform .1s;
}
.cta-btn:hover { box-shadow: 0 4px 18px rgba(0,0,0,.35); transform: translateY(-1px); }
.cta-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.bonus-row:hover .cta-btn::after { opacity: 1; }

/* ============================================================
   SEARCH MODAL
   ============================================================ */
.search-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column;
}
.search-header {
  padding: 12px 12px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.search-input-wrap {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
}
.search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px;
}
.search-input::placeholder { color: var(--muted); }
.search-close {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sec); cursor: pointer;
}
.search-results { flex: 1; overflow-y: auto; padding: 10px 12px; }
.search-result {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 6px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: background .12s, border-color .12s;
}
.search-result:hover { border-color: rgba(239,68,68,.35); background: var(--surface-2); }
.search-result-logo {
  width: 80px; height: 52px; flex-shrink: 0;
  background: rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}
.search-result-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.search-result-info { flex: 1; padding: 8px 10px; min-width: 0; }
.search-result-amount { font-size: 12px; font-weight: 700; color: var(--primary-l); }
.search-result-desc { font-size: 10px; color: var(--muted); margin-top: 2px; }
.search-result-arrow {
  padding-right: 12px; color: var(--muted); font-size: 14px;
}
.search-count { font-size: 11px; color: var(--muted); padding: 4px 2px 8px; }

/* ============================================================
   POPUP
   ============================================================ */
.popup-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.popup-card-wrap {
  position: relative;
  width: 100%; max-width: 330px;
  animation: popupIn .3s cubic-bezier(.34,1.56,.64,1);
}
.popup-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; width: 100%;
  overflow: hidden; box-shadow: 0 32px 90px rgba(0,0,0,.65);
}
@keyframes popupIn {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* X butonu — kartın dışında sağ üstte yüzen kırmızı daire */
.popup-x {
  position: absolute; top: -12px; right: -12px; z-index: 10;
  width: 30px; height: 30px; border-radius: 50%;
  background: #E53E3E;
  border: 2px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.popup-x:hover { background: #C53030; transform: scale(1.12); box-shadow: 0 6px 20px rgba(0,0,0,.6); }

.popup-header {
  padding: 24px 20px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--primary-d), var(--primary));
}
.popup-badge {
  font-size: 9px; font-weight: 900; letter-spacing: 3px; text-transform: uppercase;
  background: rgba(0,0,0,.25); border-radius: 99px; padding: 4px 12px; color: #fff;
}
.popup-logo-box {
  width: 84px; height: 64px;
  background: rgba(0,0,0,.25); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
}
.popup-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 8px; }
.popup-amount { font-size: 28px; font-weight: 900; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.popup-desc { font-size: 12px; color: rgba(255,255,255,.75); }
.popup-body { padding: 16px 18px 18px; }
.popup-cta {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; font-size: 14px; font-weight: 800;
  border-radius: 12px; text-align: center;
  display: block;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  transition: box-shadow .15s, transform .1s;
}
.popup-cta:hover { box-shadow: 0 8px 28px rgba(0,0,0,.4); transform: translateY(-1px); }

/* ============================================================
   WINNERS TICKER
   ============================================================ */
.ticker-wrap {
  background: var(--surface); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 6px 0; margin-bottom: 8px;
}
.ticker-inner {
  display: flex; gap: 32px;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
.ticker-inner:hover { animation-play-state: paused; }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-sec);
}
.ticker-name { font-weight: 700; }
.ticker-site { color: var(--primary-l); font-weight: 600; }
.ticker-amount { color: #4ADE80; font-weight: 700; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 16px 16px 8px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
.footer-note {
  font-size: 10px; color: var(--muted);
  text-align: center; line-height: 1.6;
}
.footer-links {
  display: flex; justify-content: center; gap: 14px;
  margin-top: 10px; flex-wrap: wrap;
}
.footer-link { font-size: 10px; color: var(--muted); }
.footer-link:hover { color: var(--text-sec); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 1000;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 20px;
  font-size: 13px; font-weight: 600; color: var(--text);
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  animation: toastIn .25s ease;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-layout {
  display: flex; min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 224px; flex-shrink: 0;
  background: #111113;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

/* ── ADMIN MAIN LAYOUT ──────────────────────────────────────── */
.admin-main { flex: 1; overflow: auto; background: var(--bg); }

.admin-topbar {
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 0 24px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-topbar-title { font-size: 16px; font-weight: 700; }
.admin-topbar-right { display: flex; align-items: center; gap: 10px; }
.admin-content { padding: 24px; }

/* ── SIDEBAR (updated) ──────────────────────────────────────── */
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 18px;
}
.sidebar-brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; color: #fff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb),0.35);
  flex-shrink: 0;
}
.sidebar-brand-name { font-size: 14px; font-weight: 800; }
.sidebar-brand-ver  { font-size: 10px; color: var(--muted); margin-top: 1px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-sec);
  background: none; border: none; cursor: pointer;
  transition: background .15s, color .15s;
  text-align: left; width: 100%;
}
.sidebar-nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.sidebar-nav-item.active {
  background: rgba(var(--primary-rgb),0.12); color: var(--primary-l);
}
.sidebar-nav-item.active svg { opacity: 1; color: var(--primary); }
.sidebar-nav-item svg { opacity: .5; flex-shrink: 0; }
.sidebar-footer {
  padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-view-link {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); text-decoration: none;
  padding: 6px 8px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.sidebar-view-link:hover { background: rgba(255,255,255,.05); color: var(--text-sec); }
.sidebar-logout {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 6px 8px;
  border-radius: 8px; transition: background .15s, color .15s;
}
.sidebar-logout:hover { background: rgba(239,68,68,.1); color: #f87171; }

/* ── AP BUTTONS ─────────────────────────────────────────────── */
.ap-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 16px; height: 36px; border-radius: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: background .12s, border-color .12s, transform .1s;
}
.ap-btn:hover { background: var(--surface-2); }
.ap-btn:active { transform: scale(.97); }
.ap-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb),.3);
}
.ap-btn-primary:hover { box-shadow: 0 6px 20px rgba(var(--primary-rgb),.45); }
.ap-btn-lg { height: 44px; padding: 0 24px; font-size: 14px; border-radius: 11px; }

/* ── DASHBOARD ──────────────────────────────────────────────── */
.ap-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 28px; }
.ap-stat-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px; transition: border-color .15s;
}
.ap-stat-card:hover { border-color: rgba(255,255,255,.12); }
.ap-stat-icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ap-stat-value { font-size: 28px; font-weight: 900; line-height: 1; }
.ap-stat-label { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ap-section-title {
  font-size: 14px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.ap-actions-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 24px; }
.ap-action-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-sec);
  transition: border-color .15s, transform .15s; text-decoration: none;
}
.ap-action-card:hover { border-color: rgba(var(--primary-rgb),.3); transform: translateY(-3px); }
.ap-action-icon { font-size: 28px; }

/* ── LIST CARD ──────────────────────────────────────────────── */
.ap-list-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
}
.ap-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background .1s;
}
.ap-list-row:last-child { border-bottom: none; }
.ap-list-row:hover { background: rgba(255,255,255,.025); }
.ap-list-order {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.ap-list-logo {
  width: 44px; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.ap-list-logo img { max-width: 40px; max-height: 24px; object-fit: contain; }
.ap-list-info { flex: 1; min-width: 0; }
.ap-list-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-list-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ap-logo-fb {
  width: 44px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, var(--primary-d), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff;
}

/* ── DRAG LIST ──────────────────────────────────────────────── */
.ap-drag-list { display: flex; flex-direction: column; gap: 8px; }
.ap-drag-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
.ap-drag-item:hover { border-color: rgba(255,255,255,.12); }
.ap-drag-item.dragging { opacity: .5; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.ap-drag-item.drag-over { border-color: var(--primary); background: rgba(var(--primary-rgb),.07); }
.ap-drag-handle {
  cursor: grab; color: var(--muted); flex-shrink: 0;
  padding: 4px; border-radius: 6px; transition: color .15s;
}
.ap-drag-handle:hover { color: var(--text-sec); }
.ap-drag-handle:active { cursor: grabbing; }
.ap-item-order {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.ap-item-preview {
  width: 72px; height: 40px; border-radius: 8px;
  background: rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.ap-item-preview img { max-width: 64px; max-height: 32px; object-fit: contain; }
.ap-item-info { flex: 1; min-width: 0; }
.ap-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-item-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ap-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ap-color-dot {
  width: 22px; height: 22px; border-radius: 7px;
  border: 2px solid rgba(255,255,255,.1); flex-shrink: 0;
}

/* ── BADGES ─────────────────────────────────────────────────── */
.ap-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.ap-badge-green  { background: rgba(74,222,128,.15);  color: #4ade80; }
.ap-badge-red    { background: rgba(239,68,68,.15);   color: #f87171; }
.ap-badge-purple { background: rgba(168,85,247,.15);  color: #c084fc; }

/* ── ICON BUTTONS ───────────────────────────────────────────── */
.ap-icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sec); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.ap-icon-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }
.ap-icon-btn.danger:hover { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.3); color: #f87171; }

/* ── FORM CARD ──────────────────────────────────────────────── */
.ap-form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; margin-bottom: 16px;
}
.ap-form-title {
  font-size: 15px; font-weight: 700; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.ap-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-form-footer { margin-top: 18px; display: flex; gap: 10px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.form-input, .form-select, .form-textarea {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 12px;
  color: var(--text); font-size: 13px;
  transition: border-color .15s; outline: none; width: 100%; box-sizing: border-box;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb),.15);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }

/* ── SETTINGS ───────────────────────────────────────────────── */
.ap-settings-form { display: flex; flex-direction: column; gap: 20px; }
.ap-settings-section {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px;
}
.ap-settings-section-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.ap-settings-save { display: flex; justify-content: flex-end; padding: 4px 0 16px; }

/* ── Tema Seçici ──────────────────────────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
@media (max-width: 900px) { .theme-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .theme-grid { grid-template-columns: repeat(3, 1fr); } }

.theme-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  background: var(--surface-2); border: 2px solid var(--line);
  border-radius: 12px; padding: 0;
  cursor: pointer; position: relative; transition: all .18s;
  text-align: center; overflow: hidden;
}
.theme-card:hover { border-color: rgba(255,255,255,.28); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.3); }

.theme-card-preview {
  width: 100%; padding: 10px 10px 8px;
  min-height: 64px; display: flex; flex-direction: column; justify-content: center;
}
.theme-card-bottom {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 6px 6px;
  background: rgba(0,0,0,.2);
  border-top: 1px solid rgba(255,255,255,.06);
}
.theme-card-emoji { font-size: 13px; }
.theme-card-label {
  font-size: 10px; font-weight: 600; color: var(--text-sec);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.theme-card-check {
  font-size: 11px; font-weight: 900; color: var(--primary);
  margin-left: auto;
}
.theme-card-id {
  display: block; font-size: 9px; color: var(--muted);
  padding: 3px 6px 5px; background: rgba(0,0,0,.15);
  letter-spacing: .3px;
}
.ap-color-row { display: flex; align-items: center; gap: 8px; }
.ap-color-input {
  width: 42px; height: 42px; border-radius: 9px;
  border: 2px solid var(--line); cursor: pointer; flex-shrink: 0; padding: 2px;
}
.ap-color-text { flex: 1; }
.ap-logo-preview {
  margin-top: 10px; padding: 12px;
  background: rgba(0,0,0,.3); border-radius: 10px; text-align: center;
}
.ap-logo-preview img { max-width: 120px; max-height: 40px; object-fit: contain; }

/* ── Logo Tab ────────────────────────────────────────────── */
.logo-tab-wrap { display: flex; flex-direction: column; gap: 8px; }
.logo-tab-btns { display: flex; gap: 6px; }
.logo-tab-btn {
  padding: 5px 14px; border-radius: 7px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05); color: var(--text-sec); font-size: 12px;
  font-weight: 500; cursor: pointer; transition: all .15s;
}
.logo-tab-btn.active {
  background: rgba(var(--primary-rgb),.2); border-color: var(--primary);
  color: var(--primary);
}
.logo-tab-panel { width: 100%; }
.logo-upload-area {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 18px 12px; border-radius: 10px; cursor: pointer;
  border: 2px dashed rgba(255,255,255,.15); background: rgba(255,255,255,.03);
  color: var(--text-sec); font-size: 13px; text-align: center; transition: all .15s;
}
.logo-upload-area:hover { border-color: var(--primary); background: rgba(var(--primary-rgb),.07); color: var(--primary); }
.logo-upload-area small { font-size: 11px; opacity: .6; }
.logo-preview-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(0,0,0,.25); border-radius: 8px;
}
.ap-checkbox-label {
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; font-size: 13px; color: var(--text-sec);
  background: rgba(168,85,247,.08); border: 1px solid rgba(168,85,247,.25);
  border-radius: 9px; padding: 10px 14px; transition: border-color .15s;
}
.ap-checkbox-label:hover { border-color: rgba(168,85,247,.5); }
.ap-checkbox-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ── MODAL ──────────────────────────────────────────────────── */
.ap-modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ap-modal {
  background: #1c1c21; border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: modalIn .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.ap-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.ap-modal-title { font-size: 17px; font-weight: 700; }
.ap-modal-close {
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.ap-modal-close:hover { background: rgba(239,68,68,.15); color: #f87171; }
.ap-modal-body { padding: 22px 24px; }
.ap-modal-body .ap-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-modal-body .form-group.full { grid-column: 1 / -1; }
.ap-modal-footer {
  padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.ap-empty {
  text-align: center; padding: 60px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}
.ap-empty-icon { font-size: 48px; margin-bottom: 12px; }
.ap-empty p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

/* ── LOGIN (updated) ────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 20px; background: var(--bg);
}
.login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 36px; width: 100%; max-width: 360px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.login-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.login-logo-mark {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 24px; color: #fff;
  box-shadow: 0 8px 20px rgba(var(--primary-rgb),.4);
}
.login-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; text-align: center; }
.login-sub   { font-size: 13px; color: var(--muted); margin-bottom: 24px; text-align: center; }
.login-error { color: #f87171; font-size: 12px; margin-top: 10px; display: none; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .ap-stats-grid { grid-template-columns: 1fr 1fr; }
  .ap-actions-grid { grid-template-columns: 1fr 1fr; }
  .ap-form-grid, .ap-modal-body .ap-form-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 16px; }
  .ap-drag-item { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .ap-stats-grid { grid-template-columns: 1fr; }

}

/* ============================================================
   BOTTOM NAV BAR
   ============================================================ */
.bnav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  z-index: 200;

  background: rgba(14, 14, 16, 0.94);
  backdrop-filter: blur(32px) saturate(2);
  -webkit-backdrop-filter: blur(32px) saturate(2);
  border-top: 1px solid rgba(255,255,255,.06);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.4);

  display: flex; align-items: flex-start;
  padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
}

.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 0 2px;
  cursor: pointer; text-decoration: none; color: inherit;
  background: none; border: none; outline: none;
  user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .15s cubic-bezier(.34,1.4,.64,1);
  position: relative;
}
.bnav-item:active { transform: scale(.82); }

/* İkon pill — sadece aktifde renkli */
.bnav-icon {
  width: 52px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  transition: background .2s;
}
.bnav-icon svg {
  width: 18px; height: 18px;
  color: rgba(255,255,255,.3);
  transition: color .2s;
  flex-shrink: 0;
}

/* Aktif: pill arka planı + renkli ikon */
.bnav-item.active .bnav-icon {
  background: rgba(var(--primary-rgb, 239,68,68), .18);
}
.bnav-item.active .bnav-icon svg { color: var(--primary); }
.bnav-item.active .bnav-label    { color: var(--primary); }

.bnav-item:not(.active):hover .bnav-icon svg { color: rgba(255,255,255,.55); }

.bnav-label {
  font-size: 9px; font-weight: 600;
  color: rgba(255,255,255,.25);
  white-space: nowrap; letter-spacing: .1px;
  transition: color .2s;
}

/* Plus — kırmızı pill */
.bnav-item.plus .bnav-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  box-shadow: 0 3px 14px rgba(0,0,0,.35);
}
.bnav-item.plus .bnav-icon svg { color: #fff; }
.bnav-item.plus .bnav-label    { color: var(--primary-l); }
.bnav-item.plus.active .bnav-icon { background: linear-gradient(135deg, var(--primary), var(--primary-d)); }

/* Telegram */
.bnav-item.tg .bnav-icon svg { color: rgba(45,201,111,.55); }
.bnav-item.tg .bnav-label    { color: rgba(45,201,111,.45); }
.bnav-item.tg.active .bnav-icon { background: rgba(45,201,111,.15); }
.bnav-item.tg.active .bnav-icon svg { color: #2DC96F; }
.bnav-item.tg.active .bnav-label    { color: #2DC96F; }

/* Rozet */
.bnav-badge {
  position: absolute; top: -2px; right: calc(50% - 26px - 4px);
  background: var(--primary); color: #fff;
  font-size: 7px; font-weight: 900;
  min-width: 14px; height: 14px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 1.5px solid rgba(14,14,16,.94);
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
