:root {
  --primary-color: #a393eb;
  --secondary-color: #5e63b6;
  --text-color: #ffffff;
  --background-color: #27296d;
  --gradient-color-1: rgba(183, 167, 255, 1);
  --gradient-color-2: rgba(114, 119, 202, 1);
  --gradient-color-3: rgba(59, 61, 129, 1);
  --gradient-color-4: rgba(40, 41, 76, 1);
  --error-color: #e74c3c;
  --spacing-small: 0.5rem;
  --spacing-medium: 1rem;
  --spacing-large: 2rem;
}

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

html,
body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  font-family: "Outfit", "Arial", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Default dark theme */
body {
  background: radial-gradient(circle, var(--gradient-color-1) 0%, var(--gradient-color-2) 30%, var(--gradient-color-3) 70%, var(--gradient-color-4) 100%), repeating-linear-gradient(45deg, transparent 0, transparent 10px, rgba(183, 167, 255, 0.08) 10px, rgba(183, 167, 255, 0.08) 20px);
  background-attachment: fixed;
}

/* LIGHT THEME */
[data-theme="light"] body {
  background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(240, 240, 255, 1) 26%, rgba(230, 230, 250, 1) 76%, rgba(220, 220, 245, 1) 100%), repeating-linear-gradient(45deg, transparent 0, transparent 10px, rgba(163, 147, 235, 0.05) 10px, rgba(163, 147, 235, 0.05) 20px);
  background-attachment: fixed;
}

[data-theme="light"] {
  --primary-color: #5e63b6;
  --secondary-color: #a393eb;
  --text-color: #27296d;
  --background-color: #f8f8ff;
  --error-color: #e74c3c;
}

[data-theme="light"] .welcome-icon {
  color: var(--secondary-color);
}

[data-theme="light"] .welcome-message p {
  color: var(--secondary-color);
}

[data-theme="light"] .search-input {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

[data-theme="light"] .search-input::placeholder {
  color: var(--secondary-color);
}

[data-theme="light"] .search-input:hover {
  border-color: var(--secondary-color);
  box-shadow: 0 0 10px rgba(94, 99, 182, 0.8);
  transition: all 0.2s ease;
}

[data-theme="light"] .search-input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 10px rgba(94, 99, 182, 0.8);
  color: var(--text-color);
  transition: all 0.2s ease;
}

[data-theme="light"] .search-button {
  border: 2px solid var(--secondary-color);
  background: var(--secondary-color);
  color: var(--background-color);
}

[data-theme="light"] .search-button:hover {
  color: var(--background-color);
  border-color: var(--text-color);
  background: var(--text-color);
  box-shadow: 0 0 10px rgba(94, 99, 182, 0.8);
}

[data-theme="light"] .sort-select {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a393eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="light"] .sort-select:hover,
[data-theme="light"] .sort-select:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 10px rgba(94, 99, 182, 0.8);
  color: var(--text-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a393eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  outline: none;
}

[data-theme="light"] .contact-form input:focus::placeholder,
[data-theme="light"] .contact-form textarea:focus::placeholder {
  color: var(--text-color);
}

[data-theme="light"] .contact-form button {
  border: 2px solid var(--secondary-color);
  background: var(--secondary-color);
  color: var(--background-color) !important;
}

[data-theme="light"] .contact-form button:hover {
  border-color: var(--text-color);
  background: var(--text-color);
  color: var(--background-color) !important;
  box-shadow: 0 0 10px rgba(94, 99, 182, 0.8);
}

[data-theme="light"] .back-to-top {
  background: var(--secondary-color);
  color: var(--background-color);
}

[data-theme="light"] footer p {
  color: var(--secondary-color);
}

