/* ============================================
   CLARISSA CUNHA — WEDDING MUSIC BUTTON
   Botão flutuante para controlar música
   ============================================ */

/* Botão de música flutuante */
.cc-music-btn {
  position: fixed;
  bottom: 100px; /* Acima do WhatsApp */
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cc-teal) 0%, var(--cc-teal-deep) 100%);
  border: none;
  box-shadow: 0 8px 24px rgba(107, 166, 161, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.cc-music-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(107, 166, 161, 0.5);
}

.cc-music-btn:active {
  transform: translateY(-2px) scale(0.98);
}

/* Ícones */
.cc-music-btn svg {
  position: absolute;
  color: white;
  transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cc-music-btn .icon-sound {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.cc-music-btn .icon-mute {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

/* Estado mutado */
.cc-music-btn.is-muted {
  background: linear-gradient(135deg, var(--cc-ink-soft) 0%, var(--cc-ink) 100%);
  box-shadow: 0 8px 24px rgba(42, 47, 58, 0.3);
}

.cc-music-btn.is-muted:hover {
  box-shadow: 0 12px 32px rgba(42, 47, 58, 0.4);
}

.cc-music-btn.is-muted .icon-sound {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

.cc-music-btn.is-muted .icon-mute {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Animação das ondas sonoras */
.cc-music-btn:not(.is-muted) .wave {
  animation: soundWave 1.5s ease-in-out infinite;
}

.cc-music-btn:not(.is-muted) .wave-1 {
  animation-delay: 0s;
}

.cc-music-btn:not(.is-muted) .wave-2 {
  animation-delay: 0.2s;
}

@keyframes soundWave {
  0%, 100% {
    opacity: 0.4;
    stroke-width: 2;
  }
  50% {
    opacity: 1;
    stroke-width: 2.5;
  }
}

/* Label (oculto por padrão, aparece no hover) */
.cc-music-btn .label {
  position: absolute;
  right: 68px;
  background: var(--cc-ink);
  color: var(--cc-cream);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--ff-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(42, 47, 58, 0.2);
}

.cc-music-btn:hover .label {
  opacity: 1;
  transform: translateX(0);
}

/* Indicador de "tocando" */
.cc-music-btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: pulse 2s ease-out infinite;
}

.cc-music-btn:not(.is-muted)::before {
  opacity: 0.3;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .cc-music-btn {
    width: 52px;
    height: 52px;
    bottom: 90px; /* Ajustar para não sobrepor WhatsApp */
    right: 24px;
  }

  .cc-music-btn svg {
    width: 22px;
    height: 22px;
  }

  .cc-music-btn .label {
    right: 64px;
    font-size: 11px;
    padding: 6px 12px;
  }
}

/* Acessibilidade */
.cc-music-btn:focus-visible {
  outline: 3px solid var(--cc-teal);
  outline-offset: 4px;
}

/* Animação de entrada */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cc-music-btn {
  animation: slideInRight 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 500ms both;
}

/* Tooltip melhorado */
.cc-music-btn::after {
  content: attr(aria-label);
  position: absolute;
  right: 68px;
  background: var(--cc-ink);
  color: var(--cc-cream);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--ff-sans);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(42, 47, 58, 0.2);
  display: none; /* Usar label ao invés */
}

/* Efeito ripple ao clicar */
.cc-music-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.cc-music-btn:active::after {
  animation: ripple 600ms ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cc-music-btn,
  .cc-music-btn *,
  .cc-music-btn::before,
  .cc-music-btn::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
