:root {
  --bg: #0b0c0f;
  --bg-2: #14161b;
  --panel: #1a1d24;
  --panel-2: #232733;
  --border: #2c313d;
  --text: #eceef3;
  --text-dim: #a4abba;
  --text-faint: #6e7686;
  --accent: #6c5ce7;
  --accent-2: #a29bfe;
  --danger: #e74c3c;
  --ok: #2ecc71;
  --gold: #f1c40f;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 40px rgba(0,0,0,.6);
  --nav-h: 64px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100vh; }
.accent { color: var(--accent-2); }

/* ---- Butonlar ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer; font-size: 14px; font-weight: 600;
  font-family: inherit; padding: 11px 18px; border-radius: var(--radius-sm); transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a4bd1; }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-white { background: #fff; color: #111; }
.btn-white:hover { background: #e6e6e6; }
.btn-block { width: 100%; }
.icon-btn { padding: 8px 10px; font-size: 18px; }
.grow { flex: 1; }
.grow2 { flex: 2; }

/* ============ GİRİŞ EKRANI ============ */
.auth-screen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; }
.auth-bg { position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a1140 0%, #0b0c0f 55%, #1a0f2e 100%); }
.auth-bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(108,92,231,.25), transparent 50%),
              radial-gradient(circle at 75% 80%, rgba(162,155,254,.18), transparent 45%); }
.auth-card { position: relative; z-index: 2; width: 380px; max-width: 92vw; background: rgba(20,22,27,.85);
  backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 18px; padding: 34px 30px; box-shadow: var(--shadow); }
.brand-lg { font-size: 30px; font-weight: 800; text-align: center; margin-bottom: 26px; letter-spacing: -.5px; }
.brand-lg .b-logo { color: var(--accent-2); margin-right: 6px; }
.auth-tabs { display: flex; gap: 6px; background: var(--panel); padding: 5px; border-radius: var(--radius-sm); margin-bottom: 20px; }
.auth-tab { flex: 1; background: transparent; border: none; padding: 10px; border-radius: 6px; cursor: pointer; color: var(--text-dim); font-weight: 600; font-family: inherit; }
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.field input { padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; font-family: inherit; }
.field input:focus { outline: none; border-color: var(--accent); }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.auth-error { color: var(--danger); font-size: 13px; text-align: center; margin-top: 8px; }

/* ============ PROFİL EKRANI ============ */
.profile-screen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 40; background: var(--bg); }
.profile-wrap { text-align: center; }
.profile-title { font-size: 38px; font-weight: 700; margin-bottom: 38px; }
.profile-grid { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.profile-card { cursor: pointer; text-align: center; transition: .15s; }
.profile-card:hover { transform: scale(1.06); }
.profile-avatar { width: 120px; height: 120px; border-radius: 18px; display: grid; place-items: center; font-size: 56px; margin-bottom: 12px; }
.profile-card .pn { font-size: 16px; color: var(--text-dim); }
.profile-card .pin-lock { font-size: 11px; color: var(--gold); margin-top: 2px; }
.profile-actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; }

/* ============ MODAL ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,5,8,.78); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 460px; box-shadow: var(--shadow); animation: pop .18s ease; }
.modal-sm { max-width: 340px; }
.modal-lg { max-width: 640px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.pin-input { width: 100%; text-align: center; font-size: 28px; letter-spacing: 12px; padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.hint { font-size: 12px; color: var(--text-faint); line-height: 1.5; }

/* ============ ÜST BAR ============ */
.app-screen { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 0 36px; height: var(--nav-h); background: linear-gradient(180deg, rgba(11,12,15,.96), rgba(11,12,15,.6));
  backdrop-filter: blur(8px); border-bottom: 1px solid transparent; transition: .2s;
}
.topbar.scrolled { background: var(--bg); border-bottom-color: var(--border); }
.topbar-left { display: flex; align-items: center; gap: 34px; }
.brand-sm { font-weight: 800; font-size: 21px; cursor: pointer; user-select: none; }
.nav-links { display: flex; gap: 22px; }
.nav-link { color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; transition: .12s; }
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .s-ic { position: absolute; left: 12px; color: var(--text-faint); }
.search-box input { width: 240px; padding: 9px 12px 9px 38px; background: rgba(255,255,255,.08); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: inherit; transition: .15s; }
.search-box input:focus { outline: none; background: rgba(255,255,255,.14); width: 320px; }

