:root {
  /* Light Theme */
  --background-light: #f8f9fa;
  --text-light: #1c1c1c;
  --primary-light: #7c4dff;
  --secondary-light: #651fff;
  --surface-light: #ffffff;
  --border-light: #e0e0e0;
  --accent-light: #d4bbff;
  --shadow-light: rgba(0, 0, 0, 0.08);
  
  /* Dark Theme */
  --background-dark: #121212;
  --text-dark: #f1f1f1;
  --primary-dark: #bb86fc;
  --secondary-dark: #a156ff;
  --surface-dark: #1e1e1e;
  --border-dark: #333333;
  --accent-dark: #4e2b89;
  --shadow-dark: rgba(0, 0, 0, 0.3);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  padding: 2rem;
  background-size: 400% 400%;
}

body.light {
  background-color: var(--background-light);
  color: var(--text-light);
  background-image: linear-gradient(120deg, #f8f9fa 0%, #f0f2f5 100%);
}

body.dark {
  background-color: var(--background-dark);
  color: var(--text-dark);
  background-image: linear-gradient(120deg, #121212 0%, #1a1a1a 100%);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

body.light .theme-toggle {
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px var(--shadow-light);
  color: var(--text-light);
}

body.dark .theme-toggle {
  background-color: rgba(30, 30, 30, 0.8);
  box-shadow: 0 4px 12px var(--shadow-dark);
  color: var(--text-dark);
}

.theme-toggle:hover {
  transform: scale(1.05);
}

body.light .moon-icon {
  display: none;
}

body.dark .sun-icon {
  display: none;
}

/* Container */
.container {
  max-width: 800px;
  margin: 1rem auto;
  padding: 2rem;
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  position: relative;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

body.light .container {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 40px var(--shadow-light);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

body.dark .container {
  background: rgba(30, 30, 30, 0.85);
  box-shadow: 0 10px 40px var(--shadow-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.container:hover {
  transform: translateY(-5px);
}

/* Logo and Header */
.logo-wrapper {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.logo {
  width: 180px;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(to right, var(--primary-light), #8C65F7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
  letter-spacing: -0.02em;
}

body.dark h1 {
  background: linear-gradient(to right, var(--primary-dark), #b388ff);
  -webkit-background-clip: text;
  background-clip: text;
}

.subtitle {
  text-align: center;
  margin-bottom: 2.5rem;
  opacity: 0.8;
  font-size: 1.1rem;
  font-weight: 400;
}

/* Vinyl Record Animation */
.vinyl-record {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(#000, #333, #000, #333, #000, #333, #000, #333);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.vinyl-record::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: var(--primary-light);
}

body.dark .vinyl-record::after {
  background-color: var(--primary-dark);
}

.vinyl-inner {
  width: 40%;
  height: 40%;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 1;
}

.vinyl-record.spin {
  animation: spin 8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Search Container */
.search-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  margin-left: 0.25rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  pointer-events: none;
}

input[type="text"] {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 400;
  transition: all 0.2s ease;
}

body.light input[type="text"] {
  background-color: var(--surface-light);
  border-color: var(--border-light);
  color: var(--text-light);
}

body.dark input[type="text"] {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
  color: var(--text-dark);
}

input[type="text"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

body.light input[type="text"]:focus {
  border-color: var(--primary-light);
}

body.dark input[type="text"]:focus {
  border-color: var(--primary-dark);
}

#artistAutocompleteSuggestion,
#songAutocompleteSuggestion {
  font-size: 0.9rem;
  cursor: pointer;
  padding-left: 0.5rem;
  margin-top: 0.25rem;
  border-left: 2px solid;
  transition: all 0.2s ease;
}

body.light #artistAutocompleteSuggestion,
body.light #songAutocompleteSuggestion {
  border-color: var(--primary-light);
  opacity: 0.7;
}

body.dark #artistAutocompleteSuggestion,
body.dark #songAutocompleteSuggestion {
  border-color: var(--primary-dark);
  opacity: 0.7;
}

#artistAutocompleteSuggestion:hover,
#songAutocompleteSuggestion:hover {
  opacity: 1;
}

/* Button */
.primary-button {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
}

body.light .primary-button {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  color: white;
  box-shadow: 0 4px 14px rgba(124, 77, 255, 0.2);
}

body.dark .primary-button {
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
  color: #121212;
  box-shadow: 0 4px 14px rgba(187, 134, 252, 0.3);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

.primary-button:active {
  transform: translateY(0);
}

/* Recommendations Section */
.recommendations-section {
  margin-top: 4rem;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60px;
  height: 3px;
  border-radius: 2px;
}

body.light h2::after {
  background-color: var(--primary-light);
}

body.dark h2::after {
  background-color: var(--primary-dark);
}

.recommendations-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.recommendations-list li {
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

body.light .recommendations-list li {
  background-color: var(--surface-light);
  border-color: var(--border-light);
  box-shadow: 0 4px 12px var(--shadow-light);
}

body.dark .recommendations-list li {
  background-color: var(--surface-dark);
  border-color: var(--border-dark);
  box-shadow: 0 4px 12px var(--shadow-dark);
}

.recommendations-list li:hover {
  transform: translateY(-5px);
}

body.light .recommendations-list li:hover {
  box-shadow: 0 10px 20px var(--shadow-light);
  border-color: var(--primary-light);
}

body.dark .recommendations-list li:hover {
  box-shadow: 0 10px 20px var(--shadow-dark);
  border-color: var(--primary-dark);
}

/* Loading Screen */
.loadingScreen {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.light .loadingScreen {
  background-color: rgba(248, 249, 250, 0.8);
}

body.dark .loadingScreen {
  background-color: rgba(18, 18, 18, 0.8);
}

.loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Music Pulse Animation */
.music-pulse {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 40px;
}

.music-pulse span {
  width: 6px;
  height: 20px;
  border-radius: 3px;
  animation: pulse 1.5s ease infinite alternate;
}

body.light .music-pulse span {
  background-color: var(--primary-light);
}

body.dark .music-pulse span {
  background-color: var(--primary-dark);
}

.music-pulse span:nth-child(2) {
  animation-delay: 0.2s;
}

.music-pulse span:nth-child(3) {
  animation-delay: 0.4s;
}

.music-pulse span:nth-child(4) {
  animation-delay: 0.6s;
}

.music-pulse span:nth-child(5) {
  animation-delay: 0.8s;
}

@keyframes pulse {
  0% {
    height: 8px;
  }
  50% {
    height: 32px;
  }
  100% {
    height: 16px;
  }
}

/* Media Queries */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .container {
    padding: 1.5rem;
    margin-top: 3rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
  
  .vinyl-record {
    width: 50px;
    height: 50px;
  }
  
  .recommendations-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  input[type="text"],
  .primary-button {
    padding: 12px;
  }

  .input-icon {
    left: 12px;
  }

  input[type="text"] {
    padding-left: 38px;
  }

  h1 {
    font-size: 1.8rem;
  }
  
  .vinyl-record {
    width: 40px;
    height: 40px;
  }
  
  .recommendations-list {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding-bottom: 100px; /* Extra space for keyboard */
  }
}
