/* ═══════════════════════════════════════════════════════════════
   NOCTURNA 8D — Botão Premium de Áudio Espacial
   Salvar em: /assets/css/nocturna-8d.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Botão base ── */
.btn-8d {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(123, 60, 255, 0.28);
  background: rgba(123, 60, 255, 0.08);
  color: rgba(180, 140, 255, 0.80);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    transform 140ms ease,
    box-shadow 300ms ease;
  flex-shrink: 0;
  outline: none;
}

.btn-8d:hover {
  transform: translateY(-1px);
  border-color: rgba(123, 60, 255, 0.50);
  background: rgba(123, 60, 255, 0.14);
  color: rgba(210, 170, 255, 0.95);
}

.btn-8d:focus-visible {
  box-shadow: var(--focus);
}

/* ── SVG dentro do botão ── */
.btn-8d__icon {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
  transition: opacity 200ms ease;
}

/* ── Tooltip ── */
.btn-8d::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10, 4, 28, 0.92);
  border: 1px solid rgba(123, 60, 255, 0.30);
  color: rgba(220, 200, 255, 0.90);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(8px);
  z-index: 200;
}

.btn-8d:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Estado ATIVO ── */
.btn-8d.is-active {
  border-color: rgba(139, 92, 246, 0.70);
  background: rgba(109, 40, 217, 0.20);
  color: #c4b5fd;
  box-shadow:
    0 0 12px rgba(124, 58, 237, 0.35),
    0 0 24px rgba(124, 58, 237, 0.15),
    inset 0 0 8px rgba(139, 92, 246, 0.10);
}

.btn-8d.is-active:hover {
  box-shadow:
    0 0 16px rgba(124, 58, 237, 0.50),
    0 0 32px rgba(124, 58, 237, 0.20),
    inset 0 0 10px rgba(139, 92, 246, 0.14);
}

/* ── Pulse ring quando ativo ── */
.btn-8d.is-active::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  border: 1.5px solid rgba(139, 92, 246, 0.45);
  animation: noc8d-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes noc8d-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%       { opacity: 0.10; transform: scale(1.10); }
}

/* ── Ícone rotação suave quando ativo ── */
.btn-8d.is-active .btn-8d__icon {
  animation: noc8d-rotate 12s linear infinite;
}

@keyframes noc8d-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Badge "8D" no canto do ícone quando ativo ── */
.btn-8d__badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: 1.5px solid rgba(10, 4, 28, 0.90);
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  display: none;
  place-items: center;
  line-height: 1;
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.55);
}

.btn-8d.is-active .btn-8d__badge {
  display: grid;
  animation: noc8d-badge-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes noc8d-badge-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Toast de ativação ── */
.noc8d-toast {
  position: fixed;
  bottom: calc(var(--player-h, 82px) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(10, 4, 28, 0.90);
  border: 1px solid rgba(139, 92, 246, 0.40);
  color: #c4b5fd;
  font-size: 0.80rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
  backdrop-filter: blur(12px);
  z-index: 1000;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.25);
}

.noc8d-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mobile: esconde tooltip (não tem hover) ── */
@media (hover: none) and (pointer: coarse) {
  .btn-8d::after { display: none; }
}
