/* ============================================================
   MARVEL CINEMATIC THEME (THE INFINITY SCROLL)
   Scoped to body[data-theme="cinematic"]
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&family=Roboto:wght@300;400;500;700&display=swap');

body[data-theme="cinematic"] {
  --color-bg-deep: #0a0a0a;
  --color-bg-panel: #1A1A1A;
  --color-accent-red: #E23636;
  --color-timeline-axis: #333333;
  --color-text-primary: #FFFFFF;
  --color-text-muted: #999999;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --radius-card: 4px;
}

body[data-theme="cinematic"] {
  background-color: var(--color-bg-deep);
  background-image: none;
}

/* Stark star-field lives on body::after — hide it in cinematic */
body[data-theme="cinematic"]::after {
  display: none !important;
}

body[data-theme="cinematic"] * {
  font-family: var(--font-body);
  text-shadow: none;
}

body[data-theme="cinematic"] h1,
body[data-theme="cinematic"] h2,
body[data-theme="cinematic"] h3,
body[data-theme="cinematic"] h4,
body[data-theme="cinematic"] .kpi-number,
body[data-theme="cinematic"] .section-title,
body[data-theme="cinematic"] .phase-badge,
body[data-theme="cinematic"] .nav-tab,
body[data-theme="cinematic"] .filter-btn,
body[data-theme="cinematic"] .order-btn,
body[data-theme="cinematic"] #modal-close,
body[data-theme="cinematic"] .open-modal-btn,
body[data-theme="cinematic"] .phase-marker,
body[data-theme="cinematic"] .completion-label {
  font-family: var(--font-display);
}

body[data-theme="cinematic"] h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: none;
  -webkit-text-fill-color: var(--color-text-primary);
}

body[data-theme="cinematic"] .kpi-number {
  color: var(--color-accent-red);
  font-size: 3.5rem;
}

body[data-theme="cinematic"] .glass-panel,
body[data-theme="cinematic"] .detail-modal,
body[data-theme="cinematic"] .timeline-controls {
  background: var(--color-bg-panel);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #333;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body[data-theme="cinematic"] .glass-panel::before,
body[data-theme="cinematic"] .glass-panel::after {
  display: none;
}

body[data-theme="cinematic"] header {
  background: rgba(10, 10, 10, 0.95);
  border-bottom: 1px solid var(--color-accent-red);
  box-shadow: 0 4px 15px rgba(226, 54, 54, 0.2);
}

body[data-theme="cinematic"] .header-rule {
  display: none;
}

body[data-theme="cinematic"] #card-container {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 2rem 0;
  gap: 2rem;
}

body[data-theme="cinematic"] #card-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--color-timeline-axis);
  transform: translateX(-50%);
}

body[data-theme="cinematic"] .watch-card {
  width: 45%;
  position: relative;
  align-self: flex-end;
  background: var(--color-bg-panel);
  border: none;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(50px);
}

body[data-theme="cinematic"] .watch-card:nth-child(even) {
  align-self: flex-start;
}

body[data-theme="cinematic"] .watch-card::after {
  content: '';
  position: absolute;
  top: 2rem;
  width: 16px;
  height: 16px;
  background: var(--color-accent-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-accent-red);
}

body[data-theme="cinematic"] .watch-card:nth-child(odd)::after {
  left: -11.11%;
  transform: translateX(-50%);
}

body[data-theme="cinematic"] .watch-card:nth-child(even)::after {
  right: -11.11%;
  transform: translateX(50%);
}

@media (max-width: 768px) {
  body[data-theme="cinematic"] #card-container::before {
    left: 20px;
  }
  body[data-theme="cinematic"] .watch-card {
    width: calc(100% - 50px);
    align-self: flex-end;
    margin-left: auto;
  }
  body[data-theme="cinematic"] .watch-card::after {
    left: -30px;
    right: auto;
    transform: translateX(-50%);
  }
}

body[data-theme="cinematic"] .watch-card::before {
  display: none;
}

body[data-theme="cinematic"] .card-inner {
  display: flex;
  flex-direction: row;
  height: 100%;
  padding: 0;
}

body[data-theme="cinematic"] .card-poster {
  flex: 0 0 35%;
  background-color: #111;
  background: linear-gradient(135deg, #2a2a2a, #111);
  background-size: cover;
  background-position: center;
  border-right: 1px solid #333;
  border-radius: var(--radius-card) 0 0 var(--radius-card);
}

body[data-theme="cinematic"] .card-inner-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

body[data-theme="cinematic"] .card-date {
  font-family: var(--font-body);
  color: var(--color-accent-red);
  font-weight: 700;
  font-size: 0.8rem;
}

body[data-theme="cinematic"] .card-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 0.5rem 0;
  letter-spacing: 1px;
}

