/* Component Styles */

/* Card */
.card {
  width: min(420px, 96vw);
  border-radius: calc(var(--radius) + 10px);
  background: var(--bg);
  padding: 18px 18px 22px;
  position: relative;
  box-shadow: 18px 18px 36px var(--shadow-dark), -18px -18px 36px var(--shadow-light);
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px;
}

.title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Icons */
.icon {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--muted);
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  cursor: pointer;
  user-select: none;
}

.icon:active {
  box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
}

.icon.active {
  color: var(--accent);
}

#radioBtn {
  color: black;
}

#radioBtn.active {
  color: var(--accent);
}

.icon-label {
  font-size: 10px;
  margin-top: 2px;
  font-weight: 500;
}

.icon svg {
  width: 20px;
  height: 20px;
}

.icon-emoji {
  font-size: 18px;
  line-height: 1;
}

/* Album Art */
.art-wrap {
  margin: 16px auto 12px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 14px 14px 28px var(--shadow-dark), -14px -14px 28px var(--shadow-light);
}

.art {
  width: 88%;
  height: 88%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 12px 12px 24px var(--shadow-dark), inset -12px -12px 24px var(--shadow-light);
  background: linear-gradient(135deg, #dfe7e2, #f5faf7);
  display: grid;
  place-items: center;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.art img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
  border-radius: 0;
  animation: spin 25s linear infinite;
  animation-play-state: paused;
}

.art img.playing {
  animation-play-state: running;
}

/* Track Info */
.track-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.22rem;
  margin: 10px 8px 2px;
}

.track-artist {
  text-align: center;
  color: var(--muted);
  margin: 0 8px 14px;
}

/* Progress Bar */
.progress {
  margin: 6px 6px 2px;
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 6px 6px;
}

.bar {
  width: 100%;
  height: 18px;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 10px 10px 20px var(--shadow-dark), inset -10px -10px 20px var(--shadow-light);
  background: linear-gradient(180deg, #eaf3ee, #e2ebe6);
}

.fill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: 0%;
  border-radius: 12px;
  background: var(--accent);
}

.knob {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  pointer-events: none;
}

/* Control Buttons */
.row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

.btn-round {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

.btn-round.primary {
  width: 74px;
  height: 74px;
  color: white;
  background-color: var(--accent);
}

.btn-round:active {
  box-shadow: inset 10px 10px 20px var(--shadow-dark), inset -10px -10px 20px var(--shadow-light);
}

/* Mini Controls */
.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 8px 0;
  color: var(--muted);
  position: relative;
}

.mini {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
}

.mini.active {
  color: var(--accent);
}

/* Volume Popup */
.volume-popup {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  background: var(--bg);
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
  z-index: 10;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: linear-gradient(180deg, #eaf3ee, #e2ebe6);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  border-radius: 8px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
}

/* Drawer */
.drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
}

.drawer.open {
  display: block;
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(360px, 92vw);
  background: var(--bg);
  padding: 18px;
  overflow: auto;
  box-shadow: -18px 0 36px var(--shadow-dark), -2px 0 8px var(--shadow-light);
}

/* Search */
.search {
  width: 100%;
  padding: 12px 14px;
  border: none;
  outline: none;
  border-radius: 14px;
  color: var(--text);
  background: var(--bg);
  box-shadow: inset 10px 10px 20px var(--shadow-dark), inset -10px -10px 20px var(--shadow-light);
  margin-bottom: 12px;
}

/* List Items */
.list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background-color: var(--surface);
  box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
  margin-bottom: 12px;
  cursor: pointer;
  position: relative;
}

.list-item:hover {
  filter: brightness(0.98);
}

.list-item .list-item-main {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
}

.list-item .t-cover {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  place-items: center;
}

.list-item .t-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.t-title {
  font-weight: 600;
}

.t-artist {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Delete Button */
.delete-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #e74c3c;
  background: var(--bg);
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  transition: all 0.2s;
}

.delete-btn:hover {
  background: #ffe5e5;
}

.delete-btn:active {
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

/* Header Bar */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.header-bar .title {
  flex: 1;
}

.add-btn, .change-playlist-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.add-btn {
  background: var(--accent);
  color: white;
  font-size: 20px;
}

.change-playlist-btn {
  background: var(--bg);
  color: var(--accent);
}

.change-playlist-btn:hover {
  background: var(--accent);
  color: white;
}

.change-playlist-btn:active,
.add-btn:active {
  box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
}

/* Button labels */
.btn-label-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-label {
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  color: var(--muted);
}

.back-btn:hover {
  color: var(--text);
}

/* ========================================== */
/* PLAYLIST SELECTOR MODAL STYLES */
/* ========================================== */

/* Playlist Selector Modal */
.playlist-selector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.playlist-selector-modal {
  background: var(--bg);
  border-radius: 24px;
  padding: 30px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleIn {
  to { transform: scale(1); }
}

.playlist-selector-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 10px;
}

.playlist-selector-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.playlist-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
  position: relative;
  overflow: hidden;
}

.playlist-card:hover {
  transform: translateY(-4px);
  box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

.playlist-card:active {
  transform: translateY(-2px);
  box-shadow: inset 8px 8px 16px var(--shadow-dark), inset -8px -8px 16px var(--shadow-light);
}

.playlist-card.empty {
  opacity: 0.5;
  cursor: not-allowed;
}

.playlist-card.empty:hover {
  transform: none;
}

.playlist-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  display: block;
}

.playlist-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 6px;
  word-wrap: break-word;
}

.playlist-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.playlist-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.playlist-empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* Mobile Responsive for Playlist Selector */
@media (max-width: 480px) {
  .playlist-selector-modal {
    padding: 20px;
  }
  
  .playlist-selector-title {
    font-size: 1.5rem;
  }
  
  .playlist-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .playlist-card {
    padding: 16px;
  }
  
  .playlist-icon {
    font-size: 2.5rem;
  }
  
  .playlist-name {
    font-size: 0.95rem;
  }
}