/* ═══════════════════════════════════════════════
   ZencerTV Panel v4 — Premium Dark UI
   ═══════════════════════════════════════════════ */
:root {
  --bg: #06080f;
  --bg2: #0b0f1a;
  --surface: #111827;
  --surface2: #1a2035;
  --surface3: #232b42;
  --border: rgba(148, 163, 215, 0.08);
  --border2: rgba(148, 163, 215, 0.14);
  --text: #e8ecf8;
  --text2: #c0c8e4;
  --muted: #6b7599;
  --accent: #7c6cf0;
  --accent2: #22d3c5;
  --accent-glow: rgba(124, 108, 240, 0.2);
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 14px;
  --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.14); }

/* ═══════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════ */
.login-view {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  position: relative; overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;         /* ◀◀◀ BU SATIRLAR KRİTİK */
}
.bg-blob {
  position: absolute; border-radius: 50%; filter: blur(100px); opacity: .15;
  animation: blobFloat 20s ease-in-out infinite alternate;
  pointer-events: none;         /* ◀◀◀ BLOB TIKLAMALARI ENGELLEMESİN */
}
.b1 { width: 500px; height: 500px; background: var(--accent); top: -150px; left: -100px; }
.b2 { width: 400px; height: 400px; background: var(--accent2); bottom: -100px; right: -80px; animation-delay: -7s; }
.b3 { width: 300px; height: 300px; background: #e74cf0; top: 50%; left: 60%; animation-delay: -13s; }
@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.15); }
}

.login-card {
  position: relative; z-index: 2;
  width: min(440px, 100%);
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.04);
  animation: cardIn .6s cubic-bezier(.22,1,.36,1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 32px; }
.logo-icon { width: 52px; height: 52px; flex-shrink: 0; }
.logo-icon.sm { width: 36px; height: 36px; }
.logo-icon svg { width: 100%; height: 100%; display: block; }
.login-title {
  font-size: 28px; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.login-form { display: grid; gap: 18px; }
.input-group { display: grid; gap: 7px; }
.input-group label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}

input[type="text"],
input[type="password"],
input:not([type]),
.s-input {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--border2);
  background: rgba(6, 8, 15, 0.8);
  color: var(--text); font-size: 15px; font-family: var(--font);
  outline: none; transition: border .2s, box-shadow .2s;
}
input:focus, .s-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: #4a5270; }

/* ─── Buttons ─── */
button {
  cursor: pointer;
  font-family: var(--font);
  border: none;
  outline: none;
  position: relative;
  z-index: 1;
}

.btn-primary {
  width: 100%; padding: 14px; border-radius: 12px;
  font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #5a4cd9);
  color: #fff; box-shadow: 0 4px 20px var(--accent-glow);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ghost {
  width: 100%; padding: 12px; border: 1px solid var(--border2); border-radius: 12px;
  background: transparent; color: var(--text2);
  font-size: 13px; font-weight: 600; transition: background .15s;
}
.btn-ghost:hover { background: var(--surface2); }

.btn-warn {
  padding: 10px 16px; border-radius: 10px;
  background: rgba(239,68,68,.15); color: var(--red);
  font-size: 13px; font-weight: 700; transition: background .15s;
}
.btn-warn:hover { background: rgba(239,68,68,.25); }

.file-drop-zone {
  border: 2px dashed var(--border2); border-radius: 16px; padding: 40px 20px;
  text-align: center; cursor: pointer; position: relative; transition: all .2s;
  background: rgba(124,108,240,.04);
}
.file-drop-zone:hover, .file-drop-zone.over {
  border-color: var(--accent); background: rgba(124,108,240,.1);
  box-shadow: 0 0 30px var(--accent-glow);
}
.file-drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.drop-icon { font-size: 36px; margin-bottom: 8px; }
.drop-text { font-size: 14px; color: var(--text2); }
.drop-name { font-size: 12px; color: var(--accent2); margin-top: 6px; font-weight: 600; }

.login-msg {
  min-height: 20px; font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px;
}
.login-msg.error { color: var(--red); }
.login-msg.ok { color: var(--accent2); }

/* ═══════════════════════════════════════════════
   APP VIEW
   ═══════════════════════════════════════════════ */
.app-view { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title {
  font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.section-tabs { display: flex; gap: 4px; margin-left: 24px; }
.sec-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.sec-tab:hover { color: var(--text); background: var(--surface2); }
.sec-tab.active {
  background: linear-gradient(135deg, rgba(124,108,240,.2), rgba(34,211,197,.1));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(124,108,240,.25);
}
.sec-tab svg { opacity: .7; }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-badge {
  padding: 7px 14px; border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text2); white-space: nowrap;
}
.icon-btn {
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); display: grid; place-items: center;
  font-size: 16px; color: var(--text); transition: background .15s;
}
.icon-btn:hover { background: var(--surface2); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.6); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 24px;
}
.modal-card {
  width: min(460px, 100%); background: var(--surface);
  border: 1px solid var(--border2); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4); overflow: hidden;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface2); color: var(--text);
  font-size: 16px; display: grid; place-items: center;
}
.modal-close:hover { background: var(--surface3); }
.modal-body { padding: 22px; display: grid; gap: 18px; }
.setting-group { display: grid; gap: 6px; }
.setting-group label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.setting-group input[type="range"] { width: 100%; accent-color: var(--accent); }
.setting-group select {
  padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text); font-family: var(--font); font-size: 13px;
}
.setting-val { font-size: 13px; color: var(--accent2); font-weight: 700; font-family: var(--mono); }
.setting-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ─── Main Layout ─── */
.main-layout {
  flex: 1; display: grid;
  grid-template-columns: 280px 360px 1fr;
  gap: 0; overflow: hidden;
}
.panel {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.panel:last-child { border-right: none; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.panel-head h3 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); }
.pill {
  min-width: 32px; padding: 3px 10px; border-radius: 999px; text-align: center;
  background: rgba(124,108,240,.12); color: var(--accent);
  font-size: 11px; font-weight: 800;
}
.mini-btn {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg2); color: var(--text);
  display: grid; place-items: center; font-size: 16px; margin-left: auto;
}
.mini-btn:hover { background: var(--surface2); }
.panel-search { padding: 10px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }

/* ─── Categories ─── */
.cat-panel { background: var(--bg2); }
.cat-list { flex: 1; overflow-y: auto; padding: 6px; }
.cat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-radius: 12px; cursor: pointer;
  transition: all .12s; border: 1px solid transparent; margin-bottom: 2px;
}
.cat-item:hover { background: var(--surface); }
.cat-item.active {
  background: linear-gradient(135deg, rgba(124,108,240,.14), rgba(34,211,197,.06));
  border-color: rgba(124,108,240,.2);
}
.cat-name { font-size: 13px; font-weight: 600; }
.cat-count {
  font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface);
  padding: 2px 8px; border-radius: 20px;
}

/* ─── Content List ─── */
.content-panel { background: var(--surface); }
.content-list { flex: 1; overflow-y: auto; padding: 6px; }

.ch-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 14px; cursor: pointer;
  transition: all .12s; border: 1px solid transparent; margin-bottom: 2px;
}
.ch-card:hover { background: var(--surface2); }
.ch-card.active {
  background: linear-gradient(135deg, rgba(124,108,240,.12), rgba(34,211,197,.05));
  border-color: rgba(124,108,240,.25);
}
.ch-thumb {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  background: var(--surface3); flex-shrink: 0;
}
.ch-thumb-ph {
  width: 44px; height: 44px; border-radius: 12px; background: var(--surface3);
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
  color: var(--muted); flex-shrink: 0;
}
.ch-info { min-width: 0; flex: 1; }
.ch-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sub { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* poster grid for movies/series */
.poster-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; padding: 10px; overflow-y: auto; flex: 1;
}
.poster-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: all .15s;
}
.poster-card:hover { transform: translateY(-2px); border-color: var(--border2); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.poster-card.active { border-color: var(--accent); }
.poster-img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--surface3); display: block; }
.poster-body { padding: 10px; }
.poster-name { font-size: 12px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster-meta { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ─── Player ─── */
.player-panel { background: var(--bg); }
.player-frame { display: flex; flex-direction: column; gap: 0; }
.now-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.now-label { font-size: 18px; font-weight: 700; }
.now-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.live-pill {
  padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 800;
  background: rgba(34,211,197,.1); color: var(--accent2);
  border: 1px solid rgba(34,211,197,.2);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

.video-wrap {
  position: relative; background: #000; aspect-ratio: 16/9;
  border-bottom: 1px solid var(--border);
}
video { width: 100%; height: 100%; display: block; background: #000; }
.v-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.5); pointer-events: none;
}
.v-overlay.gone { display: none; }
.v-overlay-inner { text-align: center; color: var(--muted); }
.v-overlay-inner span { display: block; margin-top: 8px; font-size: 14px; }

.controls-row {
  display: flex; gap: 8px; padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.ctrl-btn {
  width: 40px; height: 36px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  display: grid; place-items: center; font-size: 16px; transition: background .12s;
}
.ctrl-btn:hover { background: var(--surface2); }

.status-line {
  padding: 8px 18px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; flex: 1; overflow-y: auto; }
.info-card { padding: 14px 18px; border-right: 1px solid var(--border); }
.info-card:last-child { border-right: none; }
.info-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.info-body { font-size: 13px; color: var(--text2); line-height: 1.6; }

/* ─── Loading ─── */
.loading-bar {
  height: 3px; background: var(--surface); overflow: hidden; position: relative;
}
.loading-bar::after {
  content: ''; position: absolute; top: 0; left: -40%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loadSlide 1.2s ease-in-out infinite;
}
@keyframes loadSlide { 0% { left: -40%; } 100% { left: 100%; } }

/* ─── Series Episodes ─── */
.episodes-panel { padding: 12px; display: grid; gap: 6px; }
.ep-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); transition: all .12s;
}
.ep-item:hover { background: var(--surface2); }
.ep-item.active { border-color: var(--accent); }
.ep-num { font-size: 12px; font-weight: 800; color: var(--accent); min-width: 32px; }
.ep-name { font-size: 13px; font-weight: 600; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .main-layout { grid-template-columns: 240px 300px 1fr; }
}
@media (max-width: 960px) {
  .main-layout { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .cat-panel { max-height: 200px; }
  .content-panel { max-height: 250px; }
  .panel { border-right: none; border-bottom: 1px solid var(--border); }
  .section-tabs { display: none; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .login-card { padding: 28px 20px; }
  .topbar { flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: flex-end; }
}