.profile-menu { position: relative; }
.prof-avatar-btn { background: none; border: none; cursor: pointer; padding: 4px; }
.prof-mini { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 20px; }
.prof-dropdown { position: absolute; right: 0; top: 46px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 180px; box-shadow: var(--shadow); overflow: hidden; z-index: 40; }
.prof-dropdown button { display: block; width: 100%; text-align: left; padding: 12px 16px; background: none; border: none; color: var(--text-dim); cursor: pointer; font-family: inherit; font-size: 14px; }
.prof-dropdown button:hover { background: var(--panel-2); color: var(--text); }

/* ============ ANA İÇERİK ============ */
.main-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.view { padding-bottom: 60px; }

/* Hero */
.hero { position: relative; height: 70vh; min-height: 480px; max-height: 680px; display: flex; align-items: flex-end; padding: 0 48px 70px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; }
.hero-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,12,15,.92) 0%, rgba(11,12,15,.4) 50%, transparent 80%),
              linear-gradient(0deg, var(--bg) 0%, transparent 40%); }
.hero-content { position: relative; z-index: 2; max-width: 560px; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(108,92,231,.2); color: var(--accent-2); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-bottom: 14px; }
.hero-title { font-size: 52px; font-weight: 800; line-height: 1.05; letter-spacing: -1.5px; margin-bottom: 16px; text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.hero-meta { display: flex; gap: 14px; align-items: center; font-size: 14px; color: var(--text-dim); margin-bottom: 14px; }
.hero-meta .rating { color: var(--gold); font-weight: 700; }
.hero-meta .genre { background: rgba(255,255,255,.1); padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.hero-desc { font-size: 15px; line-height: 1.6; color: var(--text-dim); margin-bottom: 24px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 12px; }
.hero-empty { height: 0; }

/* Satırlar */
.row { padding: 6px 0 8px; }
.row-head { display: flex; align-items: center; justify-content: space-between; padding: 0 48px; margin-bottom: 12px; }
.row-title { font-size: 20px; font-weight: 700; }
.row-explore { color: var(--text-faint); font-size: 13px; cursor: pointer; }
.row-explore:hover { color: var(--accent-2); }
.row-track { position: relative; padding: 0 48px; }
.row-scroller { display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth; padding-bottom: 8px; scroll-snap-type: x proximity; }
.row-scroller::-webkit-scrollbar { display: none; }
.row-arrow { position: absolute; top: 0; bottom: 32px; width: 48px; display: grid; place-items: center; cursor: pointer; z-index: 5; background: linear-gradient(90deg, rgba(11,12,15,.9), transparent); opacity: 0; transition: .15s; }
.row:hover .row-arrow { opacity: 1; }
.row-arrow.right { right: 0; transform: scaleX(-1); }
.row-arrow.left { left: 0; }
.row-arrow svg { width: 28px; height: 28px; color: #fff; }

/* Kart */
.poster { flex-shrink: 0; width: 200px; cursor: pointer; transition: .18s; scroll-snap-align: start; position: relative; }
.poster:hover { transform: scale(1.06); z-index: 4; }
.poster-img { width: 200px; height: 300px; border-radius: var(--radius); overflow: hidden; background: var(--panel); position: relative; }
.poster-img img { width: 100%; height: 100%; object-fit: cover; }
.poster-img .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; color: var(--text-faint); text-align: center; padding: 10px; word-break: break-word; }
.poster-img .type-tag { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.poster-name { font-size: 13px; font-weight: 500; margin-top: 8px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-fav { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: #fff; display: grid; place-items: center; z-index: 3; opacity: 0; transition: .15s; }
.poster:hover .poster-fav { opacity: 1; }
.poster-fav.active { opacity: 1; color: var(--danger); }

/* Küçük kart (continue / live) */
.poster.small .poster-img { width: 320px; height: 180px; }
.poster.small { width: 320px; }
.progress-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,.2); }
.progress-bar span { display: block; height: 100%; background: var(--accent-2); }
.poster.small .poster-name { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.8); }

/* Liste görünümü ızgarası */
.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; padding: 20px 48px; }

/* ============ DETAY MODALI ============ */
.detail-overlay { position: fixed; inset: 0; background: rgba(4,5,8,.85); backdrop-filter: blur(6px); z-index: 90; overflow-y: auto; display: grid; place-items: start center; padding: 40px 20px; }
.detail-content { width: 100%; max-width: 900px; background: var(--bg-2); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); animation: pop .2s ease; }
.detail-hero { position: relative; height: 380px; background-size: cover; background-position: center; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-2), transparent 60%), linear-gradient(90deg, rgba(0,0,0,.7), transparent); }
.detail-close { position: absolute; top: 16px; right: 16px; z-index: 5; background: rgba(0,0,0,.6); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 20px; }
.detail-body { padding: 0 32px 32px; margin-top: -80px; position: relative; z-index: 2; }
.detail-title { font-size: 36px; font-weight: 800; letter-spacing: -.5px; }
.detail-meta { display: flex; gap: 14px; align-items: center; margin: 10px 0 14px; font-size: 14px; color: var(--text-dim); flex-wrap: wrap; }
.detail-meta .rating { color: var(--gold); font-weight: 700; }
.detail-meta .genre { background: rgba(255,255,255,.1); padding: 3px 11px; border-radius: 999px; font-size: 12px; }
.detail-actions { display: flex; gap: 10px; margin: 18px 0; }
.detail-desc { font-size: 15px; line-height: 1.7; color: var(--text-dim); max-width: 680px; }
.detail-cast { font-size: 13px; color: var(--text-faint); margin-top: 14px; }
.season-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 16px; }
.season-tab { background: var(--panel); border: 1px solid var(--border); color: var(--text-dim); padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600; }
.season-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.episode-list { display: flex; flex-direction: column; gap: 10px; }
.episode { display: flex; gap: 16px; padding: 14px; background: var(--panel); border-radius: var(--radius); cursor: pointer; transition: .12s; border: 1px solid transparent; }
.episode:hover { background: var(--panel-2); border-color: var(--accent); }
.ep-num { font-size: 26px; font-weight: 800; color: var(--text-faint); min-width: 36px; }
.ep-info { flex: 1; }
.ep-title { font-weight: 600; font-size: 15px; }
.ep-sub { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.ep-play { align-self: center; color: var(--accent-2); }

/* ============ OYNATICI ============ */
.player-overlay { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; flex-direction: column; }
.player-back { position: absolute; top: 16px; left: 16px; z-index: 5; background: rgba(0,0,0,.5); border: none; color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 14px; }
.player-stage { flex: 1; display: grid; place-items: center; }
.player-stage video { width: 100%; height: 100%; max-height: 100vh; background: #000; }
.player-info { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px 28px; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); }
.pi-title { font-size: 22px; font-weight: 700; }
.pi-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
#btnResume { margin-top: 12px; }

/* ============ PLAYLIST MODAL ============ */
.pl-add-form { display: flex; gap: 8px; }
.pl-add-form input { padding: 11px 13px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; font-family: inherit; }
.pl-add-form input:focus { outline: none; border-color: var(--accent); }
.pl-dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--text-faint); font-size: 13px; cursor: pointer; transition: .15s; }
.pl-dropzone:hover, .pl-dropzone.drag { border-color: var(--accent); background: rgba(108,92,231,.06); }
.pl-dropzone .link { color: var(--accent-2); cursor: pointer; }
.pl-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pl-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--panel); border-radius: var(--radius-sm); }
.pl-item .pl-name { font-weight: 600; }
.pl-item .pl-meta { font-size: 12px; color: var(--text-faint); }
.pl-del { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 13px; padding: 4px 8px; }

/* ============ BOŞ / YÜKLENİYOR ============ */
.loading { display: grid; place-items: center; height: 60vh; color: var(--text-faint); }
.spinner-lg { width: 42px; height: 42px; border: 3px solid var(--panel-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty-ic { font-size: 60px; margin-bottom: 16px; opacity: .5; }
.empty h3 { font-size: 22px; color: var(--text); margin-bottom: 8px; }
.empty p { max-width: 420px; margin: 0 auto 20px; line-height: 1.6; }

/* ============ TOAST ============ */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 13px 22px; border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 300; font-size: 14px; font-weight: 500; opacity: 0; transition: .25s; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--ok); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .topbar { padding: 0 16px; }
  .search-box input { width: 160px; }
  .search-box input:focus { width: 200px; }
  .hero { padding: 0 20px 50px; height: 60vh; }
  .hero-title { font-size: 34px; }
  .row-head, .row-track { padding-left: 20px; padding-right: 20px; }
  .poster, .poster-img { width: 140px; }
  .poster-img { height: 210px; }
  .grid-view { padding: 16px 20px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .detail-body { padding: 0 18px 24px; }
  .detail-title { font-size: 26px; }
}
