/* ============================================================
   Voice Guide — Premium Hover & Soundwave Effects
   Fresh glassmorphism · Aurora glow · Micro-animations
   ============================================================ */

/* ---- Soundwave Equalizer HUD (injected by voice-guide.js) ---- */
.zen-soundwave-hud {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.12);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid rgba(129, 140, 248, 0.2);
  z-index: 10;
  pointer-events: none;
  animation: zen-hud-appear 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
}
.zen-soundwave-hud .bar {
  display: inline-block;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #818cf8, #6366f1);
  animation: zen-bar-bounce 0.5s ease-in-out infinite alternate;
}
.zen-soundwave-hud .b1 { height: 10px; animation-delay: 0s; }
.zen-soundwave-hud .b2 { height: 16px; animation-delay: 0.12s; }
.zen-soundwave-hud .b3 { height: 12px; animation-delay: 0.24s; }
.zen-soundwave-hud .b4 { height: 8px;  animation-delay: 0.36s; }

.zen-soundwave-hud.opening {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
}
.zen-soundwave-hud.opening .bar {
  background: linear-gradient(180deg, #34d399, #10b981);
}

.zen-voice-cmd-hint {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(129, 140, 248, 0.9);
  margin-left: 6px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.zen-soundwave-hud.opening .zen-voice-cmd-hint {
  color: rgba(52, 211, 153, 0.95);
}

/* ---- Speaking state glow on cards ---- */
.tool-card.is-speaking-voice,
.category-card.is-speaking-voice,
.card-hover.is-speaking-voice {
  z-index: 5;
  animation: zen-card-glow-pulse 2s ease-in-out infinite;
}
.tool-card.is-speaking-voice::after,
.category-card.is-speaking-voice::after,
.card-hover.is-speaking-voice::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15),
    rgba(16, 185, 129, 0.1),
    rgba(99, 102, 241, 0.08)
  );
  z-index: -1;
  pointer-events: none;
  animation: zen-aurora-breathe 3s ease-in-out infinite;
}

/* ---- Opening via voice — flash effect ---- */
.tool-card.is-opening-voice,
.category-card.is-opening-voice {
  animation: zen-voice-open-flash 0.4s ease-out both;
}

/* ---- Premium card hover (fresh glassmorphism) ---- */
.tool-card,
.category-card,
.card-hover {
  transition:
    transform 0.28s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    box-shadow 0.28s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    border-color 0.28s ease;
}
.tool-card:hover,
.category-card:hover,
.card-hover:hover {
  transform: translateY(-4px) scale(1.012);
  box-shadow:
    0 20px 40px -12px rgba(99, 102, 241, 0.12),
    0 8px 20px -6px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(129, 140, 248, 0.1);
  border-color: rgba(129, 140, 248, 0.25);
}

/* Inner shine sweep on hover */
.tool-card::before,
.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 60%
  );
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.tool-card:hover::before,
.category-card:hover::before {
  opacity: 1;
  animation: zen-hover-shine 0.7s ease-out both;
}

/* Icon lift + glow on hover */
.tool-card:hover .tool-card-icon,
.category-card:hover .category-icon {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
  transition: transform 0.3s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              filter 0.3s ease;
}

/* Card name color shift on hover */
.tool-card:hover .tool-card-name {
  background: linear-gradient(135deg, #818cf8, #6366f1, #10b981);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-pan 3s ease infinite;
}

/* ---- Sidebar links — soft glow hover ---- */
.sidebar-link {
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    box-shadow 0.22s ease;
}
.sidebar-link:hover {
  transform: translateX(4px);
  box-shadow: -3px 0 0 0 rgba(99, 102, 241, 0.6);
}

/* ---- Header nav links — underline slide ---- */
.header-link {
  position: relative;
}
.header-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #818cf8, #10b981);
  border-radius: 2px;
  transition: width 0.3s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              left 0.3s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.header-link:hover::after {
  width: 80%;
  left: 10%;
}

/* ---- Buttons — press-down with aurora ring ---- */
.btn,
.btn-primary,
.action-btn {
  transition:
    transform 0.18s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    box-shadow 0.18s ease,
    filter 0.18s ease;
}
.btn:hover,
.btn-primary:hover,
.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -4px rgba(99, 102, 241, 0.25);
  filter: brightness(1.05);
}
.btn:active,
.btn-primary:active,
.action-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 8px -2px rgba(99, 102, 241, 0.2);
}

/* ---- Icon buttons — breathe on hover ---- */
.icon-button:hover {
  animation: zen-icon-breathe 0.6s ease-in-out;
}

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes zen-hud-appear {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes zen-bar-bounce {
  0%   { height: 4px; }
  100% { height: 18px; }
}

@keyframes zen-hover-shine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes zen-voice-open-flash {
  0% {
    filter: brightness(1);
    transform: scale(1);
  }
  40% {
    filter: brightness(1.3);
    transform: scale(1.03);
  }
  100% {
    filter: brightness(1);
    transform: scale(0.98);
    opacity: 0.7;
  }
}

@keyframes zen-icon-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .zen-soundwave-hud,
  .zen-soundwave-hud .bar,
  .tool-card,
  .category-card,
  .card-hover,
  .tool-card::before,
  .category-card::before,
  .tool-card.is-speaking-voice,
  .tool-card.is-opening-voice,
  .sidebar-link,
  .header-link::after,
  .icon-button {
    animation: none !important;
    transition: none !important;
  }
}
