@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;500;700&family=Outfit:wght@300;500;700&display=swap');

:root {
  --bg-dark: #09090b;
  --bg-surface: rgba(18, 18, 22, 0.7);
  --bg-card: rgba(255, 255, 255, 0.03);
  --accent-primary: #7c4dff;
  --accent-secondary: #00e5ff;
  --accent-gradient: linear-gradient(135deg, #7c4dff, #00e5ff);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --player-height: 100px;
  --sidebar-width: 280px;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(124, 77, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(0, 229, 255, 0.08) 0%, transparent 40%);
}

.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr var(--player-height);
  height: 100vh;
}

/* Sidebar */
.sidebar {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(40px);
  border-right: 1px solid var(--glass-border);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-left: 0.5rem;
}

.nav-item {
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.nav-item:hover, .nav-item.active {
  background: var(--bg-card);
  color: var(--text-main);
  transform: translateX(5px);
}

.nav-item.active {
  background: rgba(124, 77, 255, 0.1);
  border: 1px solid rgba(124, 77, 255, 0.2);
}

.nav-item i {
  font-size: 1.3rem;
  transition: color 0.3s;
}

.nav-item.active i {
  color: var(--accent-primary);
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  scrollbar-width: thin;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.search-container {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 500px;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 480px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.search-container:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(124, 77, 255, 0.5);
  box-shadow: 0 0 25px rgba(124, 77, 255, 0.15), inset 0 2px 4px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.search-container i {
  color: var(--text-muted);
  font-size: 1rem;
  transition: color 0.3s;
}

.search-container:focus-within i {
  color: var(--accent-primary);
}

.search-container input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  width: 100%;
  font-weight: 500;
}

.search-container input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.15), rgba(0, 229, 255, 0.1));
  border-radius: 30px;
  padding: 4rem;
  margin-bottom: 3rem;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Music Grid */
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 2rem;
}

.song-card {
  background: var(--bg-card);
  padding: 1.2rem;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
}

.song-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-image-container {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-image-container img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.song-card:hover .card-image-container img {
  transform: scale(1.1) rotate(2deg);
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s;
}

.song-card:hover .play-overlay {
  opacity: 1;
}

.play-overlay i {
  color: white;
  font-size: 3rem;
  transform: scale(0.5);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.song-card:hover .play-overlay i {
  transform: scale(1);
}

.song-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent-gradient);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Track List View */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
}

.track-item {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 100px;
  align-items: center;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  transition: background 0.2s;
  cursor: pointer;
  color: var(--text-muted);
}

.track-item:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.track-item .track-title {
  color: var(--text-main);
  font-weight: 600;
}

/* Player Bar */
.player-bar {
  grid-column: span 2;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(40px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 2.5rem;
  justify-content: space-between;
  z-index: 100;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 30%;
}

.now-playing img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: 40%;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.control-buttons i {
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
  opacity: 0.7;
}

.control-buttons i:hover {
  color: white;
  opacity: 1;
  transform: scale(1.1);
}

.play-btn {
  background: white;
  color: #000 !important;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.play-btn i {
  color: #000 !important;
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

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

.progress-bar {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 2px;
}

.progress-fill {
  height: 4px;
  background: var(--accent-gradient);
  width: 0%;
  border-radius: 10px;
  transition: width 0.1s linear;
  position: relative;
}

.progress-bar:hover .progress-fill {
  background: white;
  height: 6px;
}

.volume-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  width: 30%;
  justify-content: flex-end;
  color: var(--text-muted);
}

.volume-controls i:hover {
  color: var(--text-main);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.page > * {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 0.8rem 1rem;
  justify-content: space-around;
  z-index: 1000;
}

.mobile-nav .nav-item {
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.7rem;
  padding: 0.5rem;
  margin: 0;
  background: transparent;
  border: none;
}

.mobile-nav .nav-item i {
  font-size: 1.4rem;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto; /* Player bar height auto */
  }
  
  .sidebar {
    display: none;
  }
  
  .mobile-nav {
    display: flex;
  }

  .main-content {
    padding-bottom: 70px; /* Space for mobile nav */
  }

  .header {
    padding: 1rem !important;
  }

  .search-bar {
    max-width: 100%;
  }

  .player-bar {
    padding: 0.8rem 1rem;
    height: auto;
    flex-direction: column;
    gap: 1rem;
    bottom: 60px; /* Above mobile nav */
    border-radius: 20px 20px 0 0;
    background: rgba(18, 18, 22, 0.95);
  }

  .now-playing {
    width: 100%;
    justify-content: center;
  }

  .player-controls {
    width: 100%;
  }

  .volume-controls {
    display: none;
  }

  .hero {
    padding: 2rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .music-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  .song-card {
    padding: 0.8rem;
  }
  
  .track-item {
    grid-template-columns: 30px 1fr 60px;
  }
  
  .track-item div:nth-child(3) {
    display: none; /* Hide artist column on mobile track list */
  }
}

/* Lyrics Overlay */
.lyrics-overlay {
  position: fixed;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(50px);
  z-index: 2000;
  transition: top 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  padding: 4rem 2rem;
  overflow-y: auto;
}

.lyrics-overlay.active {
  top: 0;
}

.lyrics-header {
  position: absolute;
  top: 2rem;
  right: 2rem;
}

#close-lyrics {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  transition: 0.3s;
}

#close-lyrics:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lyrics-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

#lyrics-title {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

#lyrics-artist {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 4rem;
}

#lyrics-text {
  font-size: 1.8rem;
  line-height: 1.6;
  font-weight: 700;
  color: var(--text-main);
  white-space: pre-line;
}

/* Track Items in Album View */
.track-item {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 60px;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
  color: var(--text-muted);
}

.track-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transform: translateX(4px);
}

.track-title {
  color: white !important;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

