/* CSS Variables for theming - these get overridden per album */
:root {
  --color-primary: #e63946;
  --color-secondary: #3b82f6;
  --color-background: #0d1b2a;
  --color-surface: rgba(0, 0, 0, 0.3);
  --color-text: #F5F7FA;
  --color-text-muted: #9ca3af;
  --color-accent: #f59e0b;
  --font-display: 'Bebas Neue', cursive;
  --font-body: 'Lato', sans-serif;
  --background-overlay: rgba(13, 27, 42, 0.45);
}

/* Base styles */
body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--color-text);
  transition: background-color 0.5s ease;
}

.font-display {
  font-family: var(--font-display);
}

/* Full-screen background image */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: -2;
  transition: opacity 0.8s ease-in-out, background-image 0.8s ease-in-out;
}

.background-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background-overlay);
  z-index: -1;
}

/* Staggered fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glass morphism card */
.glass-card {
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
}

/* Progress bar */
#progressContainer {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  cursor: pointer;
  overflow: hidden;
}

#progressBarFill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 5px;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--color-primary);
}

/* Playlist styling */
.playlist-item {
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.playlist-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.playlist-item.active {
  background-color: rgba(var(--color-primary-rgb, 230, 57, 70), 0.15);
  border-left-color: var(--color-primary);
}

.playlist-item.active .track-number {
  color: var(--color-primary);
}

/* Play button */
.play-btn {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  transition: all 0.3s ease;
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(var(--color-primary-rgb, 230, 57, 70), 0.5);
}

/* Album card on homepage */
.album-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.album-card:hover {
  transform: translateY(-8px);
}

.album-card:hover .album-cover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.album-cover {
  transition: all 0.4s ease;
}

/* Lyrics modal */
.lyrics-modal {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Volume slider */
#volumeSlider {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  position: relative;
  height: 20px;
  display: block;
}

/* Add a visible background track behind the slider using a wrapper approach */
#volumeSlider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#volumeSlider:hover::-webkit-slider-track {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}

#volumeSlider:hover::-moz-range-track {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}

/* Webkit (Chrome, Safari, Edge) */
#volumeSlider::-webkit-slider-track {
  background: rgba(255, 255, 255, 0.8) !important;
  height: 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  transition: background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--color-primary);
  border-radius: 50%;
  margin-top: -6px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 8px rgba(var(--color-primary-rgb, 230, 57, 70), 0.6), 
              0 2px 4px rgba(0, 0, 0, 0.3);
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
}

#volumeSlider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(var(--color-primary-rgb, 230, 57, 70), 0.8), 
              0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Firefox */
#volumeSlider::-moz-range-track {
  background: rgba(255, 255, 255, 0.8) !important;
  height: 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

#volumeSlider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--color-primary);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 8px rgba(var(--color-primary-rgb, 230, 57, 70), 0.6), 
              0 2px 4px rgba(0, 0, 0, 0.3);
  cursor: grab;
  transition: all 0.2s ease;
}

#volumeSlider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(var(--color-primary-rgb, 230, 57, 70), 0.8), 
              0 2px 6px rgba(0, 0, 0, 0.4);
}

#volumeSlider::-moz-range-progress {
  background: rgba(255, 255, 255, 0.7);
  height: 6px;
  border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .playlist-item {
    padding: 0.75rem;
  }
  
  .glass-card {
    padding: 1rem;
  }
}
