/* CSS Variables */
:root {
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --secondary: #ec4899;
  --bg-dark: #0f172a;
  --bg-darker: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.5);
  --text: #ffffff;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --hover: rgba(139, 92, 246, 0.1);
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 4rem;
  --mobile-player-height: 5rem;
}

/* Light Theme */
.light-theme {
  --bg-dark: #f8fafc;
  --bg-darker: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.5);
  --text: #1e293b;
  --text-muted: #64748b;
  --border: rgba(30, 41, 59, 0.2);
  --hover: rgba(139, 92, 246, 0.05);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #312e81 50%, var(--bg-dark) 100%);
  color: var(--text);
  min-height: 100vh;
  transition: var(--transition);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

.light-theme body {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #e0e7ff 50%, var(--bg-dark) 100%);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-darker);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.profile-photo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
  flex-shrink: 0;
}

.header-info {
  min-width: 0;
  flex: 1;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  font-size: 0.875rem;
}

.theme-toggle:hover {
  background: var(--hover);
  transform: scale(1.05);
}

/* Main Container */
.main-container {
  padding-top: var(--header-height);
  padding-bottom: calc(var(--mobile-player-height) + 1rem);
  min-height: 100vh;
}

.player-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* Desktop Layout */
@media (min-width: 1024px) {
  .main-container {
    padding-bottom: 2rem;
  }

  .player-layout {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem;
  }

  .mobile-bottom-player {
    display: none !important;
  }
}

/* Left Panel - Main Player */
.left-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  box-shadow: var(--shadow);
}

/* Album Cover */
.album-cover-container {
  position: relative;
}

.album-cover {
  width: 16rem;
  height: 16rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  cursor: pointer;
}

