* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', sans-serif;
  height: 100vh;
  overflow: hidden;
  color: #fff;
  background: #0a0a0c;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Background video with hardware acceleration */
#bgVideo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: brightness(0.5) blur(5px);
  transform: translateZ(0);
  will-change: transform;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: -1;
}

/* Light mode overrides */
body.light-mode {
  background: #f2f4f8;
  color: #111;
}
body.light-mode .overlay {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(1px);
}
body.light-mode .sidebar,
body.light-mode .player,
body.light-mode .modal-content {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  color: #111;
  border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .card {
  background: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
body.light-mode .card .info h3,
body.light-mode .card .info p {
  color: #111;
}
body.light-mode .sidebar ul li {
  color: #333;
}
body.light-mode .sidebar ul li.active,
body.light-mode .sidebar ul li:hover {
  background: #1db95420;
  color: #1db954;
}

/* App Layout */
.app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 2;
}
.sidebar {
  width: 280px;
  background: rgba(18, 18, 24, 0.88);
  backdrop-filter: blur(20px);
  padding: 32px 20px;
  height: 100%;
  position: fixed;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  z-index: 110;
  display: flex;
  flex-direction: column;
}
.logo {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo i {
  font-size: 2rem;
  color: #1db954;
}
.logo span span {
  color: #1db954;
}
.sidebar ul {
  flex: 1;
  list-style: none;
}
.sidebar ul li {
  padding: 14px 18px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 6px;
  touch-action: manipulation;
}
.sidebar ul li i {
  width: 26px;
  font-size: 1.3rem;
}
.sidebar-bottom {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}
#themeToggle, #aiBtn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  width: 48px;
  transition: 0.2s;
  touch-action: manipulation;
}
body.light-mode #themeToggle, body.light-mode #aiBtn {
  background: #e2e6ea;
  color: #111;
}
.hamburger {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 30px;
  font-size: 1.5rem;
  z-index: 120;
  backdrop-filter: blur(8px);
  cursor: pointer;
  touch-action: manipulation;
}
.main {
  flex: 1;
  margin-left: 280px;
  padding: 28px 32px;
  overflow-y: auto;
  height: calc(100vh - 86px);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
/* Ticker - hardware accelerated smooth marquee */
.ticker {
  background: rgba(29, 185, 84, 0.2);
  border-radius: 40px;
  padding: 12px 0;
  margin-bottom: 28px;
  overflow: hidden;
  backdrop-filter: blur(4px);
  position: relative;
}
.ticker-content {
  display: inline-block;
  white-space: nowrap;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #1db954;
  will-change: transform;
  animation: tickerScroll 36s linear infinite;
  animation-timing-function: linear;
}
@keyframes tickerScroll {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}
/* Pause animation on hover for better UX */
.ticker:hover .ticker-content {
  animation-play-state: paused;
}
h1 {
  font-size: 2.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #9bffb0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
body.light-mode h1 {
  background: linear-gradient(135deg, #1a1a2e, #1db954);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
h2 {
  font-size: 1.2rem;
  font-weight: 400;
  color: #ccc;
  margin-bottom: 24px;
}
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 22px;
  margin-top: 10px;
}
.card {
  background: rgba(28, 28, 36, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  border: 1px solid rgba(255,255,255,0.05);
  transform: translateZ(0);
  will-change: transform;
}
.card:active {
  transform: scale(0.98);
}
.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  pointer-events: none;
}
.card .info {
  padding: 14px;
}
.card .info h3 {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .info p {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 5px;
}
.like-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.65);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: 0.2s;
  z-index: 5;
  touch-action: manipulation;
}
.like-btn.liked {
  color: #ff3b5c;
  background: rgba(255,255,255,0.9);
}
.search-container {
  position: relative;
  margin: 18px 0 28px;
}
.search-container i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  pointer-events: none;
}
#searchInput {
  width: 100%;
  padding: 14px 20px 14px 52px;
  background: rgba(40,40,55,0.9);
  border: none;
  border-radius: 60px;
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(8px);
  touch-action: manipulation;
}
body.light-mode #searchInput {
  background: #f0f2f5;
  color: #111;
}
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 86px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 200;
  border-top: 1px solid rgba(255,255,255,0.1);
  touch-action: pan-x pan-y;
}
.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 200px;
}
.now-playing img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  pointer-events: none;
}
.controls {
  display: flex;
  align-items: center;
  gap: 18px;
}
.controls button {
  background: none;
  border: none;
  color: #eee;
  font-size: 1.7rem;
  cursor: pointer;
  transition: 0.1s;
  touch-action: manipulation;
}
.play-pause {
  background: #1db954;
  color: black;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}
.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
}
.progress-bar {
  flex: 1;
  height: 5px;
  background: #4a4a5a;
  border-radius: 10px;
  cursor: pointer;
  touch-action: none;
  position: relative;
}
.progress {
  width: 0%;
  height: 100%;
  background: #1db954;
  border-radius: 10px;
  pointer-events: none;
}
.volume {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.modal-content {
  background: rgba(24,24,32,0.97);
  backdrop-filter: blur(18px);
  border-radius: 32px;
  padding: 26px;
  max-width: 680px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ai-tabs {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.ai-tab {
  background: rgba(255,255,255,0.1);
  border: none;
  padding: 10px 20px;
  border-radius: 40px;
  color: white;
  cursor: pointer;
  font-weight: 500;
  touch-action: manipulation;
}
.ai-tab.active {
  background: #1db954;
  color: black;
}
.ai-tab-content {
  display: none;
  margin-top: 20px;
}
.ai-tab-content.active {
  display: block;
}
.mood-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}
.mood-card {
  background: #1e1e2c;
  padding: 12px 18px;
  border-radius: 60px;
  cursor: pointer;
  transition: 0.2s;
  touch-action: manipulation;
}
.ask-btn {
  background: #1db954;
  border: none;
  padding: 12px 20px;
  border-radius: 40px;
  margin-top: 12px;
  font-weight: bold;
  cursor: pointer;
  touch-action: manipulation;
}
#aiResponse {
  margin-top: 18px;
  background: rgba(0,0,0,0.3);
  padding: 16px;
  border-radius: 20px;
}
.close-btn {
  background: #2c2c3a;
  border: none;
  padding: 10px 20px;
  border-radius: 40px;
  margin-top: 20px;
  cursor: pointer;
  touch-action: manipulation;
}
.empty-state {
  text-align: center;
  padding: 60px 20px;
  opacity: 0.7;
}
.section {
  display: none;
}
.section.active {
  display: block;
}
@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-100%);
    width: 270px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .hamburger {
    display: block;
  }
  .main {
    margin-left: 0;
    padding: 20px 18px;
  }
  .player {
    padding: 0 12px;
  }
  .progress-container {
    min-width: 160px;
  }
  .now-playing {
    min-width: 140px;
  }
  .volume {
    display: none;
  }
  .song-grid {
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
@media (max-width: 480px) {
  .song-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  .player {
    height: 74px;
  }
  .controls button {
    font-size: 1.3rem;
  }
  .play-pause {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  .now-playing img {
    width: 44px;
    height: 44px;
  }
}