/* Layout */
main {
  padding: var(--spacing-large);
  max-width: 1200px;
  margin: 0 auto;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* NAVIGATION */
nav {
  background-color: var(--background-color-top);
  padding: 0.4rem var(--spacing-medium);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1000;
  margin: 1rem auto;
  border-radius: 50px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: var(--spacing-medium);
}

.nav-links.active {
  right: 0;
}

.nav-links li {
  display: block;
  transition: transform 0.3s ease;
}

.nav-links li:hover {
  transform: translateY(-1px);
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.5rem 1.5rem;
  background: var(--background-color-top);
  border: 2px solid var(--secondary-color);
  border-radius: 50px;
  transition: all 0.3s ease;
  display: inline-block;
}

.nav-links a:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 6px 2px var(--primary-color), 0 0 10px 4px var(--secondary-color);
  color: var(--text-color);
}

.logo {
  display: flex;
  align-items: center;
  padding-left: 8px;
}

.logo h1 {
  margin: 0;
  font-size: 2rem;
  padding: var(--spacing-small);
}

/* DARK/LIGHT THEME TOGGLE */
.theme-toggle {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: var(--text-color);
  transition: all 0.3s ease;
  z-index: 10;
  border: 2px solid var(--secondary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes colorSwitchPulse {
  0% {
    box-shadow: 0 0 0 0 var(--primary-color), 0 0 0 0 var(--secondary-color);
    transform: translateY(-50%);
    color: var(--text-color);
    border-color: var(--secondary-color);
  }
  30% {
    box-shadow: 0 0 6px 2px var(--primary-color), 0 0 10px 4px var(--secondary-color);
    transform: translateY(-50%) scale(1.05);
    color: var(--primary-color);
    border-color: var(--primary-color);
  }
  100% {
    box-shadow: 0 0 0 0 var(--primary-color), 0 0 0 0 var(--secondary-color);
    transform: translateY(-50%);
    color: var(--text-color);
    border-color: var(--secondary-color);
  }
}

.theme-toggle:hover {
  animation: colorSwitchPulse 2s ease-out infinite;
  border-color: var(--secondary-color);
  box-shadow: 0 0 6px rgba(94, 99, 182, 0.8);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  transition: transform 0.5s ease;
}

.theme-toggle:hover svg {
  transform: rotate(30deg);
}

.sun-moon-path {
  transition: d 0.5s ease, opacity 0.5s ease;
}

@media (min-width: 769px) {
  .theme-toggle {
    right: 20px;
  }

  .nav-links {
    padding-right: 60px;
  }
}

@media (max-width: 768px) {
  .theme-toggle {
    right: 60px;
  }

  .contact-form button {
    font-size: 0.9rem;
    width: 40%;
    padding: 0.75rem 1rem;
  }
}

/* Search and Sort Container Styles */
.search-wrapper {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  position: relative;
}

.search-form {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.clear-search-button {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--background-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 50%;
}

.clear-search-button:hover {
  background: rgba(39, 41, 109, 0.1);
  color: var(--text-color);
}

[data-theme="light"] .clear-search-button {
  color: var(--secondary-color);
}

[data-theme="light"] .clear-search-button:hover {
  background: rgba(94, 99, 182, 0.1);
  color: var(--text-color);
}

.sort-container {
  width: 100%;
  max-width: 130px;
  margin: 0;
}

.sort-container.hidden {
  display: none;
}

.sort-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 25px;
  color: var(--background-color);
  border: 2px solid var(--background-color);
  cursor: pointer;
  font-size: 1.1rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2327296d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
  transition: all 0.1s ease-in;
}

.sort-select option {
  background-color: var(--secondary-color);
  color: var(--text-color);
  padding: 10px;
}

.sort-select option:focus {
  background-color: var(--background-color);
  color: var(--text-color);
}

.sort-select:focus {
  outline: none;
  border-color: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  color: var(--text-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.sort-select:hover {
  border-color: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* HAMBURGER MENU STYLES */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background: var(--text-color);
  border-radius: 10px;
  transition: all 0.3s linear;
  margin: 2px 0;
}

/* SEARCH FORM */
.search-input {
  flex: 1;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px solid var(--background-color);
  border-radius: 25px;
  font-size: 1.1rem;
  background: none;
  color: var(--background-color);
  transition: all 0.1s ease-in;
  min-width: 0;
}

.search-input:hover {
  border-color: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.search-input:focus {
  outline: none;
  border-color: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  color: var(--text-color);
}

.search-input::placeholder {
  color: var(--background-color);
  transition: color 0.1s ease-in;
}

.search-input:focus::placeholder {
  color: var(--text-color);
}

.search-button {
  border: 2px solid var(--background-color);
  padding: 0.75rem 1.5rem;
  flex-shrink: 0;
  border-radius: 25px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.1s ease-in;
}

.search-button:hover {
  color: var(--background-color);
  outline: none;
  border-color: var(--text-color);
  background: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: none;
}

.search-button:active {
  transform: none;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  padding: 2rem;
}

.loading-spinner.hidden {
  display: none;
}

.loading-ring {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--secondary-color);
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

/* Error Message */
.error-message {
  background-color: var(--error-color);
  color: white;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 600px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideDown 0.3s ease-out;
}

.error-message.hidden {
  display: none;
}

.error-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
}

/* WELCOME MESSAGE */
.welcome-message {
  text-align: center;
  padding: 1rem;
  color: var(--text-color);
  margin-bottom: 0;
}

.welcome-message h2 {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.welcome-message p {
  font-size: 1.7rem;
  color: var(--background-color);
  margin-bottom: 1rem;
}

.welcome-icon {
  color: var(--background-color);
  font-size: 4rem;
  animation: bounce 2s infinite;
}

/* Hide welcome message when results are shown */
.results-grid:not(:empty) ~ .welcome-message {
  display: none;
}

.results-grid:not(:empty) ~ .search-form {
  display: flex;
  margin-bottom: 2rem;
}

/* Results Grid */
.results-grid {
  display: grid;
  gap: 2rem;
  padding: 2rem;
}

/* Track Card */
.track-card {
  border-radius: 40px 40px 40px 40px;
  overflow: hidden;
  height: 100%;
  min-height: 400px;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background-color: rgba(39, 41, 109, 0.7);
  border: 1px solid rgba(163, 147, 235, 0.1);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.05), 0 1px 1px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.1), 0 8px 8px rgba(0, 0, 0, 0.1), inset 0 0 15px rgba(163, 147, 235, 0.1);
}

.track-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.track-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: rgba(39, 41, 109, 1);
  border-radius: 40px 40px 0 0;
  overflow: hidden;
  border: 1px solid rgba(163, 147, 235, 0.1);
  box-shadow: inset 0 0 15px rgba(163, 147, 235, 0.1);
}

.track-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.track-card:hover .track-image {
  border: 1px solid rgba(163, 147, 235, 0.3);
  box-shadow: inset 0 0 20px rgba(163, 147, 235, 0.2);
}

.track-card.playing .track-image {
  border: 1px solid rgba(163, 147, 235, 0.4);
  box-shadow: inset 0 0 25px rgba(163, 147, 235, 0.2);
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.play-icon {
  color: white;
  font-size: 3rem;
}

.track-info {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  flex: 1;
  height: 140px;
}

.track-controls {
  overflow: hidden;
  transition: all 0.3s ease;
  height: 0;
  opacity: 0;
  padding: 0 1rem;
}

.track-card.playing .track-controls {
  height: 160px;
  opacity: 1;
}

.time-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.track-name {
  margin: 0.2rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 0 0 68px;
  padding-left: 0.5rem;
  color: #ffffff;
}

.artist-name,
.album-name {
  margin: 0.2rem 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 0 0 46px;
  padding-left: 0.5rem;
}

.track-actions {
  margin-top: auto;
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.preview-button {
  border: 2px solid var(--background-color);
  padding: 0.75rem 1.5rem;
  flex-shrink: 0;
  border-radius: 25px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.1s ease-in;
  width: 100%;
  max-width: 200px;
}

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

.preview-button:hover {
  color: var(--background-color);
  outline: none;
  border-color: var(--text-color);
  background: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

/* States */
.track-card:hover {
  transform: translateY(-5px);
}

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

.track-card:hover .play-icon {
  transform: scale(1);
}

.track-card.playing .play-overlay {
  opacity: 1;
  background: var(--secondary-color);
}

/* .track-card.playing .preview-button {
  background-color: var(--background-color);
} */

.track-card.loading .play-icon {
  display: none;
}

.track-card.loading .loading-ring {
  display: block;
}

.track-card.playing {
  animation: cardPulse 2s ease-in-out infinite;
}

/* Update existing hover effect to work with the animation */
.track-card:hover:not(.playing) {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* VOLUME CONTROL */
.player-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
}

.time-container {
  width: 100%;
}

.volume-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.track-card.playing .volume-control {
  transform: translateY(0);
}

.volume-slider {
  width: 100%;
  margin: 0.5rem 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

/* Webkit (Chrome, Safari, newer Edge) */
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--text-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Firefox */
.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-color);
  cursor: pointer;
  border: none;
}

.volume-slider::-moz-range-track {
  background: rgba(255, 255, 255, 0.1);
  height: 4px;
  border-radius: 2px;
}

/* Edge */
.volume-slider::-ms-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-color);
  cursor: pointer;
  border: none;
}

.mute-button {
  border: 2px solid var(--background-color);
  background: var(--background-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  width: 45px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.1s ease-in;
}

.current-time,
.duration {
  font-family: monospace;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  display: inline-block;
}

.duration {
  display: block;
  margin-top: 0.3rem;
}

.mute-button:hover {
  color: var(--primary-color);
  outline: none;
  border-color: var(--text-color);
  background: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

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

.volume-slider,
.mute-button {
  pointer-events: all;
}

/* PROGRESS BAR */
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  position: relative;
}

.progress-bar.hidden {
  opacity: 0;
}

.progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--text-color);
  border-radius: 2px;
  width: 0;
}

/* TIME DISPLAY */
.progress-container {
  margin-bottom: 1rem;
}

.progress-container.hidden,
.player-controls.hidden {
  display: none;
}

.time-info {
  display: flex;
  justify-content: space-between;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* INFO SECTION */
.info-section {
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 40px;
  overflow: hidden;
  padding: 2rem;
  position: relative;
  background-color: rgba(39, 41, 109, 0.7);
  border: 1px solid rgba(163, 147, 235, 0.1);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.05), 0 1px 1px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.1), 0 8px 8px rgba(0, 0, 0, 0.1), inset 0 0 15px rgba(163, 147, 235, 0.1);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.info-section.hidden {
  display: none;
}

.info-section.entering {
  opacity: 0;
  transform: scale(0.7);
}

/* BACK TO TOP BUTTON */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: transparent;
  border: 2px solid var(--secondary-color);
  color: var(--text-color);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-to-top.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  animation: backToTopPulse 2s ease-out infinite;
}