.album-cover:hover {
  transform: scale(1.02);
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.album-cover:hover .album-overlay {
  opacity: 1;
}

.album-play-btn {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-play-btn:hover {
  transform: scale(1.1);
}

.album-play-btn i {
  margin-left: 0.2rem;
}

/* Song Info */
.song-info {
  text-align: center;
  max-width: 100%;
}

.song-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.artist-name {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Progress Section */
.progress-section {
  width: 100%;
  max-width: 20rem;
}

.progress-container {
  width: 100%;
  height: 0.75rem;
  background: var(--bg-darker);
  border-radius: 0.375rem;
  cursor: pointer;
  position: relative;
  margin-bottom: 0.75rem;
  padding: 0.125rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 0.25rem;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-thumb {
  position: absolute;
  right: -0.375rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.75rem;
  height: 0.75rem;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: var(--transition);
}

.progress-container:hover .progress-thumb {
  opacity: 1;
}

.progress-hover-time {
  position: absolute;
  background: var(--bg-darker);
  color: var(--text);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  top: -2.5rem;
  transform: translateX(-50%);
  display: none;
  pointer-events: none;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.time-container {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.control-btn:hover {
  background: var(--hover);
  transform: translateY(-2px);
}

.control-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-color: transparent;
}

.control-btn.secondary {
  font-size: 0.875rem;
}

.play-pause-btn {
  width: 4rem;
  height: 4rem;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
}

.play-pause-btn:hover {
  transform: scale(1.05);
}

.play-pause-btn i {
  margin-left: 0.1rem;
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 18rem;
}

.volume-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.volume-icon:hover {
  color: var(--text);
  background: var(--hover);
}

.volume-slider {
  flex: 1;
  height: 0.5rem;
  background: var(--bg-darker);
  border-radius: 0.25rem;
  cursor: pointer;
  position: relative;
}

.volume-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 0.25rem;
  width: 70%;
  transition: width 0.1s ease;
  position: relative;
}

.volume-thumb {
  position: absolute;
  right: -0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.5rem;
  height: 0.5rem;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.volume-percentage {
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 3rem;
  text-align: center;
  flex-shrink: 0;
}

/* Right Panel - Playlist */
.right-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

/* Playlist Header */
.playlist-header {
  margin-bottom: 1.5rem;
}

.playlist-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search */
.search-container {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.875rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 2.5rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
}

.search-input:not(:placeholder-shown) + .search-clear {
  opacity: 1;
  pointer-events: auto;
}

.search-clear:hover {
  color: var(--text);
  background: var(--hover);
}

/* Language Tabs */
.language-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.language-tabs::-webkit-scrollbar {
  display: none;
}

.language-tab {
  padding: 0.5rem 1rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.language-tab:hover {
  background: var(--hover);
  color: var(--text);
}

.language-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-color: transparent;
}

/* Playlist Container */
.playlist-container {
  flex: 1;
  overflow-y: auto;
  margin: -0.5rem;
  padding: 0.5rem;
  max-height: 400px;
}

.playlist-container::-webkit-scrollbar {
  width: 0.25rem;
}

.playlist-container::-webkit-scrollbar-track {
  background: transparent;
}

.playlist-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 0.125rem;
}

.playlist-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Song Item */
.song-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
  touch-action: manipulation;
}

.song-item:hover {
  background: var(--hover);
  transform: translateX(0.25rem);
}

.song-item.active {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}

.song-thumbnail {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.song-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-thumbnail .playing-indicator {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.song-item.active .song-thumbnail .playing-indicator {
  opacity: 1;
}

.playing-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.song-details {
  flex: 1;
  min-width: 0;
}

.song-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.875rem;
}

.song-item-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-language {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  border-radius: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.song-language.hindi {
  background: rgba(251, 146, 60, 0.2);
  color: #fb923c;
}

.song-language.english {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.song-play-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.song-play-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.song-play-btn i {
  margin-left: 0.05rem;
}

/* Mobile Playlist Actions */
.mobile-playlist-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mobile-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.mobile-action-btn:hover {
  background: var(--hover);
  border-color: var(--primary);
}

.mobile-action-btn i {
  font-size: 1rem;
}

/* Mobile Bottom Player */
.mobile-bottom-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-darker);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 900;
  transform: translateY(100%);
  transition: var(--transition);
}

.mobile-bottom-player.active {
  transform: translateY(0);
}

.mobile-player-progress {
  height: 0.125rem;
  background: var(--bg-dark);
  position: relative;
}

.mobile-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.1s linear;
}

.mobile-player-content {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 1rem;
}

.mobile-player-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.mobile-album-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
}

.mobile-song-details {
  min-width: 0;
  flex: 1;
}

.mobile-song-title {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.mobile-artist-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.mobile-player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.mobile-control-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.mobile-control-btn:hover {
  background: var(--hover);
}

.mobile-control-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  font-size: 1rem;
}

.mobile-control-btn.primary i {
  margin-left: 0.05rem;
}

/* Footer */
.footer {
  background: var(--bg-darker);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.contact-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.875rem;
}

.contact-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* Now Playing Indicator */
.now-playing-indicator {
  position: fixed;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%) translateX(5rem);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: var(--transition);
  z-index: 100;
}

.now-playing-indicator.visible {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}

.now-playing-text {
  font-size: 0.875rem;
  font-weight: 600;
}

.now-playing-bars {
  display: flex;
  align-items: flex-end;
  height: 1rem;
  gap: 0.125rem;
}

.now-playing-bars span {
  display: block;
  width: 0.1875rem;
  background-color: white;
  border-radius: 0.0625rem;
  animation: sound 0.5s ease-in-out infinite alternate;
}

.now-playing-bars span:nth-child(1) {
  animation-duration: 0.474s;
  height: 0.625rem;
}

.now-playing-bars span:nth-child(2) {
  animation-duration: 0.433s;
  height: 1rem;
}

.now-playing-bars span:nth-child(3) {
  animation-duration: 0.407s;
  height: 0.5rem;
}

.now-playing-bars span:nth-child(4) {
  animation-duration: 0.458s;
  height: 0.75rem;
}

@keyframes sound {
  0% {
    opacity: 0.35;
    height: 0.1875rem;
  }
  100% {
    opacity: 1;
    height: 1rem;
  }
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.loading-spinner.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 1rem);
  right: 1rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
}

.toast {
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  transform: translateX(100%);
  opacity: 0;
  transition: var(--transition);
  max-width: 300px;
  word-wrap: break-word;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid var(--primary);
}

