/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #0a0a0a;
  color: #f0f0f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Değişkenler ── */
:root {
  --accent: #e50914;
  --nav-h: 52px;
  --bot-h: 58px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* ══════════════════════════════════════════
   NAV
══════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: calc(var(--nav-h) + var(--sat));
  padding-top: var(--sat);
  background: rgba(10,10,10,.97);
  border-bottom: 1px solid #1c1c1c;
  display: flex; align-items: center; gap: 10px;
  padding-left: 12px; padding-right: 12px;
}
.nav-logo {
  font-size: 1.3rem; font-weight: 900;
  color: var(--accent); letter-spacing: -1px;
  flex-shrink: 0;
}
.nav-links {
  display: none;
  align-items: center; gap: 4px;
  flex-shrink: 0;
}
.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.55);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.on { color: var(--accent); }
@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-icon-btn {
  flex-shrink: 0;
  background: rgba(229,9,20,.12);
  border: 1px solid rgba(229,9,20,.25);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 15px;
  line-height: 1;
}

/* ══════════════════════════════════════════
   BOTTOM NAV (mobil)
══════════════════════════════════════════ */
.bnav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: rgba(10,10,10,.98);
  border-top: 1px solid #1e1e1e;
  padding-bottom: var(--sab);
}
/* Wrapper — sadece yüksekliği taşır */
.bnav-inner {
  display: flex;
  align-items: stretch;
  height: var(--bot-h);
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: rgba(255,255,255,.28);
  font-size: 10px; font-weight: 600; letter-spacing: .2px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s;
  padding: 0 4px;
}
.bnav-item.on  { color: var(--accent); }
.bnav-item svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; display: block; }
.bnav-item span { display: block; line-height: 1; }

@media (max-width: 767px) {
  .bnav { display: flex; flex-direction: column; }
  body  { padding-bottom: calc(var(--bot-h) + var(--sab)); }
  /* Mobilde üst nav'ı gizle — sidebar hamburger yeterli */
  .nav { display: none !important; }
  .page { padding-top: var(--sat) !important; }
}

/* ══════════════════════════════════════════
   SAYFA WRAPPER
══════════════════════════════════════════ */
.page { padding-top: calc(var(--nav-h) + var(--sat)); min-height: 100vh; }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  position: relative;
  height: 52vw; max-height: 340px; min-height: 180px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,.9) 0%, rgba(0,0,0,.2) 55%, transparent 100%),
    linear-gradient(to top,   rgba(0,0,0,.85) 0%, transparent 55%);
}
.hero-body {
  position: relative; z-index: 2;
  height: 100%; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 14px;
}
.hero-badge {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 3px; text-transform: uppercase;
  margin-bottom: 5px; width: fit-content;
}
.hero-title {
  font-size: clamp(14px, 4vw, 22px);
  font-weight: 900; line-height: 1.2; margin-bottom: 10px;
  text-shadow: 0 1px 6px rgba(0,0,0,.9);
}
.hero-btns { display: flex; gap: 8px; }