@keyframes backToTopPulse {
  0% {
    box-shadow: 0 0 0 0 var(--primary-color), 0 0 0 0 var(--secondary-color);
  }
  30% {
    box-shadow: 0 0 6px 2px var(--primary-color), 0 0 10px 4px var(--secondary-color);
  }
  100% {
    box-shadow: 0 0 0 0 var(--primary-color), 0 0 0 0 var(--secondary-color);
  }
}

.guide-content,
.about-content {
  margin-top: 1.5rem;
}

/* GET STARTED SECTION */
#get-started {
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 40px;
  overflow: hidden;
  padding: 2rem;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
  background-color: rgba(39, 41, 109, 0.7);
  border: 1px solid rgba(163, 147, 235, 0.1);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.05), 0 1px 1px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.1), 0 8px 8px rgba(0, 0, 0, 0.1), inset 0 0 15px rgba(163, 147, 235, 0.1);
}

#get-started:hover {
  animation: cardPulse 2s ease-out infinite;
  border: 1px solid rgba(163, 147, 235, 0.3);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.1), 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(163, 147, 235, 0.2);
}

/* Light theme adjustments */
[data-theme="light"] #get-started {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(94, 99, 182, 0.1);
}

[data-theme="light"] #get-started:hover {
  border: 1px solid rgba(94, 99, 182, 0.3);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.1), 0 8px 16px rgba(94, 99, 182, 0.1), inset 0 0 20px rgba(94, 99, 182, 0.1);
}