/* Mobile Responsive Styles */
@media (max-width: 1023px) {
  .header-subtitle {
    display: none;
  }

  .mobile-bottom-player {
    display: block;
  }

  .main-container {
    padding-bottom: calc(var(--mobile-player-height) + 1rem);
  }

  .now-playing-indicator {
    top: auto;
    bottom: calc(var(--mobile-player-height) + 1rem);
    right: 1rem;
    transform: translateX(5rem);
  }

  .now-playing-indicator.visible {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .player-layout {
    padding: 0.75rem;
    gap: 1rem;
  }

  .album-cover {
    width: 14rem;
    height: 14rem;
  }

  .song-title {
    font-size: 1.25rem;
  }

  .controls {
    gap: 0.5rem;
  }

  .control-btn {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
  }

  .play-pause-btn {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.25rem;
  }

  .left-panel {
    padding: 1.5rem;
    gap: 1.25rem;
  }

  .right-panel {
    padding: 1rem;
  }

  .playlist-container {
    max-height: 300px;
  }

  .toast-container {
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .player-layout {
    padding: 0.5rem;
    gap: 0.75rem;
  }

  .album-cover {
    width: 12rem;
    height: 12rem;
  }

  .left-panel {
    padding: 1rem;
    gap: 1rem;
  }

  .right-panel {
    padding: 0.75rem;
  }

  .song-title {
    font-size: 1.125rem;
  }

  .artist-name {
    font-size: 0.875rem;
  }

  .controls {
    gap: 0.375rem;
  }

  .control-btn {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.75rem;
  }

  .play-pause-btn {
    width: 3rem;
    height: 3rem;
    font-size: 1.125rem;
  }

  .volume-control {
    gap: 0.75rem;
  }

  .volume-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }

  .song-item {
    padding: 0.5rem;
    gap: 0.75rem;
  }

  .song-thumbnail {
    width: 2.5rem;
    height: 2.5rem;
  }

  .language-tabs {
    gap: 0.25rem;
  }

  .language-tab {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .mobile-playlist-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .contact-links {
    flex-direction: column;
    width: 100%;
  }

  .contact-link {
    justify-content: center;
  }

  .header-content {
    padding: 0 0.75rem;
  }

  .mobile-player-content {
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
  }

  .mobile-album-thumb {
    width: 2rem;
    height: 2rem;
  }

  .mobile-control-btn {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }

  .mobile-control-btn.primary {
    font-size: 0.875rem;
  }
}

@media (max-width: 360px) {
  .album-cover {
    width: 10rem;
    height: 10rem;
  }

  .song-title {
    font-size: 1rem;
  }

  .control-btn {
    width: 2rem;
    height: 2rem;
  }

  .play-pause-btn {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1rem;
  }

  .mobile-player-content {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .mobile-song-title {
    font-size: 0.75rem;
  }

  .mobile-artist-name {
    font-size: 0.625rem;
  }
}

/* Landscape Mode Optimizations */
@media (max-height: 500px) and (orientation: landscape) {
  .left-panel {
    padding: 1rem;
    gap: 0.75rem;
  }

  .album-cover {
    width: 8rem;
    height: 8rem;
  }

  .song-title {
    font-size: 1rem;
  }

  .artist-name {
    font-size: 0.875rem;
  }

  .controls {
    gap: 0.5rem;
  }

  .control-btn {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }

  .play-pause-btn {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  .playlist-container {
    max-height: 200px;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .album-cover img,
  .song-thumbnail img,
  .mobile-album-thumb {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .now-playing-bars span {
    animation: none !important;
  }

  .playing-spinner {
    animation: none !important;
  }
}

/* Dark Mode Media Query */
@media (prefers-color-scheme: light) {
  body:not(.dark-theme) {
    --bg-dark: #f8fafc;
    --bg-darker: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.5);
    --text: #1e293b;
    --text-muted: #64748b;
    --border: rgba(30, 41, 59, 0.2);
    --hover: rgba(139, 92, 246, 0.05);
  }

  body:not(.dark-theme) {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #e0e7ff 50%, var(--bg-dark) 100%);
  }
}
