@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* CSS Variables for Dynamic Theming */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #121212;
  --bg-tertiary: #1a1a1a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #6a6a6a;
  --accent-primary: #1db954;
  --accent-secondary: #1ed760;
  --accent-rgb: 29, 185, 84;
  --glow-color: rgba(29, 185, 84, 0.3);
  --dynamic-color: #1db954;
  --dynamic-rgb: 29, 185, 84;
  --gradient-start: rgba(29, 185, 84, 0.15);
  --gradient-end: rgba(0, 0, 0, 0);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Ambient Background */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  transition: all 2s ease-out;
}

.orb-1 {
  width: 60vw;
  height: 60vw;
  background: var(--dynamic-color);
  top: -20%;
  right: -20%;
  animation: float 20s ease-in-out infinite;
}

.orb-2 {
  width: 40vw;
  height: 40vw;
  background: var(--dynamic-color);
  bottom: -10%;
  left: -10%;
  opacity: 0.2;
  animation: float 25s ease-in-out infinite reverse;
}

.orb-3 {
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, var(--dynamic-color) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.1;
  animation: pulse 15s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.1; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.15; }
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.9) 0%, rgba(10, 10, 10, 0.5) 60%, transparent 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 10px var(--glow-color));
}

.now-playing-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.3s ease;
}

.now-playing-indicator.active {
  background: rgba(var(--dynamic-rgb), 0.1);
  border-color: rgba(var(--dynamic-rgb), 0.3);
}

.playing-animation {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.playing-animation span {
  width: 3px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.now-playing-indicator.active .playing-animation span {
  background: var(--dynamic-color);
  animation: equalizer 0.8s ease-in-out infinite;
}

.playing-animation span:nth-child(1) { height: 6px; animation-delay: 0s; }
.playing-animation span:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.playing-animation span:nth-child(3) { height: 8px; animation-delay: 0.2s; }

@keyframes equalizer {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.5); }
}

.status-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.now-playing-indicator.active .status-text {
  color: var(--dynamic-color);
}

/* Main Content */
main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem 2rem;
  flex: 1;
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.5s ease;
}

.hero-section:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--dynamic-rgb), 0.2);
}

/* Album Art */
.album-container {
  position: relative;
}

.album-art-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.5s ease;
}

.album-art-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 30px 60px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(var(--dynamic-rgb), 0.3),
    0 0 60px rgba(var(--dynamic-rgb), 0.2);
}

.album-art-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.album-art-wrapper:hover img {
  transform: scale(1.05);
}

.album-art-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(var(--dynamic-rgb), 0.2) 0%,
    transparent 50%,
    rgba(var(--dynamic-rgb), 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.album-art-wrapper:hover .album-art-glow {
  opacity: 1;
}

.playing-indicator-overlay {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.playing-indicator-overlay.visible {
  opacity: 1;
  transform: translateY(0);
}

.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.equalizer span {
  width: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
  animation: playing 0.5s ease-in-out infinite;
}

.equalizer span:nth-child(1) { height: 8px; animation-delay: 0s; }
.equalizer span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.equalizer span:nth-child(3) { height: 12px; animation-delay: 0.15s; }
.equalizer span:nth-child(4) { height: 20px; animation-delay: 0.05s; }

@keyframes playing {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.6); }
}

/* Song Details */
.song-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.song-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  background: linear-gradient(135deg, rgba(var(--dynamic-rgb), 0.2) 0%, rgba(var(--dynamic-rgb), 0.1) 100%);
  border: 1px solid rgba(var(--dynamic-rgb), 0.3);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dynamic-color);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--dynamic-rgb), 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(var(--dynamic-rgb), 0); }
}

#songTitle {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-height: 3rem;
}

.placeholder-text {
  -webkit-text-fill-color: var(--text-muted);
}

#songArtists {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-secondary);
  min-height: 1.5rem;
}

/* Progress Bar */
.progress-container {
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
}

.progress-container.visible {
  opacity: 1;
  transform: translateY(0);
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dynamic-color) 0%, var(--accent-secondary) 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s linear;
  box-shadow: 
    0 0 10px rgba(var(--dynamic-rgb), 0.6),
    0 0 20px rgba(var(--dynamic-rgb), 0.3);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
  border-radius: 0 3px 3px 0;
}

.time-display {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Analysis Grid */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Analysis Cards */
.analysis-card {
  position: relative;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s ease;
  min-height: 200px;
}

.analysis-card:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
  border-color: rgba(var(--dynamic-rgb), 0.2);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(var(--dynamic-rgb), 0.5) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.analysis-card:hover .card-glow {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(var(--dynamic-rgb), 0.2) 0%, rgba(var(--dynamic-rgb), 0.05) 100%);
  border-radius: 12px;
  color: var(--dynamic-color);
  transition: all 0.3s ease;
}

.analysis-card:hover .card-icon {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(var(--dynamic-rgb), 0.3);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.analysis-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  flex: 1;
}

.fact-dots {
  display: flex;
  gap: 6px;
}

.fact-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.fact-dot.active {
  background: var(--dynamic-color);
  border-color: var(--dynamic-color);
  box-shadow: 0 0 8px rgba(var(--dynamic-rgb), 0.5);
}

.card-content {
  position: relative;
}

.card-content p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: left;
}

/* Text Animations */
.fade-text {
  animation: fadeIn 0.6s ease-out;
}

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

.shimmer-text {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--text-muted) 0%,
    var(--text-secondary) 50%,
    var(--text-muted) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Content Transition Animation */
.content-transition {
  animation: contentSlide 0.5s ease-out;
}

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

/* Footer */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  margin-top: auto;
}

footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

footer .highlight {
  color: var(--text-secondary);
  font-weight: 500;
}

footer a {
  color: var(--text-primary);
  text-decoration: wavy underline;
  /* text-underline-offset: 4px; */
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .album-container {
    max-width: 250px;
    margin: 0 auto;
  }

  .song-header {
    justify-content: center;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  #songTitle {
    font-size: 1.75rem;
  }

  #songArtists {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 1rem;
  }

  .logo span {
    display: none;
  }

  main {
    padding: 5rem 1rem 1rem;
  }

  .hero-section {
    padding: 1.5rem;
    gap: 2rem;
  }

  .analysis-card {
    padding: 1.25rem;
    min-height: 160px;
  }

  .card-content p {
    font-size: 0.9375rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
