*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0d0d;
  --surface: #181818;
  --surface2: #222;
  --border: #2a2a2a;
  --accent: #ff2d6b;
  --accent-dim: rgba(255, 45, 107, 0.13);
  --text: #f0f0f0;
  --muted: #888;
  --radius: 10px;
  --transition: 0.2s ease;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── NAV ─────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.nav-logo span {
  color: var(--accent);
}

nav a.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

nav a.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

/* ─── PAGE WRAPPER ────────────────────────── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* ─── HEADINGS ────────────────────────────── */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 0.4rem;
}

.page-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* ─── VIDEO GRID ──────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card-thumb img {
  transform: scale(1.04);
}

.play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  transition: background var(--transition);
}

.card:hover .play-icon {
  background: rgba(0,0,0,0.5);
}

.play-icon svg {
  width: 52px;
  height: 52px;
  opacity: 0.7;
  transition: opacity var(--transition), transform var(--transition);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

.card:hover .play-icon svg {
  opacity: 1;
  transform: scale(1.1);
}

.card-body {
  padding: 1rem 1.1rem 1.2rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-size: 0.83rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card-date {
  font-size: 0.75rem;
  color: #555;
  margin-top: 0.6rem;
}

/* ─── EMPTY / LOADING STATES ──────────────── */
.state-box {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.state-box svg {
  opacity: 0.15;
  margin-bottom: 1rem;
}

.state-box p {
  font-size: 1rem;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 240px;
  border: 1px solid var(--border);
}

/* ─── WATCH PAGE ──────────────────────────── */
.watch-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.back-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.video-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.watch-info {
  margin-top: 1.5rem;
}

.watch-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.watch-date {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.watch-desc {
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 700px;
}

/* ─── ADMIN ───────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title svg { color: var(--accent); }

/* ─── FORM ────────────────────────────────── */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

input, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.6rem 0.85rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea { min-height: 90px; font-family: monospace; font-size: 0.83rem; }

.preview-label {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.embed-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 7px;
  overflow: hidden;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
}

.embed-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ─── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
}

.btn-primary:hover { background: #c1121f; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: #2a2a2a; color: #e55; border-color: #e55; }

/* ─── VIDEO LIST ──────────────────────────── */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.video-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color var(--transition);
}

.video-row:hover { border-color: #3a3a3a; }

.video-row-thumb {
  width: 80px;
  height: 48px;
  background: var(--surface2);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-row-thumb svg { opacity: 0.2; }

.video-row-info { flex: 1; min-width: 0; }

.video-row-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-row-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ─── STATS BAR ───────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.3rem;
  flex: 1;
  text-align: center;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── TOAST ───────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: slide-in 0.25s ease;
  min-width: 220px;
}

.toast.success { border-left: 3px solid #4caf50; }
.toast.error   { border-left: 3px solid var(--accent); }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── SEO TEXT BLOCK ──────────────────────── */
.seo-block {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 0.5rem;
  border-top: 1px solid var(--border);
}

.seo-block h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.seo-block p {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.seo-block strong { color: #666; }

.seo-block ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  list-style: none;
  padding: 0;
}

.seo-block ul li a {
  font-size: 0.78rem;
  color: #555;
  text-decoration: none;
  transition: color var(--transition);
}

.seo-block ul li a:hover { color: var(--accent); }

/* ─── AGE GATE ────────────────────────────── */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.age-gate-box {
  background: var(--surface);
  border: 1px solid #ff2d6b44;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,45,107,0.15);
}

.age-gate-logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.age-gate-box h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.age-gate-box p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.age-gate-btns {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.age-gate-note {
  font-size: 0.73rem !important;
  color: #555 !important;
  margin-bottom: 0 !important;
}

/* ─── FOOTER ──────────────────────────────── */
footer {
  text-align: center;
  font-size: 0.78rem;
  color: #444;
  padding: 2rem;
  border-top: 1px solid var(--border);
}

/* ─── RESPONSIVE ──────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  main, .watch-wrap { padding: 1.5rem 1rem 3rem; }
  .page-title { font-size: 1.5rem; }
  .watch-title { font-size: 1.25rem; }
}
