:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #f43f5e;
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #1e293b;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: rgba(99, 102, 241, 0.3);
  --radius: 0.5rem;
  --transition-duration: 0.3s;
  --duration: 0.3s;

}

.dark {
  --primary: #6366f1;
  --primary-dark: #818cf8;
  --secondary: #f43f5e;
  --background: #0f172a;
  --foreground: #f8fafc;
  --card: #1e293b;
  --card-foreground: #f1f5f9;
  --border: #334155;
  --input: #334155;
  --ring: rgba(99, 102, 241, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  transition: all var(--transition-duration) ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

.player-cover-image {
  --cover-blurred: 1rem;
  position: absolute;
  position: fixed;
  z-index: -1;
  object-fit: cover;
  object-position: center;
  transition: opacity calc(var(--duration) * 3);
  filter: blur(var(--cover-blurred));
  max-width: initial;
  inset: calc(var(--cover-blurred) * -5);
  width: calc(100% + var(--cover-blurred) * 5);
  height: calc(100% + var(--cover-blurred) * 5);
}

.player-cover-image {
  animation: bga 60s linear infinite;
}
@keyframes bga {
  50% {
      transform: scale(2);
  }
}

header {
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--input);
  transform: rotate(15deg);
}

.search-container {
  margin: 1rem 0;
  position: relative;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  position: relative;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--input);
  background-color: var(--card);
  color: var(--card-foreground);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
  transform: translateY(-2px);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--card-foreground);
  opacity: 0.5;
  cursor: pointer;
  display: none;
  transition: opacity 0.2s ease;
}

.search-clear.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

.search-clear:hover {
  opacity: 0.8;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .main-content {
    grid-template-columns: 2fr 1fr;
  }
}

.player-container {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.player-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.album-art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background-color: var(--input);
  transition: filter 0.3s ease;
}

.album-art:hover {
  filter: brightness(1.1);
}

.player-info {
  padding: 1.5rem;
}

.song-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--card-foreground);
}

.artist-name {
  font-size: 1rem;
  color: var(--card-foreground);
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.player-loading {
  text-align: center;
  margin-bottom: 1rem;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.control-button {
  background: none;
  border: none;
  color: var(--card-foreground);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.control-button:hover {
  background-color: var(--input);
  transform: scale(1.1);
}

.control-button.active {
  color: var(--primary);
}

.play-button {
  width: 56px;
  height: 56px;
  background-color: var(--primary);
  color: white;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.play-button:hover {
  background-color: var(--primary-dark);
  transform: scale(1.15);
}

.progress-container {
  margin-bottom: 1rem;
}

.progress-bar {
  width: 100%;
  height: 5px;
  background-color: var(--input);
  border-radius: 2.5px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: height 0.2s ease;
}

.progress-bar:hover {
  height: 8px;
}

.progress {
  height: 100%;
  background-color: var(--primary);
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  background-color: var(--primary-dark);
  border-radius: 50%;
  transition: width 0.2s ease, height 0.2s ease;
}

.progress-bar:hover .progress::after {
  width: 12px;
  height: 12px;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--card-foreground);
  opacity: 0.8;
  margin-top: 0.5rem;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background-color: var(--input);
  border-radius: 2.5px;
  outline: none;
  transition: height 0.2s ease;
}

.volume-slider:hover {
  height: 8px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: var(--primary);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.playlist-container {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.playlist-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.playlist-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.playlist-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--card-foreground);
}

.playlist-actions {
  display: flex;
  gap: 0.5rem;
}

.playlist {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
  scroll-behavior: smooth;
}

.playlist-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.playlist-item:hover {
  background-color: var(--input);
  transform: translateX(5px);
}

.playlist-item.active {
  background-color: rgba(99, 102, 241, 0.1);
  border-left: 3px solid var(--primary);
}

.playlist-item-info {
  flex: 1;
}

.playlist-item-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--card-foreground);
}

.playlist-item-artist {
  font-size: 0.875rem;
  color: var(--card-foreground);
  opacity: 0.8;
}

.playlist-item-duration {
  font-size: 0.875rem;
  color: var(--card-foreground);
  opacity: 0.8;
  margin: 0 1rem;
}

.playlist-item-actions {
  display: flex;
  gap: 0.5rem;
}

.action-button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.action-button:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

.action-button.secondary {
  background-color: var(--input);
  color: var(--card-foreground);
}

.action-button.secondary:hover {
  background-color: var(--border);
}

.lyrics-container {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  margin-top: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lyrics-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.lyrics-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--card-foreground);
}

.lyrics-content {
  white-space: pre-line;
  line-height: 1.6;
  color: var(--card-foreground);
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.search-results {
  margin-top: 1rem;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: relative;
}

.search-results.visible {
  opacity: 1;
  transform: translateY(0);
}

.search-results-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--card-foreground);
  cursor: pointer;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.search-results-close:hover {
  background-color: var(--input);
  transform: rotate(90deg);
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  color: var(--card-foreground);
}

.loading-spinner {
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

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

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.slide-up {
  animation: slideUp 0.3s ease forwards;
}

.error-message {
  background-color: #fee2e2;
  color: #b91c1c;
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  animation: slideUp 0.3s ease;
}

.hidden {
  display: none;
}

.material-symbols-rounded {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

.settings-container {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  margin-top: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.settings-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.settings-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--card-foreground);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-label {
  font-weight: 500;
  color: var(--card-foreground);
}

.settings-description {
  font-size: 0.875rem;
  color: var(--card-foreground);
  opacity: 0.8;
  margin-top: 0.25rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--input);
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: var(--primary);
  color: white;
  margin-left: 0.5rem;
}

.badge.secondary {
  background-color: var(--input);
  color: var(--card-foreground);
}

/* Responsive styles for mobile devices */
@media (max-width: 640px) {
  .player-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .song-title {
    font-size: 1.25rem;
  }

  .artist-name {
    font-size: 0.875rem;
  }

  .playlist-item {
    flex-wrap: wrap;
  }

  .playlist-item-actions {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: flex-end;
  }

  .playlist-item-duration {
    margin-left: auto;
  }

  .action-button {
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
  }
}

/* Responsive styles for small mobile devices */
@media (max-width: 480px) {
  .player-controls {
    gap: 0.25rem;
  }

  .control-button {
    width: 36px;
    height: 36px;
  }

  .play-button {
    width: 48px;
    height: 48px;
  }

  .playlist-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .playlist-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
