/* ===================================================
   FLOATING AUDIO PLAYER WIDGET (GEMINI SOUNDTRACK)
   =================================================== */
#audio-player-widget {
  position: fixed;
  bottom: max(1.2rem, env(safe-area-inset-bottom, 1.2rem));
  right: 1.5rem;
  z-index: 1005;
  font-family: inherit;
  user-select: none;
}

/* Compact Mini Widget Trigger */
.audio-mini-dock {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 4px 6px 4px 4px;
  background: rgba(10, 6, 20, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 114, 245, 0.25);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}

.audio-mini-dock:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 22px rgba(0, 114, 245, 0.45);
  border-color: rgba(0, 229, 255, 0.4);
}

.audio-mini-dock:active {
  transform: scale(0.96);
  transition-duration: 0.05s;
}

/* Mini Vinyl Disc */
.audio-mini-disc-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.audio-vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #0d0d12 0deg, #22222d 45deg, #0d0d12 90deg, #22222d 135deg, #0d0d12 180deg, #22222d 225deg, #0d0d12 270deg, #22222d 315deg, #0d0d12 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: vinylSpin 10s linear infinite;
  animation-play-state: paused;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

#audio-player-widget.is-playing .audio-vinyl-disc {
  animation-play-state: running;
}

.audio-disc-grooves {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.audio-disc-art {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.audio-disc-hole {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #080412;
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 3;
}

/* Mini Soundwave Equalizer */
.audio-mini-eq {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(1px);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 4;
}

#audio-player-widget.is-playing .audio-mini-eq {
  opacity: 1;
}

.eq-bar {
  width: 3px;
  height: 12px;
  background: #00e5ff;
  border-radius: 2px;
  box-shadow: 0 0 6px #00e5ff;
}

#audio-player-widget.is-playing .eq-bar:nth-child(1) {
  animation: eqDance 0.7s ease-in-out infinite alternate;
}
#audio-player-widget.is-playing .eq-bar:nth-child(2) {
  animation: eqDance 0.9s ease-in-out 0.2s infinite alternate;
}
#audio-player-widget.is-playing .eq-bar:nth-child(3) {
  animation: eqDance 0.65s ease-in-out 0.4s infinite alternate;
}

@keyframes eqDance {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1.0); }
}

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

/* Mini Quick-Play Button */
.audio-mini-playbtn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 114, 245, 0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.2s ease,
              box-shadow 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 114, 245, 0.4);
}

.audio-mini-playbtn:hover {
  background: #0072f5;
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(0, 114, 245, 0.7);
}

.audio-mini-playbtn:active {
  transform: scale(0.92);
  transition-duration: 0.05s;
}

.audio-mini-playbtn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transform: translateX(1px); /* optical center for triangle */
}

/* ===================================================
   EXPANDED AUDIO DECK PANEL
   =================================================== */
.audio-deck-panel {
  position: absolute;
  bottom: 58px;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 2rem);
  background: rgba(8, 4, 18, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 1.15rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85),
              0 0 30px rgba(0, 114, 245, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform-origin: bottom right;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.28s;
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
  pointer-events: auto;
}

#audio-player-widget.collapsed .audio-deck-panel {
  opacity: 0;
  transform: scale(0.88) translateY(18px);
  visibility: hidden;
  pointer-events: none;
  transition-duration: 0.18s;
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

/* Deck Header */
.audio-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.audio-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audio-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
  animation: liveDotPulse 2s ease-in-out infinite;
}

@keyframes liveDotPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #00e5ff; }
}

.audio-header-titles {
  display: flex;
  flex-direction: column;
}

.audio-header-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #00e5ff;
  text-transform: uppercase;
}

.audio-header-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.audio-btn-minimize {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.35rem;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.audio-btn-minimize:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Now Playing Hero Display */
.audio-hero-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.audio-turntable-visual {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.audio-turntable-vinyl {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #0e0e13 0deg, #202028 45deg, #0e0e13 90deg, #202028 135deg, #0e0e13 180deg, #202028 225deg, #0e0e13 270deg, #202028 315deg, #0e0e13 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: vinylSpin 10s linear infinite;
  animation-play-state: paused;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

#audio-player-widget.is-playing .audio-turntable-vinyl {
  animation-play-state: running;
}

.audio-turntable-grooves {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.audio-turntable-art {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.audio-turntable-spindle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #080412;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  z-index: 3;
}

.audio-meta-display {
  flex: 1;
  min-width: 0;
}

.audio-track-count {
  font-family: monospace;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.audio-track-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 2px 0;
}

.audio-track-artist {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.audio-genre-pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 7px;
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.25);
}

/* Like & Social Share Actions Row */
.audio-deck-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding: 0 2px;
  position: relative;
}

.audio-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 5px 12px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.audio-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.audio-action-btn:active {
  transform: scale(0.95);
  transition-duration: 0.05s;
}

.audio-action-btn svg {
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), fill 0.2s ease, stroke 0.2s ease;
}

/* Like Button State & Micro-interactions */
.audio-like-btn .heart-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.audio-like-btn.liked {
  color: #ff3366;
  background: rgba(255, 51, 102, 0.14);
  border-color: rgba(255, 51, 102, 0.4);
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.28);
}

.audio-like-btn.liked .heart-path {
  fill: #ff3366;
  stroke: #ff3366;
}

