/* ═══════════════════════════════════════════════════
   UK Release Radar — Stylesheet
   Dark mode, premium feel, responsive card grid
═══════════════════════════════════════════════════ */

/* ─── Design tokens ──────────────────────────────── */
:root {
  --bg:            #07070f;
  --surface:       #0d0d1a;
  --card:          #111120;
  --card-border:   #1c1c30;
  --card-hover:    rgba(108, 99, 255, 0.45);
  --card-shadow:   0 8px 32px rgba(0, 0, 0, 0.55);

  --accent:        #6c63ff;
  --accent-hover:  #8078ff;
  --accent-glow:   rgba(108, 99, 255, 0.22);

  /* Category colours */
  --col-game:      #00d4aa;
  --col-game-glow: rgba(0, 212, 170, 0.18);
  --col-movie:     #ff5f6d;
  --col-movie-glow:rgba(255, 95, 109, 0.18);
  --col-tv:        #ffa94d;
  --col-tv-glow:   rgba(255, 169, 77, 0.18);

  /* Timing badges */
  --badge-live:    #ff3b3b;
  --badge-new:     #00c875;
  --badge-soon:    #6c63ff;
  --badge-upcoming:#8888aa;

  /* Text */
  --text:          #ededf8;
  --text-sub:      #9090b8;
  --text-muted:    #505070;

  /* Layout */
  --header-h:      70px;
  --filter-h:      58px;
  --radius:        16px;
  --radius-sm:     8px;
  --radius-xs:     5px;
  --max-w:         1400px;
  --pad:           1.5rem;

  --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }

/* ─── Header ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(7, 7, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  gap: 1rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  height: 40px;
  width: auto;
  border-radius: var(--radius-xs);
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.logo-name {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--badge-live);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--badge-live);
  animation: pulse-live 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.5); }
  50%       { opacity: 0.8; transform: scale(1.2); box-shadow: 0 0 0 5px rgba(255, 59, 59, 0); }
}

.last-updated {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ─── Filter bar ─────────────────────────────────── */
.filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: rgba(7, 7, 15, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  height: var(--filter-h);
}

.filter-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--card-border);
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.filter-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.filter-count {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 7px;
  border-radius: 999px;
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ─── Feed grid ──────────────────────────────────── */
.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem var(--pad) 4rem;
}

/* ─── Release card ───────────────────────────────── */
.release-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

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

/* Category-specific hover glow */
.release-card.cat-game:hover  { border-color: rgba(0, 212, 170, 0.5); box-shadow: var(--card-shadow), 0 0 24px var(--col-game-glow); }
.release-card.cat-movie:hover { border-color: rgba(255, 95, 109, 0.5); box-shadow: var(--card-shadow), 0 0 24px var(--col-movie-glow); }
.release-card.cat-tv:hover    { border-color: rgba(255, 169, 77, 0.5); box-shadow: var(--card-shadow), 0 0 24px var(--col-tv-glow); }

/* Card hidden for filtering */
.release-card.card-hidden {
  opacity: 0;
  transform: scale(0.97);
}

/* ── Card media (image area) ──────────────────────── */
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}

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

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

.card-img--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface), var(--card));
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.3;
}

/* ── Category badge (top-left) ───────────────────── */
.cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.cat-badge.cat-game  { background: rgba(0, 212, 170, 0.2);   color: var(--col-game);  border: 1px solid rgba(0, 212, 170, 0.4); }
.cat-badge.cat-movie { background: rgba(255, 95, 109, 0.2);  color: var(--col-movie); border: 1px solid rgba(255, 95, 109, 0.4); }
.cat-badge.cat-tv    { background: rgba(255, 169, 77, 0.2);  color: var(--col-tv);    border: 1px solid rgba(255, 169, 77, 0.4); }

/* ── Timing badge (top-right) ────────────────────── */
.timing-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
}