/* Get Started content styling */
#get-started h2 {
  color: var(--text-color);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

#get-started .guide-content h3 {
  color: var(--text-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

#get-started .guide-content p {
  color: var(--text-color);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ABOUT SECTION */
#about {
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 40px;
  overflow: hidden;
  padding: 2rem;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
  background-color: rgba(39, 41, 109, 0.7);
  border: 1px solid rgba(163, 147, 235, 0.1);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.05), 0 1px 1px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.1), 0 8px 8px rgba(0, 0, 0, 0.1), inset 0 0 15px rgba(163, 147, 235, 0.1);
}

#about:hover {
  animation: cardPulse 2s ease-out infinite;
  border: 1px solid rgba(163, 147, 235, 0.3);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.1), 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(163, 147, 235, 0.2);
}

/* Light theme adjustments */
[data-theme="light"] #about {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(94, 99, 182, 0.1);
}

[data-theme="light"] #about:hover {
  border: 1px solid rgba(94, 99, 182, 0.3);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.1), 0 8px 16px rgba(94, 99, 182, 0.1), inset 0 0 20px rgba(94, 99, 182, 0.1);
}

/* About section headings */
#about h2 {
  color: var(--text-color);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

#about p {
  color: var(--text-color);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* CONTACT FORM */
.contact-form {
  margin-top: 3rem;
}

