/* Roadways Music — Custom CSS Design System (Exact saloon.wtf Architecture) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-inter: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  background: #180f12;
}

body {
  height: 100%;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  font-family: var(--font-inter);
  background: transparent !important; /* Transparent body so fixed background image is 100% visible */
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Fullscreen Bus Background Illustration Layer - Direct image at z-index 0 */
.hero-bg-img {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Main UI Stacking Context - Elevated above background */
main {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100dvh;
}

/* Roadways Music Logo Container - Phase 1.6 Vertical Position Upward (margin-top: 8vh) */
.roadways-logo-container {
  margin-top: 8vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
}

/* Transparent PNG Logo (Fontt.png) - Size UNTOUCHED (110vw / 1050px) */
.roadways-logo-img {
  height: auto;
  width: 110vw;
  max-width: 1050px;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.6));
}

/* Top Navigation Glass Pills */
.glass-pill {
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* Subtle Bus SVG Idle Motion & Exhaust Micro-Animation */
@keyframes busIdle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes exhaustPuffAnim {
  0% {
    r: 0.8px;
    opacity: 0;
    transform: translate(0, 0);
  }
  25% {
    opacity: 0.6;
  }
  80% {
    r: 3px;
    opacity: 0;
    transform: translate(-5px, -2px);
  }
  100% {
    opacity: 0;
  }
}

.bus-idle-anim {
  animation: busIdle 2.5s ease-in-out infinite;
}

.exhaust-puff {
  animation: exhaustPuffAnim 2.5s ease-out infinite;
}

/* Floating Bottom Player Pill Container - Fixed & Independent of Logo Position */
.fixed-player-wrapper {
  position: fixed;
  bottom: 10vh;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 0 1rem;
}

/* Player Pill Specific Glassmorphism - Floating Compact Music Control */
.glass-player {
  background: rgba(20, 10, 10, 0.45);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Circular Song Artwork Outer Viewport - 76px x 76px Perfect Circle */
.player-artwork-box {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: #000;
}

/* Rotating CD Disc Assembly Container - Holds both artwork & center CD pin together */
.player-artwork-disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  will-change: transform;
  transform: translateZ(0);
  animation: spinArtwork 10s linear infinite;
  animation-play-state: paused; /* Default paused until user clicks Play */
}

.player-artwork-disc.is-playing {
  animation-play-state: running; /* Resumes spinning from exact current angle */
}

/* Continuous 360 Degree Rotation Animation */
@keyframes spinArtwork {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* YouTube Thumbnail Artwork - Zoomed & Cropped to Remove Burned-In Text */
.player-artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: 50%;
  transform: scale(1.48); /* Zooms past YouTube thumbnail top/bottom burned-in title text */
  transform-origin: center center;
  transition: opacity 120ms ease-in-out;
  will-change: opacity;
}

.player-artwork-img.is-swapping {
  opacity: 0.3;
}

/* Draggable Seek Slider - 100% GPU Compositor Driven (ScaleX & TranslateX) */
#progress-bar {
  touch-action: none; /* Prevents mobile scroll while dragging timeline */
  user-select: none;
}

.slider-container {
  position: relative;
  height: 12px;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.slider-track {
  position: absolute;
  inset: 0;
  height: 4px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.slider-fill {
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.9);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ffffff;
  opacity: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: opacity 0.15s ease;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.slider-container:hover .slider-thumb,
.slider-container:active .slider-thumb,
.slider-container.is-seeking .slider-thumb {
  opacity: 1;
}

.slider-container.is-seeking .slider-fill,
.slider-container.is-seeking .slider-thumb {
  transition: none !important;
}

/* Coordinated Track Metadata Group Animation (50ms Exit / 90ms Enter = 140ms Total) */
.metadata-wrapper {
  display: flex;
  flex-direction: column;
  will-change: opacity, transform;
  transition: opacity 50ms ease-in, transform 50ms ease-in;
}

.metadata-wrapper.metadata-exit {
  opacity: 0;
  transform: translateY(-3px);
}

.metadata-wrapper.metadata-enter-prepare {
  opacity: 0;
  transform: translateY(3px);
  transition: none !important;
}

.metadata-wrapper.metadata-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 90ms cubic-bezier(0.22, 1, 0.36, 1), transform 90ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Touch-Action Manipulation & Fast Press Feedback for Interactive Controls */
button, .slider-container {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button:active {
  transform: scale(0.94);
  transition: transform 80ms ease-out;
}

/* Responsive Mobile Optimizations & Compositor Layer Promotion */
@media (max-width: 640px) {
  /* Targeted Mobile Top Header Control Group Fix (Single Horizontal Row) */
  #live-clock,
  #passenger-pill,
  #header-links {
    top: 1.25rem;
    align-items: center;
  }

  #live-clock {
    left: 0.75rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
  }

  #passenger-pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    max-width: fit-content;
  }

  #header-links {
    right: 0.75rem;
    gap: 0.35rem;
  }

  #header-links a {
    padding: 0.45rem;
  }

  .roadways-logo-container {
    margin-top: 9vh;
  }
  .roadways-logo-img {
    width: 115vw;
  }
  .fixed-player-wrapper {
    bottom: 9vh;
    padding: 0 1rem;
    transform: translateZ(0);
  }
  .glass-player {
    transform: translateZ(0);
    -webkit-tap-highlight-color: transparent;
  }
  .player-artwork-box {
    width: 64px;
    height: 64px;
    transform: translateZ(0);
  }
}

/* Extra Tight Mobile Viewports (<= 375px) */
@media (max-width: 375px) {
  #live-clock {
    left: 0.5rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }
  #passenger-pill {
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    gap: 0.35rem;
  }
  #header-links {
    right: 0.5rem;
    gap: 0.25rem;
  }
  #header-links a {
    padding: 0.4rem;
  }
}
