/* =============================================
   YT CrossMix - Spotify Dark Theme v2.0
   ============================================= */

/* CSS Variables */
:root {
    --spotify-green: #1DB954;
    --spotify-green-hover: #1ed760;
    --spotify-black: #121212;
    --spotify-dark: #181818;
    --spotify-card: #242424;
    --spotify-elevated: #2a2a2a;
    --spotify-border: rgba(255,255,255,0.08);
    --spotify-text: #ffffff;
    --spotify-text-secondary: #b3b3b3;
    --spotify-accent: #1DB954;
    --spotify-accent-dark: #158f3e;
   --spotify-border: rgba(255, 255, 255, 0.15);  
    --spotify-dark: #121212;  
    --font-main: 'Circular', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 500px;
    --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #020617, #0f172a);
    color: var(--spotify-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollbar personalizado estilo Spotify */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

/* =============================================
   HEADER
   ============================================= */
header {
     background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid var(--spotify-border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--spotify-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

header h3::before {
    content: '🎵';
    font-size: 1.2em;
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
main {
    display: grid;
    grid-template-columns: 340px 1fr 340px;
    gap: 12px; /* Aumentado de 8px a 12px */
    padding: 12px;
    flex: 1;
    height: calc(100vh - 56px - 48px);
    max-height: calc(100vh - 56px - 48px);
    overflow: hidden;
}

section {
     background: var(--spotify-dark);
   background: rgba(0, 0, 0, 0.7);
    border-radius: var(--radius-lg);
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

section h2 {
    display: none; /* Ocultamos los h2 originales, usamos nuestros propios headers */
}

/* =============================================
   PANEL DE BÚSQUEDA
   ============================================= */
#search-panel {
      display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-container {
    padding: 16px 16px 8px;
    position: relative;
}

#searchInput {
    width: 100%;
    background: var(--spotify-elevated);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--spotify-text);
    padding: 10px 16px 10px 42px;
    font-size: 0.875rem;
    font-family: var(--font-main);
    outline: none;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.search-container::before {
    content: '🔍';
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9em;
    pointer-events: none;
}

#searchInput:focus {
    background: #3a3a3a;
    box-shadow: 0 0 0 2px var(--spotify-green);
}

#searchInput::placeholder { color: var(--spotify-text-secondary); }

/* Géneros */
#genres-grid {
    padding: 8px 16px 12px;
    border-bottom: 1px solid var(--spotify-border);
}

.genres-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--spotify-text-secondary);
    margin-bottom: 8px;
}

.genres-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.genre-chip {
    background: var(--spotify-elevated);
    border: 1px solid var(--spotify-border);
    border-radius: var(--radius-pill);
    color: var(--spotify-text-secondary);
    padding: 5px 12px;
    font-size: 0.75rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}
/* paneles   */
.sidebar, .library, .player {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border-radius: 14px;
}
.sidebar *, .library * {
  border-color: rgba(255,255,255,0.06) !important;
}
/* botones */
button {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s ease;
}

button:hover {
  background: #22c55e;
  color: black;
  transform: scale(1.05);
}
/* play más visible */
button.play {
  background: #22c55e;
  color: black;
  transform: scale(1.15);
}
/* progreso */
.progress {
  height: 5px;
  background: #1f2937;
  border-radius: 10px;
}

.progress-fill {
  background: #22c55e;
}
/* texto */
.muted {
  color: #9ca3af;
}
.genre-chip:hover { background: #3a3a3a; color: var(--spotify-text); border-color: rgba(255,255,255,0.2); }
.genre-chip.active { background: var(--spotify-green); color: #000; font-weight: 700; border-color: transparent; }

.genre-icon { font-size: 0.9em; }

/* Búsquedas recientes */
#recent-searches {
    padding: 8px 16px;
    border-bottom: 1px solid var(--spotify-border);
}

.recent-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--spotify-text-secondary);
    margin-bottom: 6px;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--spotify-text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    text-decoration: underline;
}
.clear-btn:hover { color: var(--spotify-text); }

.recent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.recent-chip {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--spotify-border);
    border-radius: var(--radius-pill);
    color: var(--spotify-text-secondary);
    padding: 4px 10px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}
.recent-chip:hover { background: rgba(255,255,255,0.1); color: var(--spotify-text); }
.recent-chip i { font-size: 0.65em; opacity: 0.6; }

