@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #ff4757;
  --bg-color: #121212;
  --card-bg: rgba(255, 255, 255, 0.05);
  --text-main: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --font-family: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Blurred Background */
.background-blur {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url('cover.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(80px) brightness(0.4);
  z-index: -1;
  animation: bg-spin 60s linear infinite;
}

@keyframes bg-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Main Container */
.player-container {
  display: flex;
  flex-direction: column; /* Stack vertically on small screens */
  gap: 2rem;
  padding: 2rem;
  width: 90%;
  max-width: 1000px; /* Wider for lyrics side-by-side */
  height: 85vh;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

@media (min-width: 768px) {
  .player-container {
    flex-direction: row; /* Side by side on larger screens */
    align-items: center;
  }
}

/* Left Section: Cover & Controls */
.player-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}

.album-art {
  width: 280px;
  height: 280px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-info h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.song-info p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn-control {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-control:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.btn-play {
  width: 64px;
  height: 64px;
  background-color: var(--text-main);
  color: var(--bg-color); /* Dark icon on white button */
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-play:hover {
  transform: scale(1.05); /* Slightly smaller scale effect for the big button */
  background-color: var(--primary-color);
  color: white;
}

.btn-play svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  margin-left: 2px; /* Visual center fix due to play triangle */
}
.btn-play.paused svg {
    margin-left: 0;
}

/* Right Section: Lyrics */
.player-right {
  flex: 1.2;
  height: 100%;
  overflow-y: auto;
  padding: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent); /* Fade edges */
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
}
/* Scrollbar styling */
.player-right::-webkit-scrollbar {
    width: 6px;
}
.player-right::-webkit-scrollbar-track {
    background: transparent;
}
.player-right::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.2);
    border-radius: 10px;
}


.lyrics-content {
  padding: 2rem 0;
  text-align: center; /* Center align lyrics */
}

.lyrics-line {
  font-size: 1.5rem; /* Larger font for readability */
  line-height: 2.2;
  color: var(--text-secondary);
  transition: color 0.3s, transform 0.3s;
  margin-bottom: 1rem;
  font-weight: 500;
  cursor: default;
}

.lyrics-line:hover {
  color: var(--text-main);
  transform: scale(1.02);
}

.lyrics-line.active {
  color: var(--text-main);
  font-weight: 700;
  transform: scale(1.05);
}

/* Hidden YouTube Player */
#youtube-player {
  position: absolute;
  width: 1px; /* Non-zero to ensure loading but visually hidden */
  height: 1px;
  opacity: 0.01;
  pointer-events: none; /* Prevent interaction blocking */
  bottom: 0px;
  right: 0px;
}

/* Progress Bar (Simple) */
.progress-container {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 10px;
}
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: var(--text-main); /* White progress bar */
    width: 0%;
    transition: width 0.1s linear;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .player-right {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
  }
  .lyrics-line {
    font-size: 1.1rem;
  }
    .player-container {
        height: 90vh; /* Taller on mobile or fill screen */
        padding: 1rem;
    }
}
