/* ============================================================
   YouTube Jukebox & Karaoke — Design System
   Paleta: #0e0b1e base · #1a1535 surface · #00f5d4 cyan · #ff2d78 pink
   ============================================================ */

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

/* ── CSS CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  /* Colors — Base */
  --bg-base:          #0e0b1e;
  --bg-surface:       #1a1535;
  --bg-card:          #221d3a;
  --bg-card-hover:    #2a2448;
  --bg-overlay:       rgba(14, 11, 30, 0.92);

  /* Colors — Neon Accents */
  --color-cyan:       #00f5d4;
  --color-cyan-dim:   rgba(0, 245, 212, 0.15);
  --color-cyan-glow:  rgba(0, 245, 212, 0.4);
  --color-pink:       #ff2d78;
  --color-pink-dim:   rgba(255, 45, 120, 0.15);
  --color-pink-glow:  rgba(255, 45, 120, 0.4);

  /* Colors — Text */
  --text-primary:     #f0eeff;
  --text-secondary:   #a09cc0;
  --text-muted:       #5e5a7a;
  --text-inverse:     #0e0b1e;

  /* Colors — Semantic */
  --color-success:    #00f5d4;
  --color-error:      #ff2d78;
  --color-warning:    #ffd166;
  --color-info:       #6c63ff;

  /* Border */
  --border-subtle:    rgba(255, 255, 255, 0.06);
  --border-card:      rgba(255, 255, 255, 0.1);
  --border-active:    var(--color-cyan);

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border Radius */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card:      0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-elevated:  0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-cyan:      0 0 20px var(--color-cyan-glow), 0 0 60px rgba(0, 245, 212, 0.1);
  --shadow-pink:      0 0 20px var(--color-pink-glow), 0 0 60px rgba(255, 45, 120, 0.1);
  --shadow-inset:     inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* Glassmorphism */
  --glass-bg:         rgba(26, 21, 53, 0.7);
  --glass-border:     rgba(255, 255, 255, 0.08);
  --glass-blur:       blur(20px);

  /* Typography */
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs:     11px;
  --text-sm:     13px;
  --text-base:   15px;
  --text-md:     17px;
  --text-lg:     20px;
  --text-xl:     24px;
  --text-2xl:    30px;
  --text-3xl:    38px;
  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    800;
  --lh-tight:    1.2;
  --lh-snug:     1.4;
  --lh-normal:   1.6;

  /* Transitions */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-base:    1;
  --z-card:    10;
  --z-overlay: 100;
  --z-modal:   200;
  --z-toast:   300;
}

/* ── CSS RESET ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
svg { display: block; }

/* ── CUSTOM SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-surface); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-cyan); }

/* ── UTILITY: VISIBILITY ────────────────────────────────────── */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── UTILITY: FLEX & GRID ───────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* ── GLASS UTILITY ──────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

/* ── NEON TEXT ──────────────────────────────────────────────── */
.text-cyan { color: var(--color-cyan); }
.text-pink { color: var(--color-pink); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.fw-bold { font-weight: var(--fw-bold); }
.fw-semibold { font-weight: var(--fw-semibold); }

/* ============================================================
   COMPONENT: BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-cyan) 0%, #00c9b0 100%);
  color: var(--text-inverse);
  box-shadow: 0 2px 12px var(--color-cyan-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-cyan);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }

.btn-danger {
  background: var(--color-pink-dim);
  color: var(--color-pink);
  border: 1px solid var(--color-pink-dim);
}
.btn-danger:hover {
  background: var(--color-pink);
  color: white;
  box-shadow: var(--shadow-pink);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
}

.btn-icon-lg {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: var(--text-xl);
}

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.btn:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: 0s;
}

/* ============================================================
   COMPONENT: CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 245, 212, 0.3);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(0, 245, 212, 0.1);
  transform: translateY(-2px);
}

.card-song {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.card-song:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-cyan-dim);
  transform: translateX(4px);
}
.card-song-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface);
}
.card-song-info {
  flex: 1;
  min-width: 0;
}
.card-song-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-song-artist {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.card-song-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* ============================================================
   COMPONENT: BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.5;
}
.badge-cyan {
  background: var(--color-cyan-dim);
  color: var(--color-cyan);
  border: 1px solid rgba(0, 245, 212, 0.2);
}
.badge-pink {
  background: var(--color-pink-dim);
  color: var(--color-pink);
  border: 1px solid rgba(255, 45, 120, 0.2);
}
.badge-muted {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

/* ============================================================
   COMPONENT: TOASTS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  align-items: center;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-elevated);
  animation: toast-in var(--transition-base) ease both;
  pointer-events: all;
  white-space: nowrap;
}
.toast.fade-out { animation: toast-out 300ms ease forwards; }
.toast-success {
  background: var(--color-cyan);
  color: var(--text-inverse);
}
.toast-error {
  background: var(--color-pink);
  color: white;
}
.toast-info {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
}

/* ============================================================
   COMPONENT: SKELETON LOADERS
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
.skeleton-song {
  height: 64px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
}
.skeleton-text {
  height: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}
.skeleton-text.short { width: 60%; }

/* ============================================================
   COMPONENT: INPUT & SEARCH
   ============================================================ */
.input-search {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--transition-base);
  outline: none;
}
.input-search::placeholder { color: var(--text-muted); }
.input-search:focus {
  border-color: var(--color-cyan);
  box-shadow: 0 0 0 3px var(--color-cyan-dim);
}
.search-wrap {
  position: relative;
}
.search-wrap .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--text-base);
  pointer-events: none;
}

