/* ════════════════════════════════════════════════════════════
   REPRODUCTOR FLOTANTE — Mini Bar v1 (AJUSTADO Y CORREGIDO)
   ════════════════════════════════════════════════════════════ */

.player-wrapper {
  position: fixed;
  bottom: 140px;  /* ← ↑ Subido más abajo para no chocar con chatbot */
  left: 30px;
  z-index: 9998;
  pointer-events: auto;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  animation: playerSlideIn 0.6s cubic-bezier(0.34,1.56,0.64,1) 1.5s both; 
}

/* ── Estado minimizado ── */
.player-wrapper.is-minimized .player-bar {
  width: 85px; /* ← Aumentado para que quepan los botones sin cortarse */
  padding: 10px 14px;
  overflow: hidden;
  justify-content: center;
}

.player-wrapper.is-minimized .player-info,
.player-wrapper.is-minimized .player-progress,
.player-wrapper.is-minimized .player-volume,
.player-wrapper.is-minimized .player-icon { 
  display: none; 
}

.player-wrapper.is-minimized .player-minimize { 
  transform: rotate(180deg);
  margin-left: 0;
  color: #fff;
  font-size: 18px;
}

.player-wrapper.is-minimized .player-btn {
  margin-left: 8px; /* ← Separa el play del botón de maximizar */
}

/* ── Barra principal ── */
.player-bar {
  box-sizing: border-box; /* ← ✅ Añadido para que el padding no rompa el width */
  display: flex;
  align-items: center;
  gap: 8px;  /* ← ↓ Reducido de 10px */
  width: 300px;
  padding: 10px 14px;
  background: rgba(10,14,30,0.97);
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 50px;
  backdrop-filter: blur(12px);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.04),
    0 0 20px rgba(99,102,241,0.15);
  transition: 
    width 0.4s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* Glow al reproducir */
.player-bar.is-playing {
  border-color: rgba(236,72,153,0.5);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.04),
    0 0 25px rgba(236,72,153,0.2);
}

/* ── Icono de nota ── */
.player-icon {
  color: #6366f1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}
.player-bar.is-playing .player-icon {
  color: #ec4899;
  animation: noteFloat 1.5s ease-in-out infinite alternate;
}
@keyframes noteFloat {
  0%   { transform: translateY(0) rotate(-5deg); }
  100% { transform: translateY(-3px) rotate(5deg); }
}

/* ── Info ── */
.player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;  /* ← ✅ Usa todo el espacio disponible */
  overflow: hidden;
}
.player-title {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;  /* ← ↓ Reducido */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-time {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* ── Barra de progreso ── */
.player-progress {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  min-width: 50px;  /* ← ↓ Reducido */
  max-width: 120px; /* ← ✅ Limita ancho máximo */
}
.player-progress:hover { height: 5px; }
.player-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  border-radius: 10px;
  transition: width 0.1s linear;
  pointer-events: none;
}
.player-progress-dot {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px; height: 10px;
  background: #ec4899;
  border-radius: 50%;
  box-shadow: 0 0 8px #ec4899;
  transition: transform 0.2s ease, left 0.1s linear;
  pointer-events: none;
}
.player-progress:hover .player-progress-dot { 
  transform: translate(-50%, -50%) scale(1); 
}

/* ── Botón play/pause ── */
.player-btn {
  flex-shrink: 0;
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  box-shadow: 0 0 0 rgba(236,72,153,0);
}
.player-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(236,72,153,0.5);
}
.player-btn:active { transform: scale(0.9); }

/* ── Volumen ── */
.player-volume {
  display: flex;
  align-items: center;
  gap: 4px;  /* ← ↓ Reducido */
  flex-shrink: 0;
}
.player-mute {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}
.player-mute:hover { color: #fff; }
.player-mute.is-muted { color: rgba(255,255,255,0.15); }

.player-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 45px;  /* ← ↓ Reducido */
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}
.player-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  background: #6366f1;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.player-vol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.4);
  background: #ec4899;
}

/* FIX: Botón minimizar siempre visible */
.player-minimize {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 0 2px 0;
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.3s ease;
  order: 1;  /* ← ✅ Mueve al inicio */
  z-index: 1;
}

/* ── Entrada al cargar ── */
@keyframes playerSlideIn {
  from { transform: translateX(-120%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .player-wrapper { 
    bottom: 120px; 
    left: 20px; 
  }
  .player-bar { 
    width: 260px; 
    padding: 8px 12px;  /* ← ↓ Más compacto en móvil */
  }
  .player-vol-slider { width: 35px; }
  .player-title { font-size: 10px; }
}