.contact-form h3 {
  color: var(--text-color);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--secondary-color);
  border-radius: 25px;
  font-size: 1.1rem;
  background: none;
  color: var(--text-color);
  transition: all 0.1s ease-in;
  margin-bottom: 1rem;
}

.contact-form textarea[placeholder="Your message"] {
  min-height: 100px;
  height: 100px;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--secondary-color);
  transition: color 0.1s ease-in;
}

.contact-form input:hover,
.contact-form textarea:hover {
  border-color: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  color: var(--text-color);
}

.contact-form input:focus::placeholder,
.contact-form textarea:focus::placeholder {
  color: var(--text-color);
}

/* Light theme adjustments */
[data-theme="light"] .contact-form input,
[data-theme="light"] .contact-form textarea {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

[data-theme="light"] .contact-form input::placeholder,
[data-theme="light"] .contact-form textarea::placeholder {
  color: var(--secondary-color);
}

[data-theme="light"] .contact-form input:hover,
[data-theme="light"] .contact-form textarea:hover,
[data-theme="light"] .contact-form input:focus,
[data-theme="light"] .contact-form textarea:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 10px rgba(94, 99, 182, 0.8);
  color: var(--text-color);
}

/* Submit button */
.contact-form button {
  border: 2px solid var(--background-color);
  padding: 0.75rem 1.5rem;
  flex-shrink: 0;
  border-radius: 25px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.1s ease-in;
  width: 25%;
  margin: 0 auto;
  margin-top: 1rem;
  /* Updated properties for better centering */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.contact-form button:hover {
  color: var(--background-color);
  outline: none;
  border-color: var(--text-color);
  background: var(--text-color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: none;
}

[data-theme="light"] .contact-form button {
  border-color: var(--secondary-color);
  background: var(--secondary-color);
  color: var(--text-color);
}

[data-theme="light"] .contact-form button:hover {
  border-color: var(--text-color);
  background: var(--text-color);
  color: var(--primary-color);
  box-shadow: 0 0 10px rgba(94, 99, 182, 0.8);
}

/* FOOTER */
footer {
  text-align: center;
  padding: var(--spacing-medium);
  background: none;
  margin-top: auto;
}

footer p {
  margin: 0;
  color: var(--text-color);
}

/* Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

/* Track card animations */
@keyframes cardPulse {
  0% {
    box-shadow: 0 0 0 1px rgba(64, 69, 152, 0.2), 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 0 15px rgba(133, 117, 205, 0.2);
    border-color: rgba(133, 117, 205, 0.2);
  }
  30% {
    box-shadow: 0 0 0 1px rgba(64, 69, 152, 0.4), 0 8px 16px rgba(64, 69, 152, 0.5), inset 0 0 30px rgba(133, 117, 205, 0.4);
    border-color: rgba(133, 117, 205, 0.6);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(64, 69, 152, 0.2), 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 0 15px rgba(133, 117, 205, 0.2);
    border-color: rgba(133, 117, 205, 0.2);
  }
}

.track-card:hover {
  transform: translateY(-5px);
  animation: cardPulse 2s ease-out infinite;
  border: 1px solid rgba(163, 147, 235, 0.3);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.1), 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 0 20px rgba(163, 147, 235, 0.2);
}

.track-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.track-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.track-card.playing {
  border: 1px solid rgba(163, 147, 235, 0.4);
  box-shadow: 0 0 0 1px rgba(94, 99, 182, 0.2), 0 8px 24px rgba(94, 99, 182, 0.25), inset 0 0 25px rgba(163, 147, 235, 0.2);
}

.track-card.playing .progress {
  position: relative;
  overflow: hidden;
}

.track-card.playing .progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

/* Rotating animation to the play icon when active */
.track-card.playing .preview-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.track-card.playing .preview-button::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(133, 117, 205, 0.6) 0%, transparent 70%);
  animation: rotateGlow 3s linear infinite;
}