body[data-theme="cinematic"] .synopsis-text,
body[data-theme="cinematic"] .expanded-inner p {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

body[data-theme="cinematic"] .phase-badge {
  background: #333;
  color: #fff;
  transform: skewX(-10deg);
  display: inline-block;
  padding: 2px 10px;
  font-family: var(--font-display);
  border-radius: 0;
  border: none;
}

body[data-theme="cinematic"] .completion-check-wrapper {
  position: relative;
  top: auto;
  right: auto;
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 10px;
  border: 1px solid var(--color-accent-red);
  text-align: center;
  color: var(--color-accent-red);
  font-family: var(--font-display);
  text-transform: uppercase;
  transition: all 0.3s ease;
  cursor: pointer;
  background: transparent;
}

body[data-theme="cinematic"] .completion-check {
  display: none;
}

body[data-theme="cinematic"] .completion-check + .completion-label {
  width: 100%;
  height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
}

body[data-theme="cinematic"] .completion-check + .completion-label::after {
  content: ' MARK AS WATCHED';
  font-size: 1rem;
}

body[data-theme="cinematic"] .watch-card.is-watched .completion-check-wrapper {
  background: var(--color-accent-red);
  color: #fff;
}

body[data-theme="cinematic"] .watch-card.is-watched .completion-check + .completion-label::after {
  content: ' WATCHED ✓';
  color: #fff;
}

body[data-theme="cinematic"] .watch-card.is-watched .card-inner {
  opacity: 0.6;
}

body[data-theme="cinematic"] .watched-stamp {
  display: none;
}

/* Abstract cinematic band (no stock photo) */
body[data-theme="cinematic"] .phase-divider {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 4rem 2rem;
  background:
    linear-gradient(180deg, rgba(226, 54, 54, 0.12) 0%, transparent 40%, rgba(0,0,0,0.85) 100%),
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(226, 54, 54, 0.15) 0%, transparent 50%),
    linear-gradient(160deg, #0a0a0a 0%, #1a0a0a 50%, #0a0a0a 100%);
  text-align: center;
  margin-top: 4rem;
  margin-bottom: 4rem;
  z-index: 2;
  position: relative;
  border-top: 2px solid var(--color-accent-red);
  border-bottom: 2px solid var(--color-accent-red);
}

body[data-theme="cinematic"] .phase-divider h2 {
  font-family: var(--font-display);
  font-size: 4rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin: 0;
}

body[data-theme="cinematic"] #global-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--color-accent-red);
  z-index: 9999;
  width: 0%;
  transition: width 0.3s ease;
}

body[data-theme="cinematic"] .filter-bar {
  background: rgba(10, 10, 10, 0.9);
  border-bottom: 1px solid #333;
  border-top: none;
  border-left: none;
  border-right: none;
  border-radius: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body[data-theme="cinematic"] .filter-btn {
  background: transparent;
  border: 1px solid #333;
  color: var(--color-text-muted);
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
}

body[data-theme="cinematic"] .filter-btn:hover {
  border-color: var(--color-accent-red);
  color: var(--color-accent-red);
}

body[data-theme="cinematic"] .filter-btn.active {
  background: var(--color-accent-red);
  border-color: var(--color-accent-red);
  color: #fff;
}

body[data-theme="cinematic"] #order-toggle {
  border-radius: 20px;
  border: 1px solid #333;
}

body[data-theme="cinematic"] .order-btn {
  border-radius: 20px;
  font-family: var(--font-display);
  border: none;
}

body[data-theme="cinematic"] .order-btn.active {
  background: var(--color-accent-red);
  color: #fff;
}

body[data-theme="cinematic"] #searchInput {
  background: #1A1A1A;
  border: 1px solid #333;
  border-radius: 4px;
  color: var(--color-text-primary);
  font-family: var(--font-body);
}

body[data-theme="cinematic"] #searchInput:focus {
  border-color: var(--color-accent-red);
  box-shadow: 0 0 8px rgba(226, 54, 54, 0.3);
}

body[data-theme="cinematic"] .icon-toggle-btn {
  border-radius: 4px;
  border: 1px solid #333;
}

body[data-theme="cinematic"] .icon-toggle-btn:hover,
body[data-theme="cinematic"] .icon-toggle-btn.active-gold,
body[data-theme="cinematic"] .icon-toggle-btn.active-cyan {
  border-color: var(--color-accent-red);
  color: var(--color-accent-red);
  box-shadow: 0 0 8px rgba(226, 54, 54, 0.3);
}

body[data-theme="cinematic"] .theme-switcher-btn:focus-visible,
body[data-theme="cinematic"] .icon-toggle-btn:focus-visible {
  outline-color: var(--color-accent-red);
}

body[data-theme="cinematic"] .detail-modal {
  border-left: 2px solid var(--color-accent-red);
}

body[data-theme="cinematic"] .modal-badges .phase-badge,
body[data-theme="cinematic"] .modal-badges .type-badge,
body[data-theme="cinematic"] .modal-badges .importance-badge {
  border: 1px solid #333;
  background: #111;
  color: var(--color-text-muted);
  border-radius: 4px;
}

body[data-theme="cinematic"] .modal-badges .importance-badge.critical {
  color: var(--color-accent-red);
  border-color: var(--color-accent-red);
}

body[data-theme="cinematic"] .open-modal-btn {
  color: var(--color-text-muted);
  border: 1px solid #333;
  border-radius: 4px;
  margin-top: 1rem;
}

body[data-theme="cinematic"] .open-modal-btn:hover {
  background: #111;
  color: var(--color-text-primary);
  border-color: var(--color-accent-red);
  box-shadow: none;
}

body[data-theme="cinematic"] #kpi-total ~ .kpi-label,
body[data-theme="cinematic"] #kpi-universes ~ .kpi-label,
body[data-theme="cinematic"] #kpi-watched ~ .kpi-label {
  font-size: 0.65rem;
}

body[data-theme="cinematic"] #kpi-total ~ .kpi-label::after,
body[data-theme="cinematic"] #kpi-universes ~ .kpi-label::after,
body[data-theme="cinematic"] #kpi-watched ~ .kpi-label::after {
  content: none;
}

/* Subtle film-grain overlay — replaces Stark scanlines on ::before */
body[data-theme="cinematic"]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
