/* Vertical floating dock. Sits on the left side, centered vertically,
   as a self-contained pill (no full-height bar, no border-right line).
   Aesthetic ported from the 21st.dev horizontal dock template:
   rounded-3xl pill, backdrop-blur, faint border, soft shadow, hover
   spring, active dot indicator, gentle idle bob. */

.vertical-dock {
  position: fixed;
  left: 0.8rem;
  top: 50%;
  /* Use the standalone `translate` property so the GSAP idle animation
     can drive `transform` independently without fighting our vertical
     centering. */
  translate: 0 -50%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.4rem;
  background: rgba(15, 12, 14, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow:
    0 0 18px rgba(139, 0, 0, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.4);
}

.dock-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dock-logo:hover { transform: scale(1.18); }
.dock-logo img {
  width: 22px;
  height: 22px;
  opacity: 0.75;
  transition: opacity var(--transition-base);
}
.dock-logo:hover img { opacity: 1; }

.dock-spacer { height: 0.2rem; }

.dock-item {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  cursor: pointer;
  color: var(--color-text-muted);
  /* "back" easing with overshoot ≈ the spring(stiffness 300, damping 20)
     used in the framer-motion template. */
  transition:
    color 200ms ease,
    transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 200ms ease;
}
.dock-item:hover {
  color: var(--color-text);
  transform: scale(1.18) rotate(-4deg);
  background: rgba(255, 255, 255, 0.04);
}
/* Active state — just the icon color shift. No background tint, no
   inner border, no dot indicator. Keep it minimal. */
.dock-item.active { color: var(--color-red-bright); }

/* Glow ring on hover — a 1px red-tinted border that fades in. */
.dock-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(179, 0, 0, 0.4);
  box-shadow: 0 0 10px rgba(139, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.dock-item:hover::after { opacity: 1; }

.dock-item svg { width: 15px; height: 15px; }

/* Divider between nav items and the music button. */
.dock-divider {
  width: 70%;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0.45rem 0;
}

/* Music note button — same shape/behavior as .dock-item but is a
   <button> (action, not navigation). Click opens the music popover.
   .is-active = popover currently open; .is-playing = audio playing. */
.dock-music-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
  color: var(--color-text-muted);
  transition:
    color 200ms ease,
    transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 200ms ease;
}
.dock-music-btn:hover {
  color: var(--color-text);
  transform: scale(1.18) rotate(-4deg);
  background: rgba(255, 255, 255, 0.04);
}
.dock-music-btn.is-playing { color: var(--color-red-bright); }
.dock-music-btn.is-active  { color: var(--color-red-bright); background: rgba(179, 0, 0, 0.12); }
.dock-music-btn svg { width: 15px; height: 15px; }

/* Muted state — diagonal slash overlay across the music note. */
.dock-music-btn.is-muted::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: none;
  box-shadow: 0 -1px 0 rgba(15, 12, 14, 0.9);
}

/* Same hover glow ring as .dock-item. */
.dock-music-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(179, 0, 0, 0.4);
  box-shadow: 0 0 10px rgba(139, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.dock-music-btn:hover::after { opacity: 1; }

/* Tooltips slide out to the right of each item. */
.dock-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) scale(0.85);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.2rem 0.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
}
.dock-item:hover .dock-tooltip,
.dock-music-btn:hover .dock-tooltip {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Two-line tooltip for the mixtape button: main label + dim hint. */
.dock-tooltip--rich {
  padding: 0.28rem 0.5rem;
  text-align: left;
}
.dock-tooltip__main {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
}
.dock-tooltip__hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.4rem;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

/* ---------- Mobile: bottom-anchored horizontal dock ----------
   Pivots the vertical-side pill to a horizontal bar centered along the
   bottom edge, matching the iOS-dock feel. Tooltips flip to appear
   above each item (no room to the right), the divider rotates 90°
   between nav items and the music button, and touch targets grow
   slightly. The .vertical-dock class name is kept (no rename) so JS
   selectors elsewhere keep working — only the layout changes.
   See also: css/status-badge.css shifts the bottom-right status pill
   upward so it doesn't collide with this dock. */
@media (max-width: 768px) {
  .vertical-dock {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 0.75rem;
    translate: -50% 0;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.55rem;
    max-width: calc(100vw - 1.5rem);
  }

  .dock-spacer { display: none; }

  .dock-item,
  .dock-music-btn {
    width: 40px;
    height: 40px;
  }
  .dock-item svg,
  .dock-music-btn svg { width: 16px; height: 16px; }

  .dock-divider {
    width: 1px;
    height: 22px;
    margin: 0 0.35rem;
  }

  .dock-tooltip {
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) scale(0.85);
  }
  .dock-item:hover .dock-tooltip,
  .dock-music-btn:hover .dock-tooltip {
    transform: translateX(-50%) scale(1);
  }
}
