/* ══════════════════════════════════════
   STREAMSTACK — Full 80s Synthwave Theme
   ══════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #06010f;
  --surface:      #0e0620;
  --surface2:     #160930;
  --border:       #2a0a4a;
  --neon-pink:    #ff2d78;
  --neon-cyan:    #00e5ff;
  --neon-yellow:  #ffe135;
  --neon-purple:  #bf00ff;
  --neon-green:   #00ff9f;
  --text:         #f0e6ff;
  --text-muted:   #9980cc;
  --danger:       #ff2d78;
  --radius:       3px;
}

/* ── Synthwave grid background ── */
body {
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  position: relative;
}

/* Grid lines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
  pointer-events: none;
  z-index: 1;
}

header, main, footer { position: relative; z-index: 2; }

/* ── Header ── */
header {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  background:
    linear-gradient(180deg, #1a003a 0%, #0d0020 60%, var(--bg) 100%);
  border-bottom: 1px solid var(--neon-pink);
  box-shadow: 0 4px 40px rgba(255, 45, 120, 0.25);
}

/* ── Hero art: TV + popcorn ── */
.hero-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto 1.25rem;
  width: 260px;
  height: 160px;
}

.retro-tv {
  width: 160px;
  flex-shrink: 0;
  filter:
    drop-shadow(0 0 8px rgba(0, 229, 255, 0.8))
    drop-shadow(0 0 24px rgba(0, 229, 255, 0.4));
}

.popcorn-bucket {
  width: 60px;
  flex-shrink: 0;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 8px rgba(255, 225, 53, 0.5));
}

/* TV screen pulse */
.tv-screen {
  animation: screen-pulse 4s ease-in-out infinite;
}

@keyframes screen-pulse {
  0%, 100% { opacity: 1; }
  48%       { opacity: 1; }
  50%       { opacity: 0.4; }
  52%       { opacity: 1; }
  70%       { opacity: 1; }
  71%       { opacity: 0.65; }
  72%       { opacity: 1; }
}

.tv-play {
  animation: play-pulse 2.5s ease-in-out infinite;
}

@keyframes play-pulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(0.92); }
}

/* Floating popcorn kernels */
.pop {
  position: absolute;
  border-radius: 50% 44% 56% 42%;
  animation: pop-float linear infinite;
  opacity: 0;
}

.pop.p1 { width:11px; height:9px;  background:#fef3c7; left:20px;  animation-duration:3.1s; animation-delay:0s;    top:100px; }
.pop.p2 { width:9px;  height:11px; background:#fffbeb; left:48px;  animation-duration:2.7s; animation-delay:0.7s;  top:110px; border-radius:42% 56% 44% 58%; }
.pop.p3 { width:10px; height:8px;  background:#fde68a; left:75px;  animation-duration:3.4s; animation-delay:1.3s;  top:105px; }
.pop.p4 { width:8px;  height:10px; background:#fef9e7; left:170px; animation-duration:2.9s; animation-delay:0.4s;  top:108px; }
.pop.p5 { width:12px; height:9px;  background:#fef3c7; left:200px; animation-duration:3.6s; animation-delay:1.8s;  top:112px; border-radius:58% 42% 50% 46%; }
.pop.p6 { width:9px;  height:12px; background:#fffbeb; left:225px; animation-duration:3.0s; animation-delay:0.9s;  top:106px; }

@keyframes pop-float {
  0%   { transform: translateY(0)   rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.9; }
  80%  { opacity: 0.7; }
  100% { transform: translateY(-90px) rotate(25deg); opacity: 0; }
}

/* ── Logo ── */
.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--neon-pink);
  text-shadow:
    0 0 8px  var(--neon-pink),
    0 0 20px var(--neon-pink),
    0 0 50px rgba(255, 45, 120, 0.6),
    0 0 90px rgba(255, 45, 120, 0.3);
  letter-spacing: 3px;
  margin-bottom: 0.65rem;
  line-height: 1.2;
}

.tagline {
  color: var(--neon-cyan);
  font-size: 0.75rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: 400;
  letter-spacing: 0.05em;
  max-width: 600px;
  margin: 0 auto;
  text-wrap: balance;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

/* ── Main ── */
main {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow:
    0 0 16px rgba(0, 229, 255, 0.15),
    inset 0 0 30px rgba(0, 229, 255, 0.03);
}

.card h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
}

/* ── Input Row ── */
.input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

input[type="text"] {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--neon-purple);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.7rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* ── Buttons ── */
button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 1.25rem;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}

button:hover { opacity: 0.85; }
button:active { transform: scale(0.97); }

button.primary {
  background: var(--neon-pink);
  color: #06010f;
  box-shadow: 0 0 16px rgba(255, 45, 120, 0.6), 0 0 40px rgba(255, 45, 120, 0.2);
}

button.primary:hover {
  box-shadow: 0 0 24px rgba(255, 45, 120, 0.85), 0 0 60px rgba(255, 45, 120, 0.3);
  opacity: 1;
}

button.secondary {
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

button.secondary:hover {
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.45);
  opacity: 1;
}

button.secondary.small {
  font-size: 0.65rem;
  padding: 0.4rem 0.85rem;
}

#add-btn {
  background: var(--neon-purple);
  color: #fff;
  box-shadow: 0 0 12px rgba(191, 0, 255, 0.5);
  white-space: nowrap;
}

/* ── Show List ── */
#show-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

#show-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px rgba(255, 225, 53, 0.4);
}

#show-list li .remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0 0.25rem;
  line-height: 1;
  cursor: pointer;
}

