:root {
  --bg-color: #f9f9f9;
  --text-color: #333;
  --card-bg: #ffffff;
  --button-bg: #3498db;
  --button-hover: #2980b9;
  --shadow: rgba(0, 0, 0, 0.1);
}

body.dark {
  --bg-color: #1e1e1e;
  --text-color: #f1f1f1;
  --card-bg: #2c2c2c;
  --button-bg: #555;
  --button-hover: #444;
  --shadow: rgba(255, 255, 255, 0.05);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-align: center;
  padding: 40px 20px;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2 {
  color: var(--text-color);
}

form {
  margin-bottom: 30px;
}

input[type="text"],
button {
  font-size: 16px;
  border-radius: 8px;
}

/* Music Background Animation */
.music-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.music-bg span {
  position: absolute;
  bottom: -50px;
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.1);
  animation: rise 10s infinite linear;
}

.music-bg span:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.music-bg span:nth-child(2) { left: 20%; animation-duration: 12s; animation-delay: 2s; }
.music-bg span:nth-child(3) { left: 35%; animation-duration: 10s; animation-delay: 4s; }
.music-bg span:nth-child(4) { left: 50%; animation-duration: 15s; animation-delay: 1s; }
.music-bg span:nth-child(5) { left: 65%; animation-duration: 9s; animation-delay: 3s; }
.music-bg span:nth-child(6) { left: 80%; animation-duration: 11s; animation-delay: 5s; }
.music-bg span:nth-child(7) { left: 90%; animation-duration: 13s; animation-delay: 7s; }
.music-bg span:nth-child(8) { left: 15%; animation-duration: 14s; animation-delay: 6s; }
.music-bg span:nth-child(9) { left: 45%; animation-duration: 9.5s; animation-delay: 2.5s; }
.music-bg span:nth-child(10) { left: 75%; animation-duration: 11.5s; animation-delay: 4.5s; }
.music-bg span:nth-child(11) { left: 5%; animation-duration: 12.5s; animation-delay: 1.5s; }
.music-bg span:nth-child(12) { left: 55%; animation-duration: 10.5s; animation-delay: 3.5s; }

@keyframes rise {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Light Mode Overrides for BG */
body:not(.dark) .music-bg {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
body:not(.dark) .music-bg span {
  color: rgba(0, 0, 0, 0.05);
}

/* Button Enhancements */
button {
  background: #3498db; /* Solid color */
  box-shadow: 0 4px 6px ;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 14px 24px; /* More padding */
  border-radius: 8px;
  font-size: 1.05rem;
}

body.dark button {
  background: #8e44ad; /* Different color for dark mode */
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  filter: brightness(1.1);
}

input[type="text"] {
  padding: 16px 20px; /* Increased padding */
  width: 80%; /* Increased width */
  max-width: 600px; /* Increased max-width */
  border: 1px solid #ccc;
  background-color: var(--card-bg);
  color: var(--text-color);
  font-size: 1.1rem; /* Larger font */
  border-radius: 8px;
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #8e44ad;
  box-shadow: 0 0 10px rgba(142, 68, 173, 0.3);
}

li {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 3rem; /* Increased spacing between results */
  padding: 10px 0px 30px 30px;
  border-radius: 8px;
}

body.dark li{
  background: rgba(10, 10, 40, 1);
}

/* Genius Button */
.genius-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: #ffff64; /* Genius yellow */
  color: #000;
  text-decoration: none;
  font-weight: bold;
  border-radius: 5px;
  transition: all 0.3s ease;
  border: 2px solid #000;
}

.genius-btn:hover {
  background: #000;
  color: #ffff64;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.lyrics-fallback {
  text-align: center;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.lyrics-fallback p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  opacity: 0.8;
}
  list-style: none;
  padding: 0;
}

li {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto 2.5rem auto;
  padding: 20px;
  border-radius: 12px;
  background-color: var(--card-bg);
  box-shadow: 0 2px 8px var(--shadow);
  border-left: 6px solid #8e44ad;
  animation: fadeIn 0.6s ease-in-out;
}

/* 🎬 + 🎵 layout */
.lyrics-video-container {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  justify-content: flex-start;
  align-items: flex-start;
  margin-top: 1rem;
  flex-wrap: nowrap;
  width: 100%;
}

.lyrics-video-container iframe {
  flex: 0 0 55%;
  max-width: 640px;
  height: 360px;
  border-radius: 10px;
  border: none;
}

.lyrics-box {
  flex: 0 0 40%;
  max-width: 400px;
  max-height: 360px;
  overflow-y: auto;
  background-color: var(--card-bg);
  color: var(--text-color);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px var(--shadow);
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

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

/* Hero Header */
.hero-header {
  margin-bottom: 2.5rem;
  padding-top: 20px;
}

.hero-header h1 {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.music-icon {
  font-size: 2.8rem;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.header-gradient {
  background: linear-gradient(90deg, #8e44ad, #3498db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtext {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-color);
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
}

.theme-toggle input {
  display: none;
}

.theme-toggle label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 70px;
  height: 34px;
  background-color: var(--card-bg);
  border-radius: 50px;
  padding: 5px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 5px var(--shadow);
  transition: background 0.3s ease;
}

.theme-toggle .icon {
  font-size: 14px;
  z-index: 1;
}

.theme-toggle .ball {
  position: absolute;
  width: 26px;
  height: 26px;
  background-color: #808080;
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

body.dark .theme-toggle .ball {
  transform: translateX(0); 
  background-color: #f1c40f;
}
body:not(.dark) .theme-toggle .ball {
  transform: translateX(37px);
  background-color: #f1c40f;
}

.centered {
  max-width: 1100px;
  margin: 0 auto;
}

.error-message {
  margin-top: 20px;
  font-size: 1.1rem;
  color: #e74c3c;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .lyrics-video-container {
    flex-direction: column;
    align-items: center;
  }

  .lyrics-video-container iframe,
  .lyrics-box {
    width: 100%;
    max-width: 100%;
  }

  .lyrics-box {
    margin-top: 1rem;
  }
}

@media (max-width: 600px) {
  input[type="text"] {
    width: 100%;
    margin-bottom: 10px;
  }

  button {
    width: 100%;
  }

  .hero-header h1 {
    font-size: 2rem;
  }

  .subtext {
    font-size: 1rem;
    padding: 0 10px;
  }
}