/* Resultados */
#resultsContainer {
    flex: 1;
    overflow-y: auto;
    min-height: 0; 
}
#tab-cola {
    overflow: hidden;
    
}
.tab-content:not(.active) {
    display: none !important;
}
.queue-item.drag-over {
    border-top: 2px solid var(--spotify-green);
    background: rgba(29,185,84,0.08);
}

.queue-item.dragging {
    opacity: 0.35;
    background: rgba(255,255,255,0.04);
}
#results { display: flex; flex-direction: column; }

/* Resultado estilo Spotify */
.result-spotify {
    display: grid;
    grid-template-columns: 24px 48px 1fr auto 32px 32px;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-spotify:hover { background: rgba(255,255,255,0.07); }

.result-num {
    font-size: 0.875rem;
    color: var(--spotify-text-secondary);
    text-align: center;
    min-width: 20px;
}

.result-thumb-container {
    position: relative;
    width: 48px;
    height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.result-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter var(--transition-fast);
}

.result-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    font-size: 0.8em;
    color: white;
}

.result-spotify:hover .result-play-overlay { opacity: 1; }
.result-spotify:hover .result-num { display: none; }

.result-info { min-width: 0; }
.result-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--spotify-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.result-artist {
    font-size: 0.75rem;
    color: var(--spotify-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-duration {
    font-size: 0.75rem;
    color: var(--spotify-text-secondary);
    white-space: nowrap;
}

.result-add-btn,
.result-play-now-btn {
    background: none;
    border: none;
    color: var(--spotify-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: color var(--transition-fast), transform var(--transition-fast);
    opacity: 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.result-spotify:hover .result-add-btn,
.result-spotify:hover .result-play-now-btn { opacity: 1; }
.result-add-btn:hover { color: var(--spotify-green); transform: scale(1.1); }
.result-play-now-btn:hover { color: var(--spotify-text); transform: scale(1.1); }

/* Estados de búsqueda */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--spotify-text-secondary);
    font-size: 0.875rem;
}

.search-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--spotify-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.no-results-spotify {
    text-align: center;
    padding: 40px 20px;
    color: var(--spotify-text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.no-results-spotify i { font-size: 2.5em; opacity: 0.3; }
.no-results-spotify p { font-size: 0.95rem; font-weight: 600; color: var(--spotify-text); }
.no-results-spotify small { font-size: 0.8rem; }

/* =============================================
   PANEL REPRODUCTOR - Centro
   ============================================= */
#player-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--spotify-black);
}

/* Now Playing - Componente principal */
#spotify-now-playing {
    flex: 1;
    overflow: hidden;  
    min-height: 0;
}

#now-playing-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #1DB954 0%, #121212 100%);
    opacity: 0.6;
    transition: background 1.5s ease;
    pointer-events: none;
}

/* Artwork */
.np-artwork-container {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

.np-artwork-shadow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 40px;
    background: rgba(0,0,0,0.6);
    filter: blur(20px);
    border-radius: 50%;
}

.np-artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.np-artwork-overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Info */
.np-info {
    width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.np-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.np-texts { flex: 1; min-width: 0; }

.np-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--spotify-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Texto con scroll para títulos largos */
.np-title.scrolling-text {
    animation: scrollText 8s linear infinite;
    padding-right: 30px;
}

@keyframes scrollText {
    0%, 15% { transform: translateX(0); }
    85%, 100% { transform: translateX(-50%); }
}

.np-artist {
    font-size: 0.85rem;
    color: var(--spotify-text-secondary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-action-btn {
    background: none;
    border: none;
    color: var(--spotify-text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color var(--transition-fast), transform var(--transition-bounce);
    flex-shrink: 0;
}
.np-action-btn:hover { color: var(--spotify-text); transform: scale(1.15); }
.np-action-btn .fas.fa-heart { color: var(--spotify-green); }

/* Barra de progreso */
.np-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.np-time {
    font-size: 0.7rem;
    color: var(--spotify-text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 35px;
}

.np-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-pill);
    cursor: pointer;
    position: relative;
    transition: height var(--transition-fast);
}

.np-progress-bar:hover { height: 6px; }

.np-progress-fill {
    height: 100%;
    background: var(--spotify-text);
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast);
    pointer-events: none;
}

.np-progress-bar:hover .np-progress-fill { background: var(--spotify-green); }

.np-progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    background: var(--spotify-text);
    border-radius: 50%;
    pointer-events: none;
    transition: transform var(--transition-fast);
}

.np-progress-bar:hover .np-progress-thumb { transform: translate(-50%, -50%) scale(1); }

/* Controles principales */
.np-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.np-ctrl-btn {
    background: none;
    border: none;
    color: var(--spotify-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.np-ctrl-btn:hover { color: var(--spotify-text); background: rgba(255,255,255,0.08); }
.np-ctrl-btn.active { color: var(--spotify-green); }

.np-play-btn {
    background: var(--spotify-text) !important;
    color: var(--spotify-black) !important;
    width: 48px;
    height: 48px;
    font-size: 1.1rem !important;
    border-radius: 50% !important;
    transition: transform var(--transition-bounce), background var(--transition-fast) !important;
}
.np-play-btn:hover {
    transform: scale(1.06) !important;
    background: #fff !important;
}

/* Volumen */
.np-volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.np-vol-icon {
    color: var(--spotify-text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.np-volume-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-pill);
    cursor: pointer;
    position: relative;
}
.np-volume-bar:hover { height: 6px; }

.np-volume-fill {
    height: 100%;
    background: var(--spotify-text);
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast);
}
.np-volume-bar:hover .np-volume-fill { background: var(--spotify-green); }

.np-volume-thumb {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    transition: transform var(--transition-fast);
}
.np-volume-bar:hover .np-volume-thumb { transform: translate(50%, -50%) scale(1); }

.np-crossfade-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--spotify-text-secondary);
    background: rgba(255,255,255,0.06);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
}
.np-crossfade-label i { color: var(--spotify-green); font-size: 0.65em; }

/* Video container embebido (oculto visualmente, pero activo) */
.playlist-url-input { padding: 0 16px; }
.playlist-url-input input {
    width: 100%;
    background: var(--spotify-elevated);
    border: 1px solid var(--spotify-border);
    border-radius: var(--radius-md);
    color: var(--spotify-text);
    padding: 8px 12px;
    font-size: 0.8rem;
    outline: none;
    margin: 6px 0;
    font-family: var(--font-main);
}
.playlist-url-input input:focus { border-color: var(--spotify-green); }
.playlist-url-input input::placeholder { color: var(--spotify-text-secondary); }

.add-to-playlist {
    margin: 0 16px 8px;
    background: var(--spotify-green);
    color: #000;
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 20px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    width: calc(100% - 32px);
    font-family: var(--font-main);
}
.add-to-playlist:hover { background: var(--spotify-green-hover); transform: scale(1.01); }

#videoContainer {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: none; /* Inicialmente oculto */
}

