@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Rajdhani:wght@300;400;500;600;700&family=Exo+2:ital,wght@0,300;0,400;0,600;1,400&display=swap');

/* ============================================================
   DJ APP · C&H PRODUCCIONES — Sistema de diseño "neón premium"
   ============================================================ */
:root {
  /* Paleta — neón refinado, más brillante */
  --neon-cyan:   #34ecff;
  --neon-pink:   #ff5097;
  --neon-purple: #c061ff;
  --neon-yellow: #ffdb5c;
  --neon-green:  #3dff97;

  /* Superficies "oscuro luminoso": fondo navy, tarjetas más claras */
  --dark-bg:     #12142e;
  --dark-card:   #1e2247;
  --dark-card-2: #262b56;
  --dark-border: #3a4080;

  --text-primary: #f4f5ff;
  --text-second:  #d2d5f7;   /* texto secundario legible */
  --text-muted:   #a8accd;   /* gris azulado con buen contraste */

  --gradient-main: linear-gradient(135deg, #22e8ff, #b14bff, #ff3d86);
  --gradient-btn:  linear-gradient(135deg, #ff3d86, #b14bff);

  --shadow-neon: 0 8px 30px rgba(0,0,0,0.5), 0 0 24px rgba(34,232,255,0.18);
  --shadow-pink: 0 8px 30px rgba(0,0,0,0.5), 0 0 24px rgba(255,61,134,0.28);
  --shadow-card: 0 10px 30px rgba(0,0,0,0.45);

  /* Escala de espaciado */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --tap: 44px; /* área táctil mínima accesible */
}

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

html { -webkit-text-size-adjust: 100%; }

html, body {
  font-family: 'Rajdhani', sans-serif;
  background:
    radial-gradient(120vmax 80vmax at 80% -10%, rgba(192,97,255,0.16) 0%, transparent 55%),
    radial-gradient(110vmax 70vmax at 0% 110%, rgba(52,236,255,0.12) 0%, transparent 55%),
    linear-gradient(180deg, #181b3d 0%, var(--dark-bg) 60%, #0e1026 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ===== TIPOGRAFÍA ===== */
h1, h2, h3 { font-family: 'Orbitron', monospace; letter-spacing: 0.04em; line-height: 1.2; }

.neon-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.neon-glow { color: var(--neon-cyan); text-shadow: 0 0 12px rgba(34,232,255,0.7); }

a { color: var(--neon-cyan); }

/* ===== FOCO ACCESIBLE ===== */
:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}

/* ===== CARDS ===== */
.card {
  background: linear-gradient(180deg, var(--dark-card-2), var(--dark-card));
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-card);
}

/* ===== BOTONES ===== */
.btn {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 22px;
  min-height: var(--tap);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}

.btn-primary {
  background: var(--gradient-btn);
  color: #fff;
  box-shadow: var(--shadow-pink);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 36px rgba(255,61,134,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-cyan { background: rgba(34,232,255,0.08); color: var(--neon-cyan); border: 1px solid rgba(34,232,255,0.5); }
.btn-cyan:hover { background: rgba(34,232,255,0.16); box-shadow: 0 0 18px rgba(34,232,255,0.35); }

.btn-green { background: rgba(43,255,136,0.08); color: var(--neon-green); border: 1px solid rgba(43,255,136,0.5); font-size: 0.7rem; padding: 9px 16px; }
.btn-green:hover { background: rgba(43,255,136,0.18); }

.btn-yellow { background: rgba(255,210,61,0.08); color: var(--neon-yellow); border: 1px solid rgba(255,210,61,0.5); font-size: 0.7rem; padding: 9px 16px; }
.btn-yellow:hover { background: rgba(255,210,61,0.18); }

.btn-sm { padding: 8px 14px; font-size: 0.65rem; min-height: 36px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ===== INPUTS ===== */
input[type="text"], input[type="password"], input[type="search"], textarea, select {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  padding: 13px 16px;
  min-height: var(--tap);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(34,232,255,0.18);
}
input::placeholder { color: var(--text-muted); }

/* ===== STATUS BADGES ===== */
.status-badge {
  font-family: 'Orbitron', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pending { background: rgba(255,210,61,0.15); color: var(--neon-yellow); border: 1px solid rgba(255,210,61,0.4); }
.status-queued  { background: rgba(34,232,255,0.15); color: var(--neon-cyan);  border: 1px solid rgba(34,232,255,0.4); }
.status-played  { background: rgba(43,255,136,0.15); color: var(--neon-green); border: 1px solid rgba(43,255,136,0.4); }

/* ===== SONG CARD ===== */
.song-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.song-card:hover { background: rgba(34,232,255,0.05); border-color: rgba(34,232,255,0.2); }
.song-card.played { opacity: 0.5; }
.song-card.queued { border-color: rgba(34,232,255,0.35); background: rgba(34,232,255,0.05); }

.song-thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--dark-border);
}
.song-thumb-placeholder {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--dark-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.song-info { flex: 1; min-width: 0; }
.song-title { font-weight: 600; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { color: var(--text-second); font-size: 0.82rem; }
.song-requester { color: var(--neon-cyan); font-size: 0.76rem; margin-top: 2px; }

/* ===== HEADER GENÉRICO ===== */
.app-header {
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--dark-border);
  position: sticky; top: 0;
  background: rgba(6,6,15,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 100;
}
.app-logo { height: 40px; object-fit: contain; }

/* ===== SEARCH RESULTS ===== */
.search-results {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--dark-card-2);
  border: 1px solid var(--dark-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 24px 48px rgba(0,0,0,0.85);
}
.search-result-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.18s;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  min-height: var(--tap);
}
.search-result-item:hover, .search-result-item:active { background: rgba(34,232,255,0.08); }
.search-result-item img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.result-title { font-size: 0.9rem; font-weight: 500; }
.result-artist { font-size: 0.76rem; color: var(--text-muted); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; background: rgba(0,0,0,0.3); padding: 4px; border-radius: 12px; border: 1px solid var(--dark-border); }
.tab-btn {
  flex: 1; padding: 10px 14px; background: transparent; border: none; border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
  font-family: 'Orbitron', monospace; font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: all 0.25s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab-btn.active { background: var(--gradient-btn); color: #fff; box-shadow: var(--shadow-pink); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--dark-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-purple); }

/* ===== LOADER ===== */
.loader {
  display: inline-block;
  width: 22px; height: 22px;
  border: 2px solid var(--dark-border);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(140px);
  background: var(--dark-card-2);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Orbitron', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-neon);
  max-width: calc(100vw - 32px);
  text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { border-color: var(--neon-pink); color: var(--neon-pink); box-shadow: var(--shadow-pink); }

/* ===== WAVEFORM ===== */
.waveform { display: flex; align-items: center; gap: 3px; height: 20px; }
.wave-bar { width: 3px; background: currentColor; border-radius: 2px; animation: wave 1.2s ease-in-out infinite; }
.wave-bar:nth-child(1) { animation-delay: 0s;   height: 8px; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; height: 20px; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; height: 14px; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; height: 10px; }
@keyframes wave { 0%,100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }

/* ===== COUNTER BADGE ===== */
.counter-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 12px;
  background: var(--gradient-btn);
  color: #fff;
  font-family: 'Orbitron', monospace; font-size: 0.68rem; font-weight: 700;
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-muted); }
.empty-state .emoji { font-size: 2.6rem; margin-bottom: 10px; }
.empty-state p { font-size: 0.92rem; }

/* ===== ANIMACIÓN ENTRADA ===== */
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== REDUCIR MOVIMIENTO (accesibilidad) ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
