/* style.css */
:root {
  --gold: #d4a855;
  --gold-dim: #9a7a3e;
  --bg-dark: #050b14;
  --bg-card: rgba(255,255,255,0.04);
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.5);
  --glow-gold: rgba(212,168,85,0.3);
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: 'Oswald', sans-serif;
  color: var(--text-primary);
  cursor: none;
}

body:hover { cursor: default; }

/* ===== INTRO ANIMATION ===== */
#intro-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-dark);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 1.5s ease, opacity 1.5s ease;
  pointer-events: none;
}

#countdown-text {
  position: absolute;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(8rem, 15vw, 20rem);
  color: var(--gold);
  text-shadow: 0 0 40px var(--glow-gold), 0 0 80px rgba(212,168,85,0.2);
  z-index: 101;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: scale(1);
  opacity: 1;
}

#countdown-text.pop {
  transform: scale(1.2);
  opacity: 0;
}

#intro-cover {
  position: absolute;
  width: min(65vh, 60vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#intro-cover.visible {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 20px 80px rgba(0,0,0,0.8), 0 0 80px var(--glow-gold);
}

/* ===== MAIN APP LAYOUT (3 COLUMNS) ===== */
.app {
  width: 100vw;
  height: 100vh;
  display: grid;
  /* 25% Left | 45% Center | 30% Right */
  grid-template-columns: 25% 45% 30%;
  grid-template-rows: 1fr auto auto; /* Main content | Transport | EQ Footer */
  gap: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.app.visible {
  opacity: 1;
}

/* ===== LEFT COLUMN: Tracklist ===== */
.left-panel {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  padding: 3vh 2vw;
  overflow: hidden;
  border-right: 1px solid rgba(212,168,85,0.1);
  background: linear-gradient(90deg, rgba(5,11,20,1) 0%, rgba(5,11,20,0.8) 100%);
  z-index: 10;
}

.tracklist {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.tracklist::-webkit-scrollbar { display: none; }

.track-item {
  display: flex;
  align-items: center;
  padding: 1vh 1vw;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  gap: 0.5vw;
  margin-bottom: 0.2vh;
}

.track-item:hover { background: var(--bg-card); }
.track-item.active { background: rgba(212,168,85,0.1); }
.track-item.active .track-number, .track-item.active .track-name { color: var(--gold); }

.track-number {
  font-weight: 700;
  font-size: clamp(0.9rem, 1.2vw, 2rem);
  color: var(--gold-dim);
  width: 2.5vw;
  text-align: right;
  flex-shrink: 0;
}

.track-name {
  font-weight: 400;
  font-size: clamp(1rem, 1.4vw, 2.5rem);
  letter-spacing: 1px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-eq-icon {
  width: 1.5vw;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s;
  flex-shrink: 0;
}
.track-item.active .track-eq-icon { opacity: 1; }
.track-eq-icon .bar {
  width: 3px;
  background: var(--gold);
  border-radius: 1px;
  animation: eqBounce 0.6s ease-in-out infinite alternate;
}
.track-eq-icon .bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.track-eq-icon .bar:nth-child(2) { height: 70%; animation-delay: 0.15s; }
.track-eq-icon .bar:nth-child(3) { height: 50%; animation-delay: 0.3s; }
.track-eq-icon .bar:nth-child(4) { height: 90%; animation-delay: 0.1s; }
.track-item:not(.playing) .track-eq-icon .bar { animation-play-state: paused; }
.track-item.playing .track-eq-icon .bar { animation-play-state: running; }

@keyframes eqBounce {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* ===== CENTER COLUMN: Lyric Scroller ===== */
.center-panel {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 400px;
  opacity: 0;
  transition: opacity 1s ease;
}

.center-panel.active {
  opacity: 1;
}

.starwars-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 25%;
  background: linear-gradient(to bottom, var(--bg-dark) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}
.starwars-fade-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25%;
  background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.lyrics-container {
  width: 80%;
  height: 100%;
  position: relative;
  transform-origin: 50% 100%;
  transform: rotateX(20deg);
}

#lyrics-content {
  position: absolute;
  top: 100%; 
  left: 0;
  width: 100%;
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 2.5vw, 4.5rem);
  line-height: 1.8;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(212,168,85,0.4);
  will-change: transform;
}

.lyric-line {
  margin-bottom: 2vh;
  transition: color 0.3s, transform 0.4s ease, text-shadow 0.3s;
}

.lyric-spacer {
  visibility: hidden;
}

.lyric-line.active {
  color: #fff;
  text-shadow: 0 0 30px var(--gold), 0 0 60px rgba(212,168,85,0.4);
  transform: scale(1.25);
  transform-origin: center center;
  display: block;
}

/* ===== RIGHT COLUMN: Cover & Controls ===== */
.right-panel {
  grid-column: 3;
  grid-row: 1; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4vh 2vw;
  position: relative;
}

.right-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(212,168,85,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cover-container {
  position: relative;
  width: min(35vh, 25vw);
  aspect-ratio: 1;
  flex-shrink: 0;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 40px var(--glow-gold);
  transition: box-shadow 0.5s ease;
}

.cover-image.playing {
  box-shadow: 0 20px 80px rgba(0,0,0,0.8), 0 0 80px var(--glow-gold);
  animation: subtleBreathe 3s ease-in-out infinite;
}

.now-playing-label {
  margin-top: 3vh;
  text-align: center;
  min-height: 8vh;
}

.now-playing-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 3.5rem);
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.now-playing-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.8rem, 1.2vw, 2rem);
  color: var(--text-secondary);
  margin-top: 0.5vh;
  letter-spacing: 2px;
}

/* Idle pulse */
.cover-container.idle .cover-image {
  animation: idlePulse 4s ease-in-out infinite;
}

@keyframes idlePulse {
  0%, 100% { box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 30px rgba(212,168,85,0.15); }
  50% { box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 60px rgba(212,168,85,0.3); }
}
@keyframes subtleBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

/* ===== BOTTOM CONTROLS ===== */
.buttons-bar {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3vw;
  padding: 2vh 0;
  z-index: 10;
}

.timer-bar {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2vh 2vw;
  z-index: 10;
}

.transport-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: clamp(1.5rem, 2.5vw, 4rem);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  padding: 1vh 1vw;
}

.transport-btn:hover { color: var(--gold); transform: scale(1.15); }

.transport-btn.play-btn {
  width: clamp(60px, 6vw, 120px);
  height: clamp(60px, 6vw, 120px);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: clamp(1.5rem, 2vw, 3.5rem);
}
.transport-btn.play-btn:hover { background: rgba(212,168,85,0.15); }

.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1vw;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.time-display {
  font-size: clamp(0.8rem, 1.2vw, 2rem);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ===== FOOTER EQUALIZER ===== */
.equalizer-footer {
  grid-column: 1 / 4;
  grid-row: 3;
  width: 100%;
  height: 8vh; 
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 0.5vh;
  background: linear-gradient(to top, rgba(212,168,85,0.05), transparent);
}

#equalizer {
  width: 90%;
  height: 100%;
  display: block;
}
