/**
 * Audio Controls Styles
 * Design moderno, responsive, accessibile
 */

/* Container principale */
.audio-controls {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle button (icona speaker) */
.audio-control-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c6ff, #00ffb8);
  box-shadow: 
    0 4px 12px rgba(0, 198, 255, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.audio-control-toggle:hover {
  transform: scale(1.08);
  box-shadow: 
    0 6px 20px rgba(0, 198, 255, 0.6),
    0 3px 10px rgba(0, 0, 0, 0.4);
}

.audio-control-toggle:active {
  transform: scale(0.95);
}

.audio-icon,
.audio-icon-muted {
  color: #003366;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.5));
}

.volume-waves {
  animation: pulseWaves 2s ease-in-out infinite;
}

@keyframes pulseWaves {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Pannello controlli */
.audio-control-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 280px;
  background: rgba(8, 19, 39, 0.96);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: slideUp 0.3s ease-out;
}

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

.audio-panel-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.audio-panel-header span {
  color: #00ffb8;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Riga controlli */
.audio-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.audio-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ffffff;
  flex-shrink: 0;
}

.audio-btn:hover {
  background: rgba(0, 198, 255, 0.2);
  border-color: rgba(0, 198, 255, 0.4);
  transform: translateY(-1px);
}

.audio-btn:active {
  transform: translateY(0);
}

/* Volume slider */
.volume-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c6ff, #00ffb8);
  box-shadow: 0 2px 6px rgba(0, 198, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(0, 198, 255, 0.7);
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c6ff, #00ffb8);
  box-shadow: 0 2px 6px rgba(0, 198, 255, 0.5);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(0, 198, 255, 0.7);
}

/* Volume value display */
.audio-volume-value {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 4px;
}

/* Play hint (quando autoplay è bloccato) */
.audio-play-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: rgba(8, 19, 39, 0.95);
  backdrop-filter: blur(16px);
  padding: 24px 32px;
  border-radius: 16px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: fadeInScale 0.4s ease-out;
  cursor: pointer;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.audio-hint-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #ffffff;
}

.audio-hint-content svg {
  color: #00ffb8;
  filter: drop-shadow(0 4px 12px rgba(0, 255, 184, 0.5));
}

.audio-hint-content p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
}

/* Responsive Mobile */
@media (max-width: 767px) {
  .audio-controls {
    bottom: 20px;
    right: 20px;
  }
  
  .audio-control-toggle {
    width: 50px;
    height: 50px;
  }
  
  .audio-control-panel {
    width: 260px;
    bottom: 64px;
  }
  
  .audio-btn {
    width: 32px;
    height: 32px;
  }
  
  .audio-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Mobile molto piccoli */
@media (max-width: 400px) {
  .audio-controls {
    bottom: 16px;
    right: 16px;
  }
  
  .audio-control-toggle {
    width: 46px;
    height: 46px;
  }
  
  .audio-control-panel {
    width: calc(100vw - 40px);
    max-width: 280px;
  }
}

/* Accessibilità: riduzione movimento */
@media (prefers-reduced-motion: reduce) {
  .audio-control-toggle,
  .audio-btn,
  .volume-slider::-webkit-slider-thumb,
  .volume-slider::-moz-range-thumb {
    transition: none;
  }
  
  .volume-waves {
    animation: none;
  }
  
  .audio-control-panel,
  .audio-play-hint {
    animation: none;
  }
}
