/* ==========================================================================
   LAZZYENGINEER - FLOATING MAGNIFICATION DOCK & VOLUME SCROLLER
   ========================================================================== */

.dock-container {
  display: flex;
  align-items: flex-end;
  width: auto;
  height: 58px;
  padding: 0 8px;
  position: fixed;
  background: var(--dock-bg, rgba(255, 255, 255, 0.85));
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  box-shadow: var(--shadows-large), 0 0 0 1px var(--colors-grayA4);
  bottom: 12px;
  left: 50%;
  border-radius: var(--radii-round);
  z-index: 100;
  transform: translate(-50%, -50%) translateY(80px);
  animation: dockAppear 500ms var(--transitions-snappy) forwards 200ms;
  user-select: none;
  -webkit-user-select: none;
}

.dark .dock-container {
  background: var(--colors-gray1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--colors-grayA4);
}

.dock-top-gradient {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0),
    var(--colors-gray6) 20%,
    var(--colors-gray10) 67.19%,
    rgba(0, 0, 0, 0));
  opacity: 0.25;
  height: 1px;
  position: absolute;
  top: -1px;
  left: 2.5%;
  width: 95%;
  z-index: 1;
}

.dark .dock-top-gradient {
  opacity: 0.4;
}

.dock-items {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  padding-top: 8px;
  padding-bottom: 8px;
}

.dock-btn {
  --gradient-color-1: var(--colors-gray2);
  --gradient-color-2: var(--colors-gray5);
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radii-round);
  background: var(--colors-gray3);
  position: relative;
  color: var(--colors-gray10);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  background-image: linear-gradient(
    45deg,
    var(--gradient-color-1),
    var(--gradient-color-2),
    var(--gradient-color-1),
    var(--gradient-color-2)
  );
  background-size: 200% 100%;
  transition: transform 120ms cubic-bezier(0.2, 0, 0, 1), color 150ms ease, background 150ms ease;
  will-change: transform, width, height;
}

.dark .dock-btn {
  --gradient-color-1: var(--colors-gray2);
  --gradient-color-2: var(--colors-gray3);
  background: var(--colors-gray2);
  color: var(--colors-gray10);
}

.dock-btn:hover {
  color: var(--colors-gray12);
}

.dock-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px var(--colors-gray1), 0 0 0 4px var(--colors-focus);
}

.dock-btn svg,
.dock-btn img {
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: transform 150ms ease;
}

.dock-btn-inner-border {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0),
    var(--colors-gray4) 20%,
    var(--colors-gray7) 67.19%,
    rgba(0, 0, 0, 0));
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radii-round);
  opacity: 0.6;
  pointer-events: none;
}

.dock-active-dot {
  background: var(--colors-gray11);
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: var(--radii-round);
  bottom: -6px;
  left: calc(50% - 2px);
  z-index: 2;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 200ms ease, transform 200ms var(--transitions-spring);
}

.dock-btn.active .dock-active-dot {
  opacity: 1;
  transform: scale(1);
  background: var(--colors-gray12);
}

.dock-divider {
  opacity: 1;
  height: 32px;
  width: 1px;
  background: var(--colors-grayA6);
  border: 0;
  flex-shrink: 0;
  align-self: center;
  -webkit-mask-image: linear-gradient(0deg, transparent, #fff 8px, #fff calc(100% - 8px), transparent);
  mask-image: linear-gradient(0deg, transparent, #fff 8px, #fff calc(100% - 8px), transparent);
}

.dock-tooltip {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--colors-gray12);
  color: var(--colors-gray1);
  font-family: var(--fonts-body);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radii-1);
  box-shadow: var(--shadows-tooltip);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 150ms ease, transform 150ms var(--transitions-snappy);
  z-index: 1000;
}

.dock-btn:hover .dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Friction Dampened Volume Scroller Popover ── */
.volume-popover-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.volume-scroller-popover {
  position: absolute;
  bottom: 54px;
  right: -20px;
  width: 260px;
  background: var(--colors-bg);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--colors-gray5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--colors-grayA3);
  border-radius: 16px;
  padding: 14px 16px 12px;
  z-index: 200;
  transform-origin: bottom right;
  transform: scale(0.6) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.volume-scroller-popover.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.volume-scroller-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.volume-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-title-group svg {
  width: 14px;
  height: 14px;
  color: var(--colors-gray10);
}

.volume-title {
  font-family: var(--fonts-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--colors-gray12);
}

.volume-badge {
  font-family: var(--fonts-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--colors-gray12);
  background: var(--colors-gray3);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--colors-gray4);
}

.volume-badge.muted {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.1);
  border-color: rgba(255, 69, 58, 0.2);
}

/* Ruler Track Container */
.volume-ruler-viewport {
  position: relative;
  width: 100%;
  height: 52px;
  background: var(--colors-gray2);
  border: 1px solid var(--colors-gray4);
  border-radius: 10px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
}

.volume-ruler-viewport:active {
  cursor: grabbing;
}

.volume-ruler-track {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  transform: translateX(var(--ruler-offset, 0px));
  will-change: transform;
}

.volume-tick {
  width: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: 6px;
  flex-shrink: 0;
}

.volume-tick-line {
  width: 1.5px;
  height: 12px;
  background: var(--colors-gray8);
  border-radius: 1px;
}

.volume-tick.major .volume-tick-line {
  height: 22px;
  background: var(--colors-gray11);
  width: 2px;
}

.volume-tick.half .volume-tick-line {
  height: 16px;
  background: var(--colors-gray9);
}

.volume-tick-number {
  font-family: var(--fonts-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--colors-gray10);
  margin-top: 4px;
}

/* Precision Center Marker Needle */
.volume-center-marker {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: #ff9f0a;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(255, 159, 10, 0.6);
}

.volume-center-marker::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #ff9f0a;
}

@keyframes dockAppear {
  to {
    transform: translate(-50%, -50%) translateY(0);
  }
}