#controls {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    justify-content: center;
}

#iniciarButton, #mixButton {
    background: var(--spotify-green);
    color: #000;
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 24px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-main);
}
#iniciarButton:hover, #mixButton:hover { background: var(--spotify-green-hover); transform: scale(1.02); }
#iniciarButton:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
#mixButton { background: var(--spotify-elevated); color: var(--spotify-text); border: 1px solid var(--spotify-border); }
#mixButton:hover { background: #3a3a3a; }

/* =============================================
   PANEL BIBLIOTECA/COLA
   ============================================= */
#playlist-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 8px;
    border-bottom: 1px solid var(--spotify-border);
}

.panel-header-tabs h2 { display: block !important; font-size: 0.875rem; font-weight: 700; }

.tabs-container {
    display: flex;
    padding: 8px 16px;
    border-bottom: 1px solid var(--spotify-border);
    gap: 12px;             /* CAMBIADO de 0 a 12px */
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs-container::-webkit-scrollbar {
    display: none; /* Oculta scroll en Chrome/Safari */
}
.tab-btn {
    background: none;
    border: none;
    color: var(--spotify-text-secondary);
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
   white-space: nowrap;   /* Evita que el texto se amontone */
    flex-shrink: 0;
}
.hidden { display: none !important; }
.tab-btn:hover { color: var(--spotify-text); }
.tab-btn.active { color: var(--spotify-text); border-bottom-color: var(--spotify-green); }

.tab-content { display: none; flex: 1; overflow-y: auto; }
.tab-content.active { display: flex; flex-direction: column; }

/* Auth buttons */
#auth-controls {
    display: flex;
    gap: 6px;
}

.auth-btn {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-main);
}

