/* ============================================================
   Best for Today — Cinematic UI
   ============================================================ */

:root {
  --bg:         #080d1c;
  --surface:    rgba(14, 20, 44, 0.7);
  --border:     rgba(255, 255, 255, 0.1);
  --accent:     #f0a830;
  --accent-dim: rgba(240, 168, 48, 0.14);
  --text:       #eef0ff;
  --muted:      #68789e;
  --muted-2:    #9aa8c8;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --r-card:     28px;
  --r-video:    16px;
}

/* ── Reset ─────────────────────────────────────────────────── */

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

/* ── Body ──────────────────────────────────────────────────── */

html, body {
  height: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Animated Background Orbs ──────────────────────────────── */

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.orb-1 {
  width: 800px;
  height: 800px;
  top: -300px;
  left: -220px;
  background: radial-gradient(circle, rgba(90, 40, 210, 0.55) 0%, transparent 65%);
  animation: drift-1 28s ease-in-out infinite alternate;
}

.orb-2 {
  width: 600px;
  height: 600px;
  bottom: -200px;
  right: -160px;
  background: radial-gradient(circle, rgba(8, 180, 160, 0.38) 0%, transparent 65%);
  animation: drift-2 22s ease-in-out infinite alternate;
}

@keyframes drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(70px, 55px) scale(1.1); }
}

@keyframes drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-55px, -45px) scale(1.08); }
}

/* ── App Wrapper ───────────────────────────────────────────── */

.app-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 1.25rem;
  gap: 1.25rem;
}

/* ── Header ────────────────────────────────────────────────── */

.site-header {
  width: 100%;
  max-width: 860px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-title svg {
  width: 13px;
  height: 13px;
  opacity: 0.55;
  flex-shrink: 0;
}

/* ── Content Card ──────────────────────────────────────────── */

.content-card {
  position: relative;
  width: min(860px, 100%);
  background: var(--surface);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 2rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 30px 60px rgba(0, 0, 0, 0.4),
    0 0 100px rgba(90, 40, 210, 0.1);
  transition: opacity 0.22s ease;
  overflow: hidden;
}

/* Accent shimmer line at top of card */
.content-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(240, 168, 48, 0.7) 40%,
    rgba(240, 168, 48, 0.7) 60%,
    transparent 100%
  );
}

.content-card.fading {
  opacity: 0;
}

/* ── Label ─────────────────────────────────────────────────── */

.label-pick {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ── Movie Title ───────────────────────────────────────────── */

.movie-title {
  font-size: clamp(2rem, 6.5vw, 3.75rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

/* ── Date Navigation ───────────────────────────────────────── */

.date-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.date-center {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.date-display {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--muted-2);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
  user-select: none;
}

.nav-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(240, 168, 48, 0.4);
  color: var(--accent);
}

.nav-btn:active {
  transform: scale(0.9);
  background: rgba(240, 168, 48, 0.22);
}

/* ── YouTube Facade (thumbnail + play button) ──────────────── */

.yt-facade {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yt-play-btn {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 48px;
  opacity: 0.88;
  transition: opacity 0.18s ease, transform 0.18s ease;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.yt-facade:hover .yt-play-btn {
  opacity: 1;
  transform: scale(1.08);
}

/* ── Share Button ──────────────────────────────────────────── */

.share-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.9rem 0 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  color: var(--muted-2);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
  user-select: none;
}

.share-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.share-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.share-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(240, 168, 48, 0.4);
  color: var(--accent);
}

.share-btn:active {
  transform: scale(0.93);
}

.share-btn.copied {
  background: rgba(80, 200, 140, 0.12);
  border-color: rgba(80, 200, 140, 0.4);
  color: #50c88c;
}

/* ── Video ─────────────────────────────────────────────────── */

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-video);
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 20px 40px rgba(0, 0, 0, 0.5);
}

/* IFrame API replaces #youtube-player div with an iframe */
#youtube-player,
#youtube-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Video Fallback ────────────────────────────────────────── */

.video-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #07091299;
  padding: 2rem;
  text-align: center;
}

.video-fallback.visible {
  display: flex;
}

.video-fallback svg {
  width: 40px;
  height: 40px;
  color: var(--muted);
  opacity: 0.45;
  flex-shrink: 0;
}

.fallback-msg {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 220px;
  line-height: 1.5;
}

.fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.45rem 1rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.fallback-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(240, 168, 48, 0.4);
  color: var(--accent);
}

/* ── No Movie State ────────────────────────────────────────── */

.no-movie-state {
  display: none;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-video);
  border: 1px dashed rgba(255, 255, 255, 0.07);
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.no-movie-state.visible {
  display: flex;
}

/* ── Footer ────────────────────────────────────────────────── */

.site-footer {
  margin-top: auto;
  text-align: center;
  padding-bottom: 0.25rem;
}

.site-footer p {
  font-size: 0.65rem;
  color: var(--muted);
  opacity: 0.3;
  letter-spacing: 0.06em;
}

/* ── Responsive: Mobile Portrait ───────────────────────────── */

@media (max-width: 639px) {
  .app-wrapper {
    padding: 1rem 0.75rem 0.75rem;
    gap: 0.875rem;
  }

  .content-card {
    flex: 1;
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 22px;
  }

  .movie-title {
    font-size: clamp(1.75rem, 8vw, 2.6rem);
    margin-bottom: 1rem;
  }

  .date-nav {
    margin-bottom: 1.25rem;
  }

  .video-wrapper {
    flex: 1;
    aspect-ratio: unset;
    min-height: 160px;
  }
}

/* ── Responsive: Mobile Landscape ──────────────────────────── */

@media (max-height: 520px) and (orientation: landscape) {
  .app-wrapper {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .content-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "label video"
      "title video"
      "nav   video";
    column-gap: 1.5rem;
    row-gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    align-items: start;
  }

  .content-card::before { display: none; }

  .label-pick   { grid-area: label; margin-bottom: 0; }
  .movie-title  { grid-area: title; margin-bottom: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
  .date-nav     { grid-area: nav;   margin-bottom: 0; align-self: end; }
  .video-wrapper {
    grid-area: video;
    aspect-ratio: unset;
    height: 100%;
  }
}

/* ── Responsive: Tablet / Desktop ──────────────────────────── */

@media (min-width: 640px) {
  .app-wrapper {
    padding: 2rem 1.5rem 1.5rem;
    gap: 1.5rem;
  }

  .content-card {
    padding: 2.5rem 2.75rem 2.25rem;
  }

  .label-pick {
    margin-bottom: 0.9rem;
  }

  .movie-title {
    margin-bottom: 1.5rem;
  }

  .date-nav {
    margin-bottom: 2rem;
  }

  .nav-btn {
    width: 38px;
    height: 38px;
  }
}
