@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-gradient-dark: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  --bg-gradient-pink: linear-gradient(135deg, #2b1029, #56163f, #811d54);
  --glass-bg-dark: rgba(20, 20, 25, 0.6);
  --glass-bg-pink: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary-dark: #f0f0f0;
  --text-secondary-dark: #b0b0b0;
  --accent-color: #ff3366;
  --accent-hover: #ff5c8a;
  --active-bg: rgba(255, 51, 102, 0.2);
}

/* Prevent white flash */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* Disable transitions before load */
.no-transition * {
  transition: none !important;
}

body {
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  padding: 20px;
  background: var(--bg-gradient-dark);
  color: var(--text-primary-dark);
  background-attachment: fixed;
  transition: background 0.5s ease, color 0.3s ease;
}

body.pink-theme {
  background: var(--bg-gradient-pink);
}

/* Header */
.site-header {
  width: 100%;
  max-width: 450px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 10px;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: #fff;
}

/* Core container */
.container {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--glass-bg-dark);
  border: 1px solid var(--glass-border);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: background 0.3s ease;
  display: flex;
  flex-direction: column;
}

body.pink-theme .container {
  background: var(--glass-bg-pink);
}

/* Player Wrapper */
.player-wrapper {
  padding: 30px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Album Art (Vinyl Record) */
.album-art {
  width: 220px;
  height: 220px;
  margin-bottom: 25px;
  border-radius: 50%;
  background: conic-gradient(#111, #333, #111, #333, #111);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 0 20px rgba(0,0,0,1);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.album-art::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    transparent,
    transparent 4px,
    rgba(255,255,255,0.05) 5px,
    transparent 6px
  );
}

.vinyl-record {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: spin 8s linear infinite;
  animation-play-state: paused;
}

.vinyl-record.playing {
  animation-play-state: running;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.vinyl-center {
  width: 70px;
  height: 70px;
  background: var(--accent-color);
  border-radius: 50%;
  border: 4px solid #111;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.vinyl-center::after {
  content: '';
  width: 14px;
  height: 14px;
  background: #000;
  border-radius: 50%;
}

body.pink-theme .vinyl-center {
  background: #fff;
}

/* Song Info */
.song-info {
  text-align: center;
  margin-bottom: 25px;
  width: 100%;
}

.song-info h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.song-info p {
  font-size: 14px;
  color: var(--text-secondary-dark);
  margin: 0;
  font-weight: 500;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

.time-display {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary-dark);
  min-width: 35px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background 0.3s;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 25px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary-dark);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.icon-btn .material-symbols-rounded {
  font-size: 28px;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn.active {
  color: var(--accent-color);
}

.play-btn {
  background: var(--accent-color);
  border: none;
  color: #fff;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 51, 102, 0.4);
  transition: all 0.2s ease;
}

.play-btn .material-symbols-rounded {
  font-size: 36px;
}

.play-btn:hover {
  transform: scale(1.05);
  background: var(--accent-hover);
  box-shadow: 0 10px 25px rgba(255, 51, 102, 0.6);
}

/* Volume Control */
.volume-container {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 0 10px;
}

.volume-icon {
  font-size: 20px;
  color: var(--text-secondary-dark);
  cursor: pointer;
}

#volumeSlider {
  flex: 1;
  height: 4px;
}

/* Playlist Section */
.playlist-section {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px 24px;
  border-top: 1px solid var(--glass-border);
}

.search-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 15px;
}

.search-icon {
  color: var(--text-secondary-dark);
  font-size: 20px;
  margin-right: 10px;
}

#search {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

#search::placeholder {
  color: var(--text-secondary-dark);
}

#playlist {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 250px;
  overflow-y: auto;
}

/* Custom Scrollbar for Playlist */
#playlist::-webkit-scrollbar {
  width: 6px;
}
#playlist::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

#playlist li {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #ddd;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

#playlist li:hover {
  background: rgba(255, 255, 255, 0.05);
  padding-left: 18px;
}

#playlist li.active {
  background: var(--active-bg);
  color: var(--accent-color);
  font-weight: 600;
  border-left: 3px solid var(--accent-color);
}

/* Footer */
.site-footer {
  margin-top: 25px;
  text-align: center;
  color: var(--text-secondary-dark);
  font-size: 12px;
  max-width: 450px;
}

.site-footer p {
  margin: 4px 0;
}

.disclaimer {
  opacity: 0.6;
  font-size: 10px;
  margin-top: 10px !important;
}

/* Mobile Responsive */
@media (max-width: 500px) {
  .container {
    border-radius: 20px;
    border: none;
  }
  
  .album-art {
    width: 180px;
    height: 180px;
  }
  
  .play-btn {
    width: 56px;
    height: 56px;
  }
}