.google-login { background: #4285F4; color: white; }
.google-login:hover { background: #3367d6; }
.google-logout { background: var(--spotify-elevated); color: var(--spotify-text-secondary); border: 1px solid var(--spotify-border); }
.google-logout:hover { color: var(--spotify-text); }

/* =============================================
   COLA DE REPRODUCCIÓN
   ============================================= */
#playlistContainer {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px 4px;
}

.queue-count {
    font-size: 0.75rem;
    color: var(--spotify-text-secondary);
    font-weight: 600;
}

.queue-clear-btn {
    background: none;
    border: 1px solid var(--spotify-border);
    color: var(--spotify-text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}
.queue-clear-btn:hover { color: #f44336; border-color: #f44336; }

.queue-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--spotify-text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.queue-empty i { font-size: 3em; opacity: 0.2; }
.queue-empty p { font-size: 1rem; font-weight: 600; color: var(--spotify-text); }
.queue-empty small { font-size: 0.8rem; }

.queue-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--spotify-text-secondary);
    padding: 12px 16px 4px;
}

/* Item de cola */
.queue-item {
    display: grid;
    grid-template-columns: 28px 48px 1fr auto 28px;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-radius: var(--radius-sm);
    position: relative;
}

.queue-item:hover { background: rgba(255,255,255,0.06); }
.queue-item--playing { background: rgba(29,185,84,0.08); }
.queue-item--playing:hover { background: rgba(29,185,84,0.12); }

.queue-item.dragging { opacity: 0.4; }
.queue-item.drag-over { border-top: 2px solid var(--spotify-green); }

.queue-item-left {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}

.queue-num {
    font-size: 0.82rem;
    color: var(--spotify-text-secondary);
}

/* Indicador de reproducción animado (barras verdes tipo Spotify) */
.queue-playing-indicator {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.queue-playing-indicator span {
    width: 3px;
    background: var(--spotify-green);
    border-radius: 2px;
    animation: soundbar 0.8s ease-in-out infinite alternate;
}
.queue-playing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.queue-playing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes soundbar {
    0% { height: 4px; }
    100% { height: 14px; }
}

.queue-thumb-wrap {
    position: relative;
    width: 48px;
    height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.queue-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-hover-play {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: white;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.queue-item:hover .queue-hover-play { opacity: 1; }

.queue-info { min-width: 0; }
.queue-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--spotify-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.queue-title--active { color: var(--spotify-green); }

.queue-artist {
    font-size: 0.72rem;
    color: var(--spotify-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.queue-duration {
    font-size: 0.75rem;
    color: var(--spotify-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.queue-delete-btn {
    background: none;
    border: none;
    color: var(--spotify-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    opacity: 0;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.queue-item:hover .queue-delete-btn { opacity: 1; }
.queue-delete-btn:hover { color: #f44336; background: rgba(244,67,54,0.1); }

/* =============================================
   LETRAS - Estilo Spotify Lyrics
   ============================================= */
#tab-lyrics {
   position: relative;
    height: 100%;
    background: var(--spotify-black); /* Evita que se vea lo de atrás */
    z-index: 1;   
}

.lyrics-container {
    height: 100%;
    overflow-y: auto;
    background: var(--spotify-black);
    position: relative;
    padding-bottom: 40px;
}

.lyrics-header {
    display: flex;
    align-items: center;
    padding: 16px 20px 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 12px;
}

.lyrics-source-badge {
    background: rgba(255,255,255,0.1);
    color: var(--spotify-text-secondary);
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.lyrics-loading, .related-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--spotify-text-secondary);
    font-size: 0.875rem;
}

.lyrics-spinner, .related-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--spotify-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.lyrics-body { padding: 0 20px 40px; }

.lyrics-body.synced { text-align: left; }

.lyric-line {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    color: rgba(255,255,255,0.25);
    margin: 8px 0;
    transition: color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    cursor: default;
    letter-spacing: -0.01em;
}

.lyric-line.active {
    color: var(--spotify-text);
    transform: scale(1.02);
}

.lyric-line:hover { color: rgba(255,255,255,0.5); }

.plain-lyrics {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.7);
    white-space: pre-line;
}

/* =============================================
   RELACIONADOS
   ============================================= */
#tab-related { overflow: hidden; }

#relatedVideosList {
    height: 100%;
    overflow-y: auto;
    padding: 8px 0;
}

.related-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--spotify-text-secondary);
    padding: 8px 16px;
}

.related-grid { display: flex; flex-direction: column; }

.related-card {
    display: grid;
    grid-template-columns: 80px 1fr 28px;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.related-card:hover { background: rgba(255,255,255,0.06); }

.related-thumb {
    position: relative;
    width: 80px;
    height: 45px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }

.related-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    color: white;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.related-card:hover .related-play-overlay { opacity: 1; }

.related-info { min-width: 0; }
.related-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--spotify-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.related-artist {
    font-size: 0.72rem;
    color: var(--spotify-text-secondary);
    margin-top: 2px;
}

.related-add-btn {
    background: none;
    border: none;
    color: var(--spotify-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    opacity: 0;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.related-card:hover .related-add-btn { opacity: 1; }
.related-add-btn:hover { color: var(--spotify-green); background: rgba(29,185,84,0.1); }

/* =============================================
   YT PLAYLISTS
   ============================================= */
#user-playlists-overview { padding: 8px; }

.yt-playlist-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.yt-playlist-card {
    background: var(--spotify-elevated);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    border: 1px solid var(--spotify-border);
}
.yt-playlist-card:hover { background: #3a3a3a; transform: translateY(-2px); }

.card-image { position: relative; aspect-ratio: 16/9; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }

.video-count {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.85);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.card-info { padding: 8px 10px; }
.card-info h4 {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--spotify-text);
}

.import-btn {
    margin-top: 6px;
    background: var(--spotify-green);
    color: #000;
    border: none;
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast);
    width: 100%;
    font-family: var(--font-main);
}
.import-btn:hover { background: var(--spotify-green-hover); }

/* Vista detalles playlist */
.details-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
    border-bottom: 1px solid var(--spotify-border);
    background: var(--spotify-dark);
}

#back-to-playlists-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--spotify-text);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}
#back-to-playlists-btn:hover { background: rgba(255,255,255,0.15); }

#details-playlist-title {
    flex: 1;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-action-btn {
    background: var(--spotify-green);
    border: none;
    color: #000;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast);
    white-space: nowrap;
    font-family: var(--font-main);
}
.header-action-btn:hover { background: var(--spotify-green-hover); }

#details-video-list-container {
    flex: 1;
    overflow-y: auto;
}

.detail-video-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background var(--transition-fast);
}
.detail-video-item:hover { background: rgba(255,255,255,0.04); }
.detail-video-item img { width: 64px; height: 36px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.detail-video-info h5 { font-size: 0.8rem; color: var(--spotify-text); margin: 0 0 2px; }
.detail-video-info p { font-size: 0.7rem; color: var(--spotify-text-secondary); margin: 0; }
.detail-video-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background var(--transition-fast);
    position: relative;
}
.detail-video-item:hover { background: rgba(255,255,255,0.06); }

.detail-add-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--spotify-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    padding: 4px;
    flex-shrink: 0;
}
.detail-video-item:hover .detail-add-btn {
    opacity: 1;
    color: var(--spotify-green);
}
/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.spotify-toast {
    background: #333;
    color: var(--spotify-text);
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-main);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    max-width: 320px;
    text-align: center;
}

.spotify-toast.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--spotify-text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.empty-state i { font-size: 2.5em; opacity: 0.25; }
.empty-state p { font-size: 0.9rem; font-weight: 600; color: var(--spotify-text); }
.empty-state small { font-size: 0.78rem; }

/* =============================================
   EFECTOS DE FADE (Crossfade visual)
   ============================================= */
.fade-out { animation: playerFadeOut 1.5s ease forwards; }
.fade-in { animation: playerFadeIn 1.5s ease forwards; }

@keyframes playerFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes playerFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    background: rgba(0,0,0,0.95);
    border-top: 1px solid var(--spotify-border);
    padding: 12px 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--spotify-text-secondary);
}

footer a { color: var(--spotify-green); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
    main {
        grid-template-columns: 300px 1fr;
        grid-template-rows: auto auto;
        height: auto;
        overflow: auto;
    }

    #search-panel { grid-column: 1; grid-row: 1; max-height: 500px; }
    #player-panel { grid-column: 2; grid-row: 1; }
    #playlist-panel { grid-column: 1 / -1; grid-row: 2; max-height: 500px; }
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        padding: 4px;
        gap: 4px;
        height: auto;
        overflow-y: auto;
    }

    #search-panel, #player-panel, #playlist-panel {
        grid-column: 1;
        max-height: 450px;
    }

    #player-panel { max-height: auto; }

    .np-artwork-container { width: 160px; height: 160px; }
    .lyric-line { font-size: 1.2rem; }
}
/* Limpieza de elementos obsoletos */
#iniciarButton { display: none !important; }

/* Centrar controles restantes */
#controls {
    display: flex;
    justify-content: center;
    padding: 6px 16px 12px;
}

/* Estado del botón play cuando está desactivado */
#np-play-pause-btn {
    transition: opacity 0.3s ease, transform 0.2s ease;
}
