* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f13;
  --bg2: #17171d;
  --bg3: #1e1e26;
  --accent: #e50914;
  --accent2: #7c3aed;
  --text: #e8e8ec;
  --muted: #8a8a96;
  --border: #2a2a34;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
}

#app { display: flex; height: 100vh; }

/* Sidebar */
#sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  flex-shrink: 0;
}
.logo { font-size: 18px; font-weight: 800; padding: 0 10px 20px; letter-spacing: .3px; }
nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  background: none; border: none; color: var(--muted);
  text-align: left; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; cursor: pointer; transition: .15s;
}
.nav-btn:hover { background: var(--bg3); color: var(--text); }
.nav-btn.active { background: linear-gradient(90deg, rgba(229,9,20,.25), transparent); color: #fff; font-weight: 600; }
.sidebar-footer { margin-top: auto; }
.muted { color: var(--muted); font-size: 12px; padding: 8px 12px; }

/* Main */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#topbar { position: relative; z-index: 30; padding: 16px 24px; border-bottom: 1px solid var(--border); }
#search {
  width: 100%; max-width: 480px; padding: 10px 16px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; outline: none;
}
#search:focus { border-color: var(--accent); }

.meoo-results {
  position: absolute; top: 100%; left: 24px; right: 24px; max-width: 480px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; z-index: 40; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  max-height: 60vh; overflow-y: auto;
}
.meoo-title { font-size: 12px; color: var(--muted); padding: 4px 8px 8px; }
.meoo-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; }
.meoo-item:hover { background: var(--bg3); }
.meoo-item img { width: 34px; height: 50px; object-fit: cover; border-radius: 4px; }
.meoo-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meoo-add {
  background: var(--accent2); border: none; color: #fff; font-size: 11px;
  padding: 5px 10px; border-radius: 6px; cursor: pointer;
}

#content { flex: 1; overflow-y: auto; padding: 24px; position: relative; z-index: 1; }

/* Grid postere */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}
.card { cursor: pointer; transition: transform .2s; }
.card:hover { transform: translateY(-4px); }
.card .poster {
  width: 100%; aspect-ratio: 2/3; object-fit: cover;
  border-radius: 10px; background: var(--bg3);
  border: 1px solid var(--border);
}
.card .title {
  margin-top: 8px; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .meta { font-size: 11px; color: var(--muted); }
.empty { color: var(--muted); padding: 60px; text-align: center; font-size: 16px; }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; margin: -8px 0 16px; flex-wrap: wrap; }
.chip {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); padding: 6px 14px; border-radius: 20px;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- autentificare ---------- */
#auth-overlay {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 90%, rgba(79,70,229,.15), transparent 60%),
    rgba(10,10,14,.82);
  backdrop-filter: blur(10px);
  z-index: 200;
}
#auth-box {
  background: linear-gradient(160deg, rgba(30,30,40,.92), rgba(18,18,26,.96));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 36px 34px 28px; width: 400px; max-width: 92vw;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 60px rgba(124,58,237,.08) inset;
  animation: auth-in .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes auth-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-logo-icon {
  font-size: 34px; width: 58px; height: 58px; display: grid; place-items: center;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border-radius: 16px; box-shadow: 0 8px 24px rgba(124,58,237,.4);
}
.auth-logo-title { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.auth-logo-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.auth-tabs {
  display: flex; gap: 6px; margin-bottom: 22px; padding: 5px;
  background: var(--bg3); border-radius: 12px;
}
.auth-tabs .chip {
  flex: 1; padding: 9px; border: none; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 14px; border-radius: 9px;
}
.auth-tabs .chip.active {
  background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff;
  box-shadow: 0 4px 14px rgba(124,58,237,.35);
}
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.hidden { display: none; }
.field {
  position: relative; display: flex; align-items: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field:focus-within {
  border-color: #7c3aed; background: rgba(124,58,237,.06);
  box-shadow: 0 0 0 3px rgba(124,58,237,.18);
}
.field-icon {
  position: absolute; left: 14px; font-size: 15px; opacity: .65;
  pointer-events: none;
}
.field input {
  width: 100%; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; padding: 13px 14px 13px 42px;
}
.field input::placeholder { color: var(--muted); opacity: .8; }
.auth-submit {
  background: linear-gradient(135deg, #7c3aed, #4f46e5); border: none;
  border-radius: 12px; color: #fff; padding: 14px;
  font-size: 15px; font-weight: 700; letter-spacing: .2px; cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(124,58,237,.35);
  transition: transform .12s, filter .15s;
}
.auth-submit:hover { filter: brightness(1.12); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
.link-btn {
  background: none; border: none; color: #a78bfa; cursor: pointer;
  font-size: 13px; padding: 4px 0; text-align: center; font-weight: 500;
}
.link-btn:hover { color: #c4b5fd; }
.auth-hint { font-size: 12.5px; text-align: center; margin-top: -4px; }
#auth-msg { margin-top: 16px; text-align: center; font-size: 13px; min-height: 18px; font-weight: 500; }
#auth-msg.ok { color: #4ade80; }
#auth-msg.err { color: #f87171; }

.yt-frame {
  width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 12px;
  background: #000; display: none;
}

/* Overlay-uri */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.overlay.hidden { display: none; }
.close-btn {
  position: absolute; top: 14px; right: 16px; z-index: 5;
  background: rgba(0,0,0,.6); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer;
}

/* Detalii */
#detail-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; width: min(860px, 92vw); max-height: 88vh;
  overflow-y: auto; padding: 28px; position: relative;
}
#detail-hero { display: flex; gap: 24px; margin-bottom: 24px; }
#detail-hero img { width: 180px; border-radius: 12px; }
#detail-hero h2 { font-size: 26px; margin-bottom: 8px; }
#detail-hero .desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.badge-watch { display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 20px; background: rgba(124,58,237,.25); color: #c4b5fd; font-size: 12px; cursor: pointer; border: 1px solid var(--accent2); }
.badge-watch.on { background: rgba(229,9,20,.2); color: #fca5a5; border-color: var(--accent); }

.season-block { margin-bottom: 20px; }
.season-name { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--muted); }
.ep-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-btn {
  padding: 8px 14px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); cursor: pointer; font-size: 13px;
}
.ep-btn:hover { border-color: var(--accent); background: var(--bg2); }

/* Player */
#player-box {
  background: #000; border-radius: 14px; width: min(1100px, 94vw);
  padding: 18px; position: relative;
}
.player-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
#video { width: 100%; max-height: 68vh; background: #000; border-radius: 8px; }
#player-status { margin-top: 8px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 5px; }