.input-pin {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  background: var(--bg-surface);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-base);
}
.input-pin:focus { border-color: var(--color-cyan); box-shadow: 0 0 0 3px var(--color-cyan-dim); }
.input-pin.error { border-color: var(--color-pink); animation: shake 0.4s ease; }

/* ============================================================
   COMPONENT: MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in var(--transition-base) ease;
}
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-elevated);
  width: 90%;
  max-width: 360px;
  animation: slide-up var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  text-align: center;
  margin-bottom: var(--space-6);
}

/* ============================================================
   COMPONENT: EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-6);
  text-align: center;
  color: var(--text-muted);
  gap: var(--space-3);
}
.empty-state .empty-icon { font-size: 40px; }
.empty-state p { font-size: var(--text-sm); line-height: var(--lh-snug); }

/* ============================================================
   COMPONENT: VOLUME SLIDER
   ============================================================ */
.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--bg-card-hover);
  outline: none;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 6px var(--color-cyan-glow);
  transition: transform var(--transition-fast);
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }

/* ============================================================
   COMPONENT: CONTEXT MENU
   ============================================================ */
.context-menu {
  position: fixed;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-2) 0;
  min-width: 180px;
  z-index: var(--z-overlay);
  box-shadow: var(--shadow-elevated);
  animation: fade-in var(--transition-fast) ease;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.context-menu-item:hover { background: var(--bg-card); color: var(--text-primary); }
.context-menu-divider { height: 1px; background: var(--border-subtle); margin: var(--space-2) 0; }
.context-menu-input {
  padding: var(--space-2) var(--space-3);
  margin: var(--space-2) var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  width: calc(100% - 24px);
  outline: none;
}
.context-menu-input:focus { border-color: var(--color-cyan); }

/* ============================================================
   LAYOUT: QUEUE ITEM
   ============================================================ */
.queue-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: all var(--transition-fast);
}
.queue-item:hover { border-color: var(--border-card); background: var(--bg-card-hover); }
.queue-item.is-playing {
  border-color: var(--color-cyan);
  background: var(--color-cyan-dim);
}
.queue-number {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.queue-item.is-playing .queue-number { color: var(--color-cyan); }

/* Queue item actions: play-now + remove */
.queue-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.queue-item:hover .queue-item-actions { opacity: 1; }

/* "▶ Ahora" button */
.btn-play-queue {
  background: linear-gradient(135deg, var(--color-cyan), #00b8a0);
  color: #000;
  font-size: 11px;
  font-weight: var(--fw-bold);
  width: 28px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}
.btn-play-queue:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px var(--color-cyan-glow);
}

/* ============================================================
   LAYOUT: SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.section-title {
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   ANIMATIONS (stubs populated in Plan 7.1)
   ============================================================ */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

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

/* ── PLAN 7.1 POLISH ANIMATIONS ─────────────────────────────── */

/* Neon hover glow pulse on active cards */
@keyframes hover-glow {
  0%, 100% { box-shadow: 0 0 8px var(--color-cyan-glow); }
  50%       { box-shadow: 0 0 24px var(--color-cyan-glow), 0 0 48px rgba(0,245,212,0.15); }
}

/* Ripple (already handled via CSS :active::after — stub kept for reference) */
@keyframes ripple {
  from { transform: scale(0); opacity: 0.6; }
  to   { transform: scale(3); opacity: 0; }
}

/* Countdown ring for TV overlay — driven by JS stroke-dashoffset */
@keyframes countdown-ring {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 220; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 0.25; }
  50%       { transform: scale(1.7); opacity: 0; }
}

