@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Colors */
  --bg-color: #0a0a0f;
  --panel-bg: #12121a;
  --panel-border: rgba(255, 255, 255, 0.05);
  --accent-primary: #8b5cf6;
  --accent-secondary: #06b6d4;
  --accent-hover: #a78bfa;
  --heart-color: #ec4899;
  
  /* Text */
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  
  /* Layout */
  --sidebar-width: 80px;
  --player-height: 90px;
  
  /* Effects */
  --glass-bg: rgba(18, 18, 26, 0.7);
  --glass-blur: blur(20px);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Layout */
.app-container {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--player-height));
  position: relative;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  background-color: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  z-index: 10;
}

.logo {
  width: 40px;
  height: 40px;
  margin-bottom: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.nav-item {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
  position: relative;
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: var(--accent-secondary);
  background-color: rgba(6, 182, 212, 0.1);
}

/* Main Content */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.top-bar {
  height: 70px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, var(--bg-color), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: none;
}

.search-container {
  position: relative;
  width: 300px;
  pointer-events: auto;
}

.search-container svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 10px 16px 10px 40px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

.view {
  padding: 90px 32px 32px;
  height: 100%;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: opacity 0.3s ease;
}

.view.active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

.view-header {
  margin-bottom: 24px;
}

.view-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* Album Grid */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.album-card {
  background-color: var(--panel-bg);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  group;
}

.album-card:hover {
  transform: translateY(-4px);
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.album-cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.album-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.album-card:hover .album-cover {
  transform: scale(1.05);
}

.album-play-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  cursor: pointer;
}

.album-card:hover .album-play-btn {
  opacity: 1;
  transform: translateY(0);
}

.album-play-btn:hover {
  transform: scale(1.1) !important;
}

.album-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-desc {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Song List View */
.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: var(--transition);
}

.back-btn:hover {
  color: var(--text-main);
}

.album-header-large {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
  align-items: flex-end;
}

.album-cover-large {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.album-info h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.play-all-btn {
  margin-top: 16px;
  padding: 12px 32px;
  border-radius: 24px;
  border: none;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.play-all-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* Song Rows */
.song-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.song-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  transition: var(--transition);
  cursor: pointer;
  gap: 16px;
}

.song-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.song-row.playing {
  background-color: rgba(6, 182, 212, 0.1);
}

.song-index {
  width: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.song-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.song-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.song-name {
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-row.playing .song-name {
  color: var(--accent-secondary);
}

.song-artist {
  font-size: 13px;
  color: var(--text-muted);
}

.song-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-btn:hover {
  color: var(--text-main);
}

.fav-btn.active {
  color: var(--heart-color);
}

.song-duration {
  color: var(--text-muted);
  font-size: 14px;
  width: 40px;
  text-align: right;
}

/* Playing Animation */
.playing-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  width: 24px;
}

.song-row.playing .song-index {
  display: none;
}

.song-row.playing .playing-bars {
  display: flex;
}

.bar {
  width: 3px;
  background-color: var(--accent-secondary);
  border-radius: 2px;
  animation: equalize 1s infinite alternate;
}
.bar:nth-child(1) { animation-delay: 0.1s; height: 30%; }
.bar:nth-child(2) { animation-delay: 0.3s; height: 100%; }
.bar:nth-child(3) { animation-delay: 0.5s; height: 60%; }
.bar:nth-child(4) { animation-delay: 0.2s; height: 80%; }

@keyframes equalize {
  0% { height: 20%; }
  100% { height: 100%; }
}

/* Player Bar */
#player-bar {
  height: var(--player-height);
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 20;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 30%;
  min-width: 200px;
}

.player-thumb-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.player-thumb-wrapper::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-thumb-wrapper:hover::after {
  opacity: 1;
}

.player-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.expand-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
}

.player-thumb-wrapper:hover .expand-icon {
  opacity: 1;
}

.player-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-song-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 12px;
  color: var(--text-muted);
}

.player-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 8px;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  color: var(--text-main);
}

.control-btn.active {
  color: var(--accent-secondary);
}

.play-pause-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  color: black;
}

.play-pause-btn:hover {
  transform: scale(1.05);
  background-color: var(--text-main);
  color: black;
}

.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Custom Range Slider */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
  height: 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: white;
  -webkit-appearance: none;
  margin-top: -4px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.2s;
}

input[type=range]:hover::-webkit-slider-thumb {
  opacity: 1;
}

.progress-bar-wrapper {
  flex: 1;
  position: relative;
}

#seek-bar {
  position: absolute;
  top: -4px;
  width: 100%;
  z-index: 2;
  margin: 0;
}

.progress-bg {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  position: absolute;
  top: 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
  width: 0%;
}

.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  width: 30%;
  min-width: 200px;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 120px;
}

.volume-wrapper {
  flex: 1;
  position: relative;
  height: 12px;
  display: flex;
  align-items: center;
}

#volume-slider {
  position: absolute;
  top: 0;
  margin: 0;
  z-index: 2;
}

/* Now Playing Overlay */
#now-playing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--player-height);
  background-color: var(--bg-color);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(20px);
}

#now-playing-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.overlay-bg {
  position: absolute;
  top: -20%; left: -20%; right: -20%; bottom: -20%;
  background-image: url('');
  background-size: cover;
  background-position: center;
  filter: blur(100px) brightness(0.3);
  z-index: -1;
}

.overlay-close {
  position: absolute;
  top: 32px;
  right: 32px;
  background: rgba(0,0,0,0.3);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.overlay-close:hover {
  background: rgba(0,0,0,0.5);
  transform: scale(1.1);
}

.overlay-content {
  display: flex;
  gap: 64px;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  padding: 0 48px;
}

.overlay-art {
  width: 400px;
  height: 400px;
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  object-fit: cover;
}

.overlay-info {
  flex: 1;
}

.overlay-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.overlay-artist {
  font-size: 24px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
}

/* EQ Modal */
#eq-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

#eq-modal.active {
  opacity: 1;
  visibility: visible;
}

.eq-content {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 32px;
  width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.eq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.eq-presets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eq-preset-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-weight: 500;
}

.eq-preset-btn:hover {
  background: rgba(255,255,255,0.1);
}

.eq-preset-btn.active {
  border-color: var(--accent-secondary);
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-secondary);
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 1024px) {
  .overlay-content {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }
  .overlay-art {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    height: calc(100vh - var(--player-height) - 60px);
  }
  
  #sidebar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    justify-content: space-around;
    padding: 0;
    border-right: none;
    border-top: 1px solid var(--panel-border);
    position: fixed;
    bottom: var(--player-height);
  }
  
  .logo { display: none; }
  .nav-item { margin-bottom: 0; }
  
  .top-bar {
    padding: 0 16px;
  }
  
  .view {
    padding: 70px 16px 16px;
  }
  
  .album-header-large {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  
  .album-cover-large {
    width: 150px;
    height: 150px;
  }
  
  .album-info h1 {
    font-size: 32px;
  }
  
  .player-center { display: none; }
  .player-right { display: none; }
  .player-left { width: 100%; justify-content: space-between; }
  
  /* Mobile mini controls */
  .mobile-controls {
    display: flex;
    align-items: center;
    gap: 16px;
  }
}