.audio-like-btn.liked .heart-icon {
  animation: heartPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45) rotate(-8deg); }
  70% { transform: scale(0.9) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.audio-like-count {
  font-family: monospace;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.audio-like-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.heart-particle {
  position: absolute;
  pointer-events: none;
  font-size: 13px;
  line-height: 1;
  animation: heartFloat 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heartFloat {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.6);
  }
  50% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx, 0px), var(--ty, -30px)) scale(1.3);
  }
}

/* Share Dropdown Popover */
.audio-share-wrapper {
  position: relative;
}

.audio-share-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: rgba(14, 18, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 114, 245, 0.2);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  z-index: 100;
  transform-origin: bottom right;
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.audio-share-popover.active {
  display: flex;
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.share-item-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
  width: 100%;
  user-select: none;
}

.share-item-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.share-item-btn:active {
  transform: scale(0.97);
}

.share-item-btn svg {
  pointer-events: none;
  flex-shrink: 0;
}

/* Dynamic Squiggly Wavy Timeline Scrubber (Android Auto Style) */
.audio-timeline-wrap {
  margin-bottom: 0.85rem;
}

.audio-wave-container {
  position: relative;
  width: 100%;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
  touch-action: none;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  transition: background 0.18s ease;
}

.audio-wave-container:hover {
  background: rgba(255, 255, 255, 0.05);
}

.audio-wave-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
}

.audio-wave-hover-line {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  border-radius: 1px;
}

.audio-wave-tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  background: rgba(10, 15, 26, 0.94);
  border: 1px solid rgba(0, 229, 255, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 8px rgba(0, 229, 255, 0.3);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: #00e5ff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  z-index: 10;
}

.audio-wave-container:hover .audio-wave-hover-line,
.audio-wave-container:hover .audio-wave-tooltip {
  opacity: 1;
}

.audio-time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-family: monospace;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* Playback Controls Row */
.audio-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.95rem;
  padding: 0 4px;
}

.audio-ctrl-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.audio-ctrl-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.audio-ctrl-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.06);
}

.audio-ctrl-btn:active {
  transform: scale(0.92);
}

.audio-play-master-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0072f5, #00e5ff);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 114, 245, 0.5);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s ease;
}

.audio-play-master-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.7);
}

.audio-play-master-btn:active {
  transform: scale(0.92);
  transition-duration: 0.05s;
}

.audio-play-master-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#deck-play-icon {
  transform: translateX(1.5px); /* optical nudge */
}

/* Volume Control */
.audio-volume-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-vol-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: color 0.18s ease;
}

.audio-vol-btn:hover {
  color: #fff;
}

.audio-vol-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.audio-vol-slider {
  width: 60px;
  height: 4px;
  accent-color: #00e5ff;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.18s ease;
}

.audio-vol-slider:hover {
  opacity: 1;
}

/* Tracklist Drawer */
.audio-tracklist-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
}

.audio-tracklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}

.audio-tracklist-sub {
  font-family: monospace;
  color: var(--accent-color);
}

.audio-tracklist-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 2px;
}

.audio-tracklist-items::-webkit-scrollbar {
  width: 4px;
}
.audio-tracklist-items::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.audio-track-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.audio-track-item * {
  pointer-events: none;
}

.audio-track-item:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.audio-track-item.active {
  background: rgba(0, 114, 245, 0.18);
  border-color: rgba(0, 114, 245, 0.4);
}

.audio-item-num {
  font-family: monospace;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 16px;
}

.audio-track-item.active .audio-item-num {
  color: #00e5ff;
}

.audio-item-art {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.audio-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.audio-item-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-track-item.active .audio-item-title {
  color: #00e5ff;
}

.audio-item-tag {
  font-size: 0.62rem;
  color: var(--text-secondary);
}

.audio-item-wave {
  width: 12px;
  height: 12px;
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  opacity: 0;
}

.audio-track-item.active .audio-item-wave {
  opacity: 1;
}

.audio-item-wave span {
  width: 2px;
  height: 100%;
  background: #00e5ff;
  border-radius: 1px;
}

#audio-player-widget.is-playing .audio-track-item.active .audio-item-wave span:nth-child(1) {
  animation: eqDance 0.6s infinite alternate;
}
#audio-player-widget.is-playing .audio-track-item.active .audio-item-wave span:nth-child(2) {
  animation: eqDance 0.8s infinite 0.2s alternate;
}
#audio-player-widget.is-playing .audio-track-item.active .audio-item-wave span:nth-child(3) {
  animation: eqDance 0.5s infinite 0.4s alternate;
}

/* Mobile Media Queries for Audio Widget */
@media (max-width: 600px) {
  #audio-player-widget {
    right: 0.75rem;
    bottom: max(0.8rem, env(safe-area-inset-bottom, 0.8rem));
  }

  .audio-deck-panel {
    width: calc(100vw - 1.5rem);
    right: 0;
    bottom: 54px;
    max-height: 72vh;
    padding: 1rem;
  }

  .audio-mini-dock {
    padding: 3px 5px 3px 3px;
  }
  .audio-mini-disc-wrap {
    width: 38px;
    height: 38px;
  }
  .audio-mini-playbtn {
    width: 28px;
    height: 28px;
  }
}