/* Enhanced card hover — combined lift + glow */
.card-song:hover,
.search-result-card:hover {
  animation: hover-glow 2s ease-in-out infinite;
}

/* Queue item playing pulse */
.queue-item.is-playing {
  animation: hover-glow 2.5s ease-in-out infinite;
}

/* Play now button pulse */
.btn-play-now:hover {
  animation: hover-glow 1.5s ease-in-out infinite;
}

/* Smooth section transitions — no fill-mode so items are always visible */
.col-content > * {
  animation: fade-in 0.15s ease;
  flex-shrink: 0;
}

/* Modal entrance (spring) */
.modal-box {
  animation: slide-up var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Floating admin button pulse (subtle) */
.btn-admin-lock.is-admin {
  animation: hover-glow 3s ease-in-out infinite;
}

/* ── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── KARAOKE COUNTDOWN ANIMATIONS & STYLES ──────────────────── */

.karaoke-fill-text {
  font-size: 80px;
  font-weight: 900;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(to right, var(--color-cyan) 50%, rgba(255,255,255,0.2) 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 40px;
}
.tv-overlay:not(.hidden) .karaoke-fill-text {
  animation: fill-karaoke 5s linear forwards;
}

@keyframes fill-karaoke {
  0%   { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}

.film-countdown-container {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0,0,0,0.8) inset, 0 0 20px rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.5);
}

.film-crosshair-v {
  position: absolute;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
}

.film-crosshair-h {
  position: absolute;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
}

.film-circle-inner {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.film-sweep {
  position: absolute;
  top: 0; left: 50%;
  width: 50%; height: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 100%);
  transform-origin: 0% 100%;
  border-left: 2px solid rgba(255,255,255,0.6);
}
.tv-overlay:not(.hidden) .film-sweep {
  animation: sweep 1s linear infinite;
}

@keyframes sweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.film-number {
  font-size: 140px;
  font-weight: bold;
  color: white;
  z-index: 10;
  font-family: 'Courier New', Courier, monospace;
  text-shadow: 0 4px 15px rgba(0,0,0,0.9);
}

/* appended */

/* ============================================================
   LAYOUT: CONTROL.HTML — APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: var(--z-card);
}
.app-logo { display: flex; align-items: center; gap: var(--space-3); }
.app-logo-icon { font-size: var(--text-xl); }
.app-logo-text {
  font-size: var(--text-md);
  font-weight: var(--fw-black);
  background: linear-gradient(90deg, var(--color-cyan), var(--color-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grid-3col {
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border-subtle);
}
.col:last-child { border-right: none; }
.col-header {
  padding: var(--space-4) var(--space-5);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.col-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.playlist-category {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.playlist-category:hover { border-color: var(--border-card); }
.playlist-category.is-open { border-color: var(--color-cyan-dim); }
.playlist-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  user-select: none;
  min-height: 48px;
  transition: background var(--transition-fast);
}
.playlist-cat-header:hover { background: var(--bg-card-hover); }
.playlist-cat-title { font-size: var(--text-sm); font-weight: var(--fw-semibold); display: flex; align-items: center; gap: var(--space-2); }
.playlist-cat-arrow { font-size: var(--text-xs); color: var(--text-muted); transition: transform var(--transition-fast); }
.playlist-category.is-open .playlist-cat-arrow { transform: rotate(180deg); }
.playlist-cat-songs {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-2) var(--space-2);
  border-top: 1px solid var(--border-subtle);
}
.playlist-category.is-open .playlist-cat-songs { display: flex; }

.section-recommended {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-4);
  margin-top: var(--space-3);
}
.section-recommended .section-title { color: var(--color-cyan); }

.footer-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: var(--z-card);
  min-height: 68px;
}
.footer-song { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.footer-song-thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg-card); flex-shrink: 0; }
.footer-song-info { min-width: 0; }
.footer-song-title { font-size: var(--text-sm); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footer-song-meta { font-size: var(--text-xs); color: var(--text-muted); }
.footer-controls { display: flex; align-items: center; gap: var(--space-2); }
.footer-admin-controls { display: flex; align-items: center; gap: var(--space-3); }
.vol-wrap { display: flex; align-items: center; gap: var(--space-2); min-width: 100px; }
.vol-icon { font-size: var(--text-base); color: var(--text-muted); }

.btn-admin-lock {
  position: fixed;
  bottom: 80px;
  right: var(--space-5);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  z-index: var(--z-overlay);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  cursor: pointer;
}
.btn-admin-lock:hover { border-color: var(--color-pink); box-shadow: var(--shadow-pink); color: var(--color-pink); }
.btn-admin-lock.is-admin { background: var(--color-pink-dim); border-color: var(--color-pink); color: var(--color-pink); }

.search-result-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}
.search-result-card:hover { border-color: var(--border-card); background: var(--bg-card-hover); }
.search-result-thumb { width: 60px; height: 45px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: var(--bg-surface); }
.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.search-result-channel { font-size: var(--text-xs); color: var(--text-muted); }
.search-result-actions { display: flex; gap: var(--space-1); flex-shrink: 0; }
.btn-play-now {
  background: linear-gradient(135deg, var(--color-pink), #c0155a);
  color: white;
  box-shadow: 0 2px 10px var(--color-pink-glow);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
}
.btn-play-now:hover { transform: translateY(-1px); box-shadow: var(--shadow-pink); }

.tab-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-subtle);
  z-index: var(--z-card);
  height: 60px;
}
.tab-nav-inner { display: flex; height: 100%; }
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  font-family: var(--font-sans);
}
.tab-btn.active { color: var(--color-cyan); }
.tab-btn-icon { font-size: var(--text-lg); }

/* TV Screen */
.tv-shell { width: 100vw; height: 100dvh; overflow: hidden; position: relative; background: #000; }
#player-wrap { width: 100%; height: 100%; transition: opacity 0.5s ease; }
#player-wrap iframe { width: 100% !important; height: 100% !important; border: none; }
.tv-overlay { position: absolute; z-index: var(--z-overlay); pointer-events: none; }
#tv-activation { pointer-events: auto; cursor: pointer; }
#tv-activation.hidden { pointer-events: none; }
#overlay-next {
  bottom: var(--space-8); left: var(--space-8);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  max-width: 420px;
  animation: slide-up var(--transition-slow) ease;
}
.overlay-next-label { font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--color-cyan); text-transform: uppercase; letter-spacing: 2px; margin-bottom: var(--space-2); }
#next-title { font-size: var(--text-lg); font-weight: var(--fw-black); color: var(--text-primary); margin-bottom: var(--space-1); }
#next-artist { font-size: var(--text-sm); color: var(--text-secondary); }
#overlay-countdown {
  top: var(--space-6); right: var(--space-6);
  display: flex; align-items: center; justify-content: center;
  width: 80px; height: 80px;
}
.countdown-svg { transform: rotate(-90deg); }
.countdown-track { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 5; }
.countdown-progress {
  fill: none; stroke: var(--color-cyan); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 220; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px var(--color-cyan));
}
#countdown-number { position: absolute; font-size: var(--text-xl); font-weight: var(--fw-black); color: var(--text-primary); }

/* RESPONSIVE MOBILE & COMPRESSED DESKTOP */
@media (max-width: 1024px) {
  .tab-nav { display: block; }
  .grid-3col { display: block; overflow-y: auto; padding-bottom: 120px; }
  .col { display: none; }
  .col.tab-active { display: flex; min-height: calc(100dvh - 140px); }
  .footer-bar { grid-template-columns: 1fr auto; padding: var(--space-3) var(--space-4); bottom: 60px; position: fixed; left: 0; right: 0; }
  .footer-admin-controls { display: none; }
  .btn-admin-lock { bottom: 130px; }
  .app-header { padding: var(--space-3) var(--space-4); }
  #btn-header-tv { display: none !important; }
}
@media (max-width: 480px) {
  .app-logo-text { font-size: var(--text-base); }
  .footer-song-title { max-width: 140px; }
  .modal-box { padding: var(--space-6); }
}
