/* ═══════════════════════════════════════════════════════════════
   VINYL TURNTABLE PLAYER - DIGR Edition
   Steve Jobs Philosophy: The player doesn't exist until music exists
   "The emptiness must feel pregnant, not absent"
   ═══════════════════════════════════════════════════════════════ */

/* ===== EMPTY STATE: Hide everything except the invitation ===== */
/* The player doesn't exist until music exists */
#bottom-bar.vinyl-empty .player-info,
#bottom-bar.vinyl-empty .player-track .player-info,
#bottom-bar.vinyl-empty .player-controls,
#bottom-bar.vinyl-empty .player-progress,
#bottom-bar.vinyl-empty .player-volume,
#bottom-bar.vinyl-empty .player-divider {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease;
}

/* Only show the vinyl circle and zone nav */
#bottom-bar.vinyl-empty .bottom-nav-inline,
#bottom-bar.vinyl-empty .player-art {
  opacity: 1 !important;
}

/* Reveal controls on hover (subtle preview) */
#bottom-bar.vinyl-empty:hover .player-controls {
  opacity: 0.3 !important;
}

/* ===== The Vinyl Element ===== */
.player-art {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: grab;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.player-art:active {
  cursor: grabbing;
}

/* Hide the img by default */
.player-art img {
  display: none;
}

/* ===== Empty State: The Invitation ===== */
/* A faint circular outline, barely there, breathing like a heartbeat */
.player-art.vinyl-empty {
  background: transparent;
  border: 1px solid rgba(255, 180, 50, 0.15);
  box-shadow: 
    0 0 25px rgba(255, 180, 50, 0.08),
    0 0 50px rgba(255, 140, 0, 0.04),
    inset 0 0 20px rgba(255, 180, 50, 0.05);
  animation: vinyl-heartbeat 3s ease-in-out infinite;
}

/* Center spindle hint */
.player-art.vinyl-empty::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 180, 50, 0.3);
  box-shadow: 0 0 12px rgba(255, 180, 50, 0.4);
  animation: vinyl-spindle-pulse 3s ease-in-out infinite;
}

/* Whisper on hover */
.player-art.vinyl-empty::after {
  content: 'drop a track';
  position: absolute;
  top: 50%;
  left: calc(100% + 12px);
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: rgba(255, 180, 50, 0.5);
  white-space: nowrap;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.player-art.vinyl-empty:hover::after {
  opacity: 1;
}

@keyframes vinyl-heartbeat {
  0%, 100% { 
    opacity: 0.6;
    transform: scale(1);
    border-color: rgba(255, 180, 50, 0.15);
  }
  50% { 
    opacity: 1;
    transform: scale(1.03);
    border-color: rgba(255, 180, 50, 0.3);
  }
}

@keyframes vinyl-spindle-pulse {
  0%, 100% { 
    opacity: 0.3;
    box-shadow: 0 0 8px rgba(255, 180, 50, 0.3);
  }
  50% { 
    opacity: 0.8;
    box-shadow: 0 0 15px rgba(255, 180, 50, 0.6);
  }
}

/* ===== LOADED STATE: The Turntable Manifests ===== */
/* Vinyl materializes with a soft "placing record" transition */
.player-art.vinyl-loaded {
  background: 
    /* Center label area */
    radial-gradient(circle at center, 
      #1a1a1a 0%, 
      #1a1a1a 22%,
      transparent 22%
    ),
    /* Vinyl grooves - subtle ridges */
    repeating-radial-gradient(circle at center,
      #080808 0px,
      #080808 1px,
      #121212 1px,
      #121212 2.5px
    ),
    /* Base vinyl color */
    radial-gradient(circle at center, #151515 0%, #0a0a0a 100%);
  border: none;
  box-shadow: 
    0 0 0 2px rgba(30, 30, 30, 0.9),
    0 4px 20px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(255, 180, 50, 0.15);
  animation: vinyl-materialize 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes vinyl-materialize {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-30deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Show player elements when loaded */
#bottom-bar.vinyl-loaded .player-info,
#bottom-bar.vinyl-loaded .player-track .player-info,
#bottom-bar.vinyl-loaded .player-controls,
#bottom-bar.vinyl-loaded .player-volume,
#bottom-bar.vinyl-loaded .player-divider {
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: opacity 0.4s ease 0.2s;
}

/* Hide progress bar (vinyl IS the progress) */
#bottom-bar.vinyl-loaded .player-progress {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ===== Center Label (Gold/Amber) ===== */
.vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700 0%, #b8860b 50%, #8b6914 100%);
  box-shadow: 
    0 0 10px rgba(255, 215, 0, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: none;
  align-items: center;
  justify-content: center;
}

.player-art.vinyl-loaded .vinyl-label {
  display: flex;
}

.vinyl-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Spindle hole */
.vinyl-label::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #0a0a0a;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.9);
}

/* ===== SPINNING ===== */
.player-art.vinyl-playing {
  animation: vinyl-spin var(--spin-duration, 1.8s) linear infinite;
}

/* Counter-rotate label so artwork stays upright */
.player-art.vinyl-playing .vinyl-label {
  animation: vinyl-spin-reverse var(--spin-duration, 1.8s) linear infinite;
}

@keyframes vinyl-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes vinyl-spin-reverse {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* Warm glow when playing */
.player-art.vinyl-playing {
  box-shadow: 
    0 0 0 2px rgba(30, 30, 30, 0.9),
    0 4px 20px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(255, 180, 50, 0.25),
    0 0 60px rgba(255, 140, 0, 0.15);
}

/* ===== SCRATCHING ===== */
.player-art.vinyl-scratching {
  animation-play-state: paused !important;
  cursor: grabbing;
  box-shadow: 
    0 0 0 3px rgba(255, 180, 50, 0.6),
    0 4px 20px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(255, 180, 50, 0.4);
  transition: box-shadow 0.1s ease;
}

/* ===== PROGRESS RING ===== */
/* Golden arc showing playback position */
.vinyl-progress {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    from -90deg,
    rgba(255, 180, 50, 0.6) 0%,
    rgba(255, 215, 0, 0.4) var(--progress, 0%),
    transparent var(--progress, 0%),
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.player-art.vinyl-loaded .vinyl-progress {
  opacity: 1;
}

/* Subtle tick marks could go here later */

/* ===== PAUSED STATE ===== */
/* Vinyl stops with a slight brake ease */
.player-art.vinyl-loaded:not(.vinyl-playing):not(.vinyl-scratching) {
  animation: vinyl-brake 0.3s ease-out forwards;
}

@keyframes vinyl-brake {
  from { /* continues from current rotation */ }
  to { transform: rotate(var(--current-rotation, 0deg)); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .player-art {
    width: 44px;
    height: 44px;
  }
  
  .vinyl-label {
    width: 16px;
    height: 16px;
  }
}
