/* B4U Movie News — Admin Panel. Dark cinematic style: black + red #EF4444.
   Same visual language as the B4UMoviez admin and the news site. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #000000;
  --surface: #111114;
  --surface-2: #1a1a1f;
  --border: #2a2a30;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #EF4444;
  --accent-dark: #dc2626;
  --green: #22c55e;
  --amber: #f59e0b;
}
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---- glass header ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.logo { display: inline-flex; align-items: center; font-size: 22px; font-weight: 800; letter-spacing: 0.2px; white-space: nowrap; }
.logo .play { color: var(--accent); }
.logo .b4 { color: var(--accent); }
.logo .logo-bucket { height: 1.3em; width: auto; flex: none; margin: 0 1px; }
.logo .moviez { color: var(--text); transition: color 0.25s ease; }
.logo .news-word { color: var(--accent); transition: color 0.25s ease; }
.logo:hover .moviez { color: var(--accent); }
.logo:hover .news-word { color: var(--text); }
.logo .news { color: var(--text); font-weight: 700; font-size: 13px; letter-spacing: 2px;
  text-transform: uppercase; margin-left: 6px; padding: 3px 8px;
  border: 1px solid var(--accent); border-radius: 4px; }
.topbar nav { display: flex; gap: 4px; margin-left: 12px; }
.topbar nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600;
}
.topbar nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topbar nav a.active { color: #fff; background: var(--accent); }
.topbar .spacer { flex: 1; }
.user-chip { color: var(--muted); font-size: 13px; }
.user-chip b { color: var(--text); }
.role-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.role-admin { background: var(--accent); color: #fff; }
.role-moderator { background: #1e3a5f; color: #93c5fd; }
.role-user { background: #1f2937; color: #9ca3af; }

/* ---- layout ---- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.wrap.narrow { max-width: 620px; }
h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
h2 { font-size: 19px; font-weight: 700; margin: 22px 0 10px; }
.page-sub { color: var(--muted); margin-bottom: 18px; }

/* ---- cards / tables ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.card + .card { margin-top: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; }
tr:last-child td { border-bottom: none; }
.empty { color: var(--muted); padding: 22px 8px; text-align: center; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-draft { background: #2a2a30; color: #d1d5db; }
.pill-dryrun { background: #3f2d06; color: #fbbf24; }

/* ---- forms ---- */
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
label .hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="password"], input[type="url"], select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25); }
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
input[readonly] { color: var(--muted); }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }
.slug-preview { font-family: ui-monospace, monospace; font-size: 13px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; }

/* ---- buttons ---- */
.btn { display: inline-block; min-height: 44px; padding: 10px 18px; border-radius: 9px;
  border: 1px solid transparent; font-weight: 700; font-size: 14px; text-align: center;
  background: var(--surface-2); color: var(--text); }
.btn:hover { text-decoration: none; filter: brightness(1.15); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ---- labels chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
.chip button { background: none; border: none; color: var(--accent); font-weight: 800;
  font-size: 15px; line-height: 1; padding: 0 2px; }
.chip-add { display: flex; gap: 8px; margin-top: 8px; }
.chip-add input { flex: 1; }

/* ---- sections (repeatable blocks) ---- */
.section-block { border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  margin-top: 14px; background: var(--surface); position: relative; }
.section-block .sec-head { display: flex; justify-content: space-between; align-items: center; }
.section-block .sec-head h3 { font-size: 15px; }
.media-choice { display: flex; gap: 16px; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
.media-choice label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; color: var(--text); }
.media-choice input { width: auto; accent-color: var(--accent); }

/* ---- TMDB + YouTube ---- */
.tmdb-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.tmdb-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: pointer; text-align: left; padding: 0; }
.tmdb-card:hover { border-color: var(--accent); }
.tmdb-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: #222; }
.tmdb-card .t { padding: 8px 10px; font-size: 13px; font-weight: 700; }
.tmdb-card .y { padding: 0 10px 9px; font-size: 12px; color: var(--muted); }
.tmdb-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4); }
.note { background: #17130a; border: 1px solid #4a3807; color: #fcd34d; border-radius: 9px;
  padding: 10px 12px; font-size: 13px; margin-top: 10px; }
.note.info { background: #0d1526; border-color: #1e3a5f; color: #93c5fd; }
.note.danger { background: #2a0d0d; border-color: #7f1d1d; color: #fca5a5; }
.thumb-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.thumb-row img { width: 110px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.thumb-row .cap { font-size: 12px; color: var(--muted); margin-top: 4px; }
.video-preview { margin-top: 12px; }
.video-preview iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; background: #000; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; }

/* ---- login ---- */
.login-box { max-width: 420px; margin: 60px auto 0; }
.login-box .logo { font-size: 30px; margin-bottom: 4px; }
.error { background: #2a0d0d; border: 1px solid #7f1d1d; color: #fca5a5;
  border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.ok { background: #052e16; border: 1px solid #166534; color: #86efac;
  border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }

/* ---- rendered post preview (news-site style) ---- */
.post-hero { border-radius: 14px; overflow: hidden; margin: 18px 0; }
.post-hero img { width: 100%; display: block; }
.post-body h2 { color: var(--accent); font-size: 22px; font-weight: 800; margin: 26px 0 12px;
  scroll-margin-top: 90px; }
.post-body p { margin: 0 0 16px; font-size: 16.5px; line-height: 1.7; color: #e5e7eb; }
.post-body img { max-width: 100%; border-radius: 10px; display: block; margin: 6px 0; }
.post-body iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; background: #000; }
.post-body .caption { color: var(--muted); font-size: 13px; margin: -8px 0 16px; }
.watch-btn { display: inline-block; background: var(--accent); color: #fff !important;
  font-weight: 700; padding: 11px 18px; border-radius: 9px; }
.watch-btn:hover { background: var(--accent-dark); text-decoration: none; }
.post-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
code.inline { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: 13px; }
pre.code { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; overflow: auto; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.dryrun-banner { background: #3f2d06; border: 1px solid #92400e; color: #fde68a;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-weight: 600; }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .field-row { flex-direction: column; }
  .wrap { padding: 18px 14px 50px; }
}