@keyframes rotateGlow {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: rotate(180deg) scale(1.1);
    opacity: 0.6;
  }
  100% {
    transform: rotate(360deg) scale(1);
    opacity: 0.8;
  }
}

/* MEDIA QUERRIES */
/* Search wrapper break points */
/* Mobile First Styles (up to 480px) */
@media (max-width: 480px) {
  .results-grid {
    grid-template-columns: 1fr;
  }

  .search-form {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Enhanced visibility for very small screens */
  .search-wrapper {
    background: rgba(255, 255, 255, 0.2);
    padding: 1.5rem 1rem;
  }

  .search-input {
    font-size: 1rem;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
  }

  .search-button {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }

  .sort-container {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .sort-select {
    width: 100%;
    font-size: 1rem;
  }

  .search-input,
  .search-button {
    width: 100%;
    box-sizing: border-box;
  }

  .contact-form button {
    width: 60%;
  }

  /* Welcome message adjustments */
  .welcome-message h2 {
    font-size: 2.5rem;
  }

  .welcome-message p {
    font-size: 1.3rem;
  }

  .welcome-icon {
    font-size: 3rem;
  }
}

/* Small tablets and large phones (481px to 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .search-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem 1rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  [data-theme="light"] .search-wrapper {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(94, 99, 182, 0.15);
  }

  .search-input {
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
  }

  .search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
  }

  [data-theme="light"] .search-input {
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.5);
  }

  [data-theme="light"] .search-input::placeholder {
    color: var(--secondary-color);
  }

  .search-form,
  .sort-container {
    display: flex;
    justify-content: center;
  }

  .sort-select {
    width: 200px;
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
  }

  [data-theme="light"] .sort-select {
    border-color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.5);
  }
}

/* Tablets and small desktops (768px to 992px) */
@media (min-width: 768px) and (max-width: 992px) {
  /* Search wrapper specific rules */
  .search-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  [data-theme="light"] .search-wrapper {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(94, 99, 182, 0.15);
  }

  .search-form {
    width: 100%;
    max-width: 600px;
    margin: 0;
    display: flex;
    gap: 1rem;
  }

  .search-input-wrapper {
    flex: 1;
    min-width: 0;
  }

  .search-input {
    width: 100%;
    font-size: 1.1rem;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
  }

  .search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
  }

  [data-theme="light"] .search-input {
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.5);
  }

  [data-theme="light"] .search-input::placeholder {
    color: var(--secondary-color);
  }

  .search-button {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
  }

  .sort-container {
    width: 100%;
    max-width: 300px;
    margin: 0;
    display: flex;
    justify-content: center;
  }

  .sort-select {
    width: 100%;
    font-size: 1.1rem;
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
  }

  [data-theme="light"] .sort-select {
    border-color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.5);
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* General mobile navigation styles (up to 768px) */
@media (max-width: 768px) {
  main {
    padding: var(--spacing-small);
  }

  .hamburger {
    display: flex;
  }

  /* Improve search visibility on mobile */
  .search-wrapper {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem 1rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .search-input {
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
  }

  .search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
  }

  .search-button {
    border-color: var(--text-color);
    background: var(--text-color);
    color: var(--background-color);
    font-weight: 600;
  }

  .clear-search-button {
    color: rgba(255, 255, 255, 0.9);
  }

  .clear-search-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
  }

  /* Light theme adjustments for mobile */
  [data-theme="light"] .search-wrapper {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(94, 99, 182, 0.15);
  }

  [data-theme="light"] .search-input {
    border-color: var(--secondary-color);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.5);
  }

  [data-theme="light"] .search-input::placeholder {
    color: var(--secondary-color);
  }

  [data-theme="light"] .search-button {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: white;
  }

  /* Improve welcome message visibility on mobile */
  .welcome-message {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem 1rem;
    border-radius: 30px;
    margin-bottom: 1rem;
  }

  [data-theme="light"] .welcome-message {
    background: rgba(255, 255, 255, 0.6);
  }

  /* Improve sort dropdown visibility on mobile */
  .sort-select {
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }

  [data-theme="light"] .sort-select {
    border-color: var(--secondary-color);
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a393eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }

  .nav-links {
    position: fixed;
    right: -100%;
    top: 0;
    flex-direction: column;
    background-color: var(--secondary-color);
    width: 100%;
    height: 100vh;
    padding: 80px 0;
    transition: 0.3s;
    gap: 2rem;
    z-index: 9;
  }

  .nav-links.active {
    right: 0;
  }

  /* Hamburger animation */
  .hamburger.active span:first-child {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:last-child {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  /* Track card mobile styles */
  .results-grid {
    grid-template-columns: repeat(1, 1fr);
    padding: 0.5rem;
    gap: 1rem;
  }

  .track-card {
    width: 100%;
    min-height: 320px;
    margin: 0.5rem 0;
  }

  .track-info {
    padding: 0.75rem 1rem;
    height: 120px;
  }

  .track-name {
    font-size: 1.1rem;
    flex: 0 0 60px;
  }

  .artist-name,
  .album-name {
    font-size: 0.85rem;
    flex: 0 0 40px;
  }

  .track-actions {
    padding: 0.75rem;
  }

  .preview-button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }

  .track-card.playing .track-controls {
    height: 140px;
  }

  .preview-button {
    padding: 0.5rem 1.5rem;
  }

  .track-card.playing .preview-button {
    background-color: var(--secondary-color);
  }

  .track-card.playing .progress-container,
  .track-card.playing .player-controls {
    opacity: 1;
  }

  .volume-control {
    width: calc(100% - 2rem);
    margin: 0 auto;
  }
}

/* Desktop styles (993px and above) */
@media (min-width: 993px) {
  .search-wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .search-form {
    grid-column: 2;
    margin: 0;
  }

  .sort-container {
    grid-column: 3;
    justify-self: end;
    margin-right: 1rem;
    width: 200px;
  }

  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Accessibility styles */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Style for the ordered list in the guide-content */
.guide-content ol {
  list-style-position: inside;
  padding-left: 0;
  margin: 0;
}

.guide-content ol li {
  color: var(--text-color);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Form group styling */
.form-group {
  margin-bottom: 1rem;
  width: 100%;
}