#show-list li .remove-btn:hover {
  color: var(--neon-pink);
  opacity: 1;
  text-shadow: 0 0 8px var(--neon-pink);
}

#input-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Loading ── */
#loading-section {
  text-align: center;
  padding: 3rem 1.75rem;
}

#loading-text {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.7);
  margin-bottom: 0.35rem;
}

/* ── Clapper animation ── */
.clapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.clapper svg {
  width: 72px;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 10px rgba(255, 45, 120, 0.7));
}

.clapper-arm {
  animation: clap 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 10px 22px;
}

@keyframes clap {
  0%   { transform: rotate(-28deg); }
  12%  { transform: rotate(0deg); }
  18%  { transform: rotate(-4deg); }
  24%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.clapper-loading .clapper-arm {
  animation-name: clap-fast;
  animation-duration: 1.2s;
}

@keyframes clap-fast {
  0%   { transform: rotate(-30deg); }
  15%  { transform: rotate(0deg); }
  22%  { transform: rotate(-5deg); }
  30%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

/* ── Results ── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.results-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 45, 120, 0.6);
}

#results-section > .hint { margin-bottom: 1.25rem; }

#service-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Service cards ── */
.service-card {
  background: var(--surface);
  border: 1px solid var(--neon-purple);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(191, 0, 255, 0.15);
  transition: box-shadow 0.2s;
}

.service-card:hover {
  box-shadow: 0 0 24px rgba(191, 0, 255, 0.3);
}

.service-card.top-pick {
  border-color: var(--neon-pink);
  box-shadow:
    0 0 20px rgba(255, 45, 120, 0.3),
    0 0 60px rgba(255, 45, 120, 0.1);
}

.service-card.top-pick::before {
  content: '▶ KEEP';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--neon-pink);
  color: #06010f;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255, 45, 120, 0.7);
}

.service-card.low-value {
  opacity: 0.5;
  border-color: var(--border);
  box-shadow: none;
}

.service-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.service-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(255,255,255,0.15);
}

.service-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.service-count {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.match-bar-track {
  height: 5px;
  background: var(--surface2);
  border-radius: 2px;
  margin-bottom: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.match-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  transition: width 0.7s ease;
}

.show-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  background: var(--surface2);
  border: 1px solid var(--neon-purple);
  border-radius: 2px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  color: var(--neon-yellow);
  text-shadow: 0 0 5px rgba(255, 225, 53, 0.4);
}

/* ── Not Found ── */
.not-found-section {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.not-found-section h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

#not-found-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#not-found-list li {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.65rem;
  color: var(--neon-pink);
}

.disclaimer {
  margin-top: 1.25rem;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
}

/* ── Error ── */
.error-banner {
  background: rgba(255, 45, 120, 0.1);
  border: 1px solid var(--neon-pink);
  border-radius: var(--radius);
  color: var(--neon-pink);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 0 12px rgba(255, 45, 120, 0.25);
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--neon-pink);
  box-shadow: 0 -4px 20px rgba(255, 45, 120, 0.15);
}

footer a {
  color: var(--neon-cyan);
  text-decoration: none;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

footer a:hover {
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.9);
}

/* ── Service icon colors ── */
.icon-netflix   { background: #e50914; }
.icon-hulu      { background: #1ce783; }
.icon-disney    { background: #113ccf; }
.icon-hbo       { background: #5822cc; }
.icon-apple     { background: #333; }
.icon-peacock   { background: #f47521; }
.icon-paramount { background: #0064ff; }
.icon-prime     { background: #00a8e0; }

/* ── Utilities ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
  header { padding: 1.75rem 1rem 1.5rem; }
  .logo { font-size: 1.6rem; letter-spacing: 2px; }
  .tagline { font-size: 0.65rem; }

  .hero-art { width: 220px; height: 136px; }
  .retro-tv { width: 130px; }
  .popcorn-bucket { width: 48px; }

  .card { padding: 1.25rem; }
  .input-row { flex-direction: column; }
  #add-btn { width: 100%; }
  #input-actions { flex-direction: column; }
  #input-actions button { width: 100%; }

  .service-card { padding: 1rem 1.1rem; }
}