.badge-live     { background: rgba(255, 59, 59, 0.25);  color: #ff6b6b; border: 1px solid rgba(255, 59, 59, 0.5); animation: pulse-badge 2s ease-in-out infinite; }
.badge-new      { background: rgba(0, 200, 117, 0.2);   color: #00e87a; border: 1px solid rgba(0, 200, 117, 0.4); }
.badge-soon     { background: rgba(108, 99, 255, 0.2);  color: #a09aff; border: 1px solid rgba(108, 99, 255, 0.4); }
.badge-upcoming { background: rgba(136, 136, 170, 0.15); color: var(--text-muted); border: 1px solid rgba(136, 136, 170, 0.25); }

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ── Card body ───────────────────────────────────── */
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.2rem 1rem;
  gap: 0.55rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title-link {
  color: inherit;
  text-decoration: none;
}
.card-title-link:hover {
  color: var(--accent);
}
.card-media-link {
  display: block;
  text-decoration: none;
}

/* ── Metadata pills ──────────────────────────────── */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.meta-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
  white-space: nowrap;
}

.meta-pill.rating { color: #ffd700; }
.meta-pill.date   { color: var(--text-sub); }

/* ── UK Streaming providers ──────────────────────── */
.providers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.provider-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.25);
  color: #a09aff;
}

/* ── Description ─────────────────────────────────── */
.card-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ── Card footer ─────────────────────────────────── */
.card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--card-border);
}

.detected-at {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
  flex: 1;
  text-align: center;
}

.btn-ghost {
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.45);
  transform: translateY(-1px);
}

/* Coming Soon — muted, non-clickable label for unreleased movies */
.btn-coming-soon {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  cursor: default;
  font-style: italic;
  pointer-events: none;
  opacity: 0.7;
}

/* ─── Empty state ────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 5rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; }

.empty-state h2 {
  font-size: 1.25rem;
  color: var(--text-sub);
}

.empty-state p {
  font-size: 0.9rem;
}

/* ─── Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--card-border);
  padding: 2.5rem var(--pad);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-logo-name {
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-sub);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--text); }

.tmdb-attr {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tmdb-attr a {
  color: var(--accent);
  text-decoration: underline;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 640px) {
  :root { --pad: 1rem; }

  .header-right { display: none; }

  .logo-name { font-size: 0.95rem; }

  .feed {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem var(--pad) 3rem;
  }

  .card-actions { flex-direction: column; }

  .btn { flex: unset; width: 100%; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .feed {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ═══════════════════════════════════════════════════
   RELEASE DETAIL PAGE
═══════════════════════════════════════════════════ */

.release-detail {
  padding-bottom: 3rem;
}

/* ── Hero banner ──────────────────────────────────── */
.detail-hero {
  position: relative;
  width: 100%;
  min-height: 340px;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.detail-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(7, 7, 15, 0.2) 0%,
    rgba(7, 7, 15, 0.85) 70%,
    rgba(7, 7, 15, 1) 100%
  );
}

.detail-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem var(--pad) 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-hero-title {
  font-size: clamp(1.6rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* ── Content card ─────────────────────────────────── */
.detail-card {
  max-width: var(--max-w);
  margin: -1rem auto 0;
  padding: 0 var(--pad);
}

.detail-card-inner {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
}

/* ── Thumbnail ────────────────────────────────────── */
.detail-thumb-img {
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.detail-thumb--placeholder {
  aspect-ratio: 2 / 3;
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

/* ── Info panel ───────────────────────────────────── */
.detail-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-desc {
  color: var(--text-sub);
  line-height: 1.75;
  font-size: 0.95rem;
  flex: 1;
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  .detail-hero {
    min-height: 240px;
  }
  .detail-hero-title {
    font-size: 1.4rem;
  }
  .detail-card-inner {
    grid-template-columns: 1fr;
  }
  .detail-thumb-img {
    max-width: 180px;
  }
}