/* ══════════════════════════════════════════
   BUTONLAR
══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: none; border-radius: 8px; font-size: 12px; font-weight: 700;
  padding: 8px 16px; cursor: pointer;
  transition: opacity .15s;
}
.btn:active { opacity: .75; }
.btn-red  { background: var(--accent); color: #fff; }
.btn-dark { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.15); }
.btn-sm   { padding: 6px 12px; font-size: 11px; }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════
   SECTION
══════════════════════════════════════════ */
.section { padding: 0 12px 28px;  margin: 0 auto; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 12px;
}
.section-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}
.section-title::before {
  content: ''; display: block;
  width: 3px; height: 15px;
  background: var(--accent); border-radius: 2px;
}
.section-more { font-size: 11px; color: #666; }
.section-count { font-size: 11px; color: #888; margin-left: auto; }

/* ── Alt tab çubuğu (tab seçiliyken) ── */
.tab-bar-bottom {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(15,15,15,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #2a2a2a;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 200;
}
.tbb-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; font-size: 18px; text-decoration: none;
  color: #666; min-width: 60px;
}
.tbb-item span { font-size: 10px; color: #666; }
.tbb-item.on, .tbb-item.on span { color: var(--accent); }

/* Sayfa içeriğini alttaki çubuktan koru */
body:has(.tab-bar-bottom) .page { padding-bottom: 72px; }

/* ══════════════════════════════════════════
   YATAY SCROLL ŞERIDI
══════════════════════════════════════════ */
.hrow {
  display: flex; gap: 9px;
  overflow-x: auto; overflow-y: visible;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.hrow::-webkit-scrollbar { display: none; }

/* ══════════════════════════════════════════
   KART (poster)
══════════════════════════════════════════ */
.card {
  display: block;
  flex-shrink: 0;
  width: 110px;
  scroll-snap-align: start;
  border-radius: 9px;
  overflow: hidden;
  background: #111;
  position: relative;
}
.card-wide { width: 140px; }

/* Grid içinde kart — full genişlik */
.card-grid { width: 100%; flex-shrink: 1; }

.card-poster {
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #1a1a1a;
  position: relative;
}
.card-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Resim yüklenene kadar görsel */
.card-poster img[src=""],
.card-poster img:not([src]) {
  visibility: hidden;
}
.card-ep {
  position: absolute; bottom: 5px; right: 5px;
  background: rgba(0,0,0,.75);
  color: #ffd700; font-size: 9px; font-weight: 700;
  padding: 2px 5px; border-radius: 3px;
}
.card-new {
  position: absolute; top: 5px; left: 5px;
  background: var(--accent); color: #fff;
  font-size: 8px; font-weight: 800;
  padding: 1px 5px; border-radius: 3px;
  text-transform: uppercase;
}
.card-play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.card-play-icon {
  width: 32px; height: 32px;
  background: rgba(229,9,20,.85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; padding-left: 2px;
}
.card-info { padding: 7px 8px 9px; }
.card-name {
  font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-sub { font-size: 10px; color: #666; margin-top: 2px; }

/* ══════════════════════════════════════════
   GRID (browse)
══════════════════════════════════════════ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 420px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(5, 1fr); gap: 10px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1100px){ .grid { grid-template-columns: repeat(8, 1fr); } }

/* ══════════════════════════════════════════
   DİZİ DETAY
══════════════════════════════════════════ */
.detail-hero {
  position: relative;
  padding-top: var(--nav-h);
}
.detail-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(3px) brightness(.3);
}
.detail-inner {
  position: relative; z-index: 1;
  display: flex; gap: 14px; padding: 16px;
  align-items: flex-end; min-height: 220px;
}
.detail-poster {
  width: 90px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,.8);
}
@media (min-width: 480px) { .detail-poster { width: 120px; } }
.detail-poster img { width: 100%; display: block; }
.detail-info { flex: 1; min-width: 0; }
.detail-title {
  font-size: clamp(15px, 3.5vw, 22px);
  font-weight: 900; line-height: 1.2; margin-bottom: 7px;
}
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.tag {
  background: rgba(255,255,255,.1);
  color: #aaa; font-size: 10px;
  padding: 3px 8px; border-radius: 20px;
}
.tag-r { background: rgba(229,9,20,.15); color: #ff7070; }
.detail-btns { display: flex; gap: 7px; flex-wrap: wrap; }
.detail-desc {
  font-size: 13px; color: #777; line-height: 1.6;
  padding: 14px 12px; border-bottom: 1px solid #181818;
}

/* ══════════════════════════════════════════
   BÖLÜM GRID
══════════════════════════════════════════ */
.ep-wrap {
  padding: 14px 14px 20px;
}
.ep-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}
@media (min-width: 380px) { .ep-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 460px) { .ep-grid { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 600px) { .ep-grid { grid-template-columns: repeat(10, 1fr); gap: 8px; } }
@media (min-width: 900px) { .ep-grid { grid-template-columns: repeat(14, 1fr); } }

.ep-btn {
  aspect-ratio: 1;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 9px;
  color: #bbb;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s;
  min-width: 0;           /* grid taşmasını önler */
  width: 100%;
}
.ep-btn:active, .ep-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ep-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ══════════════════════════════════════════
   PLAYER
══════════════════════════════════════════ */
.player-page { background: #000; min-height: 100vh; padding-top: var(--nav-h); }

.player-box {
  width: 100%; background: #000; position: relative;
}
.player-box video {
  width: 100%; display: block;
  max-height: calc(100svh - var(--nav-h) - var(--bot-h) - 50px);
  object-fit: contain; background: #000;
  /* Mobilde dikey, masaüstünde yatay */
  aspect-ratio: 9/16;
}
@media (min-width: 600px) {
  .player-box video { aspect-ratio: 16/9; max-height: 56vh; }
}

.ep-scrollbar {
  display: flex; gap: 6px;
  overflow-x: auto; padding: 10px 12px;
  background: #0f0f0f; border-bottom: 1px solid #1a1a1a;
  scroll-snap-type: x mandatory;
}
.ep-scrollbar::-webkit-scrollbar { display: none; }
.ep-pill {
  flex-shrink: 0; scroll-snap-align: start;
  padding: 5px 12px; border-radius: 20px;
  background: #1a1a1a; border: 1px solid #252525;
  color: #888; font-size: 11px; font-weight: 600;
}
.ep-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.player-info { padding: 12px; }
.player-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.player-sub   { font-size: 12px; color: #666; margin-bottom: 12px; }
.player-btns  { display: flex; gap: 8px; flex-wrap: wrap; }

/* ══════════════════════════════════════════
   SHORTS FEED
══════════════════════════════════════════ */
.sf {
  height: calc(100svh - var(--nav-h));
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
.sf::-webkit-scrollbar { display: none; }

.si {
  height: calc(100svh - var(--nav-h));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative; overflow: hidden;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.si video {
  width: 100%; height: 100%;
  object-fit: contain; background: #000;
}

/* Shorts — alt gradient + bilgi */
.si-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 50%);
}
.si-info {
  position: absolute; bottom: 0; left: 0; right: 64px;
  padding: 20px 12px 16px; z-index: 5; pointer-events: none;
}
.si-ep   { display: inline-block; background: var(--accent); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 3px; margin-bottom: 5px; }
.si-name { font-size: 13px; font-weight: 700; margin-bottom: 3px; pointer-events: all; }
.si-meta { font-size: 11px; color: rgba(255,255,255,.6); }

/* Shorts — sağ butonlar */
.si-actions {
  position: absolute; right: 8px; bottom: 80px;
  display: flex; flex-direction: column; gap: 16px; z-index: 5;
}
.si-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: #fff;
}
.si-btn-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,.15); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  border: 1px solid rgba(255,255,255,.2);
}
.si-btn span { font-size: 10px; color: rgba(255,255,255,.8); }

/* Tap overlay */
.si-tap {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
}
.si-pause-icon {
  width: 64px; height: 64px;
  background: rgba(0,0,0,.5); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.si-pause-icon.show { opacity: 1; }

/* Yükleniyor shimmer */
.shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #111 25%, #1c1c1c 50%, #111 75%);
  background-size: 200% 100%;
  animation: sh 1.5s infinite;
}
@keyframes sh { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ══════════════════════════════════════════
   ARAMA + FORM
══════════════════════════════════════════ */
.search-input {
  width: 100%; background: #1a1a1a; border: 1px solid #2a2a2a;
  color: #f0f0f0; font-size: 14px; padding: 11px 14px;
  border-radius: 10px; outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════
   PAGİNATİON
══════════════════════════════════════════ */
.pages {
  display: flex; gap: 5px; justify-content: center;
  flex-wrap: wrap; padding: 20px 12px;
}
.pages a, .pages span {
  min-width: 36px; padding: 7px 11px;
  border-radius: 7px; background: #1a1a1a;
  border: 1px solid #222; color: #777;
  font-size: 12px; text-align: center;
}
.pages a:active { opacity: .7; }
.pages .on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ══════════════════════════════════════════
   ADMIN PREMIUM UI
══════════════════════════════════════════ */
body.admin-body { display: flex; min-height: 100vh; background: #080808; margin: 0; padding: 0; font-family: 'Outfit', sans-serif; overflow-x: hidden; }
.admin-sidebar {
  width: 260px; background: #111; border-right: 1px solid #1c1c1c;
  display: flex; flex-direction: column; padding: 32px 16px 20px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.asb-logo { font-size: 26px; font-weight: 900; background: linear-gradient(90deg, #ff2530, #e50914); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 40px; padding: 0 12px; letter-spacing: -1px; }
.asb-menu { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.asb-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  color: #888; font-size: 15px; font-weight: 600; border-radius: 12px;
  transition: all 0.2s ease; text-decoration: none; border-left: 3px solid transparent;
}
.asb-item:hover { color: #fff; background: rgba(255,255,255,0.05); transform: translateX(2px); }
.asb-item.on { color: #fff; background: linear-gradient(90deg, rgba(229,9,20,0.15) 0%, transparent 100%); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; }

.admin-main { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; }
.admin-header { padding: 32px 48px 16px; display: flex; justify-content: space-between; align-items: center; }
.admin-title { font-size: 28px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.admin-content { padding: 0 48px 48px; flex: 1; }

.fg { margin-bottom: 18px; }
.fg label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.fc {
  width: 100%; background: #161616; border: 1px solid #2a2a2a;
  color: #fff; padding: 12px 16px; border-radius: 10px;
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.fc:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229,9,20,0.1); }
textarea.fc { min-height: 100px; resize: vertical; }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 24px; font-size: 14px; font-weight: 500; }
.alert-ok  { background: rgba(0,200,80,.1); color: #0f0; border: 1px solid rgba(0,200,80,.2); }
.alert-err { background: rgba(229,9,20,.1); color: #ff7070; border: 1px solid rgba(229,9,20,.2); }

.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th, .tbl td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #1a1a1a; }
.tbl th { color: #888; background: #121212; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.tbl th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.tbl th:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }

.acard { background: #121212; border: 1px solid #1f1f1f; border-radius: 14px; padding: 24px; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .admin-sidebar { width: 220px; padding: 24px 12px; } .admin-header, .admin-content { padding: 24px; } }
@media (max-width: 600px) { body.admin-body { flex-direction: column; } .admin-sidebar { width: 100%; height: auto; position: static; padding: 16px; border-right: none; border-bottom: 1px solid #1c1c1c; } .asb-logo { margin-bottom: 16px; text-align: left; } .asb-menu { gap: 4px; } }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: #080808; }
.login-box { background: #121212; border: 1px solid #1f1f1f; border-radius: 16px; padding: 40px 32px; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.login-logo { font-size: 28px; font-weight: 900; background: linear-gradient(90deg, #ff2530, #e50914); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 8px; text-align: center; }
.login-sub  { color: #777; font-size: 14px; margin-bottom: 32px; text-align: center; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  text-align: center;
  padding: 28px 12px 20px;
  color: #333; font-size: 11px;
  border-top: 1px solid #151515;
  margin-top: 24px;
}

/* ══════════════════════════════════════════
   YARDIMCI
══════════════════════════════════════════ */
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.flex { display: flex; }
.gap8 { gap: 8px; }
.wrap { flex-wrap: wrap; }
.muted { color: #666; }

/* Masaüstü ayarları */
@media (min-width: 768px) {
  .nav { padding: 0 20px; }
  .section { padding: 0 20px 32px; }
  .card { width: 130px; }
  .card-wide { width: 160px; }
}
@media (min-width: 1024px) {
  .section { padding: 0 32px 40px; }
  .card { width: 145px; }
  .card-wide { width: 175px; }
}

@media (min-width: 1024px) {
  .nav { padding: 0 32px; }
  .hero-body { padding: 0 32px 20px; }
}
