/* ==========================================================================
   Base Styles & Design System Tokens
   ========================================================================== */

:root {
  --font-ethiopic: 'Noto Sans Ethiopic', 'Abyssinica SIL', sans-serif;
  --font-display: 'Cinzel', serif;
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Global Accent & Dark Tokens */
  --color-primary: #e63946;
  --color-accent: #f4a261;
  --color-gold: #e5b95a;
  --color-text-main: #ffffff;
  --color-text-dim: rgba(255, 255, 255, 0.45);
  --color-text-muted: rgba(255, 255, 255, 0.25);
  --glass-bg: rgba(20, 10, 15, 0.65);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-blur: blur(20px);

  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.15s ease-out;
}

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

html, body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background-color: #0b0507;
  color: var(--color-text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* ==========================================================================
   Top Navigation / Utility Bar
   ========================================================================== */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 50;
  pointer-events: none;
}

.top-bar > * {
  pointer-events: auto;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(14, 8, 12, 0.88);
  border: 1px solid var(--glass-border);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  contain: layout style;
}

.brand-icon {
  font-size: 1.1rem;
  animation: pulse-glow 2.5s infinite ease-in-out;
}

.brand-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  contain: layout style;
}

.btn-pill:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-pill:active {
  transform: translateY(0);
}

/* ==========================================================================
   Main Presentation Viewport
   ========================================================================== */
.main-stage {
  flex: 1;
  display: flex;
  position: relative;
  width: 100%;
  height: 100%;
  padding-bottom: 95px; /* space for docked bottom bar */
  overflow: hidden;
}

/* Ambient Visual Backdrop */
.stage-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.backdrop-gradient {
  position: absolute;
  inset: -10%;
  transition: opacity 0.8s ease;
}

.backdrop-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  pointer-events: none;
}

.backdrop-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.ambient-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.75;
}

/* Stage Inner Content Grid */
.stage-content {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Dynamic Song Headers */
.song-header-section {
  padding: 4.5rem 4rem 1rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 15;
}

.artist-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.artist-amharic {
  font-family: var(--font-ethiopic);
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f7f3f2;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.7);
  line-height: 1.15;
}

.artist-english {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.song-title-box {
  text-align: right;
}

.song-title-amharic {
  font-family: var(--font-ethiopic);
  font-size: 3.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  line-height: 1.15;
}

/* Stage Split Grid */
.stage-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  padding: 0 4rem;
  height: calc(100% - 130px);
  gap: 3rem;
  overflow: hidden;
}

/* ==========================================================================
   Lyrics Viewport & Scroll Engine
   ========================================================================== */
.lyrics-container {
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: block;
  padding: 0 1.5rem;
  box-sizing: border-box;
  mask-image: linear-gradient(to bottom, 
    transparent 0%, 
    black 16%, 
    black 84%, 
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(to bottom, 
    transparent 0%, 
    black 16%, 
    black 84%, 
    transparent 100%
  );
}

.lyrics-scroll-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  padding: 0 1rem;
  margin: 0;
  box-sizing: border-box;
  transition: transform 0.36s cubic-bezier(0.2, 0.9, 0.3, 1);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.lyric-line {
  font-family: var(--font-ethiopic);
  font-size: 1.95rem;
  line-height: 1.45;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.25s ease, filter 0.25s ease;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  position: relative;
  /* 1.8rem horizontal padding ensures wide Ethiopic glyphs, shadows, and scaling never clip! */
  padding: 0.35rem 1.8rem;
  box-sizing: border-box;
  transform-origin: left center;
  opacity: 0;
  transform: scale(0.92) translate3d(0, 0, 0);
  pointer-events: none;
  contain: style;
}

/* Upper & Lower lines: readable, soft contrast, balanced opacity */
.lyric-line.prev,
.lyric-line.next,
.lyric-line.near {
  opacity: 0.74;
  transform: scale(0.97) translate3d(0, 0, 0);
  color: rgba(255, 255, 255, 0.78);
  pointer-events: auto;
  visibility: visible !important;
}

/* Middle active line: crystal clear, elegant 2.35rem size, glowing accent */
.lyric-line.active {
  opacity: 1 !important;
  transform: scale(1.04) translate3d(4px, 0, 0);
  font-size: 2.35rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(255, 255, 255, 0.5), 0 2px 10px rgba(0, 0, 0, 0.9);
  pointer-events: auto;
  z-index: 2;
  visibility: visible !important;
}

/* Out of view / distant lines: fully invisible, skipped by browser compositor */
.lyric-line.distant {
  opacity: 0 !important;
  transform: scale(0.9) translate3d(0, 0, 0);
  pointer-events: none !important;
  visibility: hidden !important;
}

.lyric-line:hover:not(.distant) {
  color: #ffffff;
  opacity: 1;
}



/* Empty State: Lyrics Unavailable / No Tracks */
.lyrics-no-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  min-height: 260px;
  padding: 1.5rem 0;
  animation: fadeIn 0.4s ease;
}

.no-lyrics-icon {
  font-size: 2.6rem;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.no-lyrics-title {
  font-family: var(--font-ethiopic), var(--font-sans);
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.no-lyrics-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-dim);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  max-width: 420px;
}

.no-lyrics-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.btn-primary-action {
  background: #ffffff !important;
  color: #12060c !important;
  font-weight: 600;
  border: 1px solid transparent;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
}

.btn-primary-action:hover {
  background: #f4f4f4 !important;
  color: #000000 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.35);
}

.btn-secondary-action {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   Right Panel: CD / Vinyl Visualizer Badge
   ========================================================================== */
.visualizer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
}

.disc-wrapper {
  position: relative;
  width: 380px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  contain: layout style;
}

/* Outer Soundwaves / Grooves Ring */
.disc-outer-grooves {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: pulse-subtle 4s infinite ease-in-out;
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* Spinning Disc Record */
.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: #111;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.vinyl-disc.spinning {
  animation: spin-disc 22s linear infinite;
}

.vinyl-disc.paused {
  animation-play-state: paused;
}

.disc-artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.disc-center-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #09090b;
  border: 4px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0,0,0,0.5);
  z-index: 5;
}

/* Album & Year Meta Tag Below Disc */
.album-meta-tag {
  margin-top: 2rem;
  font-family: var(--font-ethiopic);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.album-meta-divider {
  opacity: 0.6;
  font-weight: 300;
}

/* ==========================================================================
   Docked Audio Player Controls Bar (Bottom)
   ========================================================================== */
.player-bar-dock {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  width: calc(100% - 4rem);
  max-width: 1100px;
  height: 76px;
  background: rgba(18, 12, 16, 0.92);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 40;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55);
  contain: layout style;
}

@supports (backdrop-filter: blur(8px)) {
  .player-bar-dock {
    background: rgba(18, 12, 16, 0.82);
    backdrop-filter: blur(8px);
  }
}

.track-pill-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 250px;
  min-width: 0;
}

.track-mini-art {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.track-text-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.track-mini-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.track-mini-artist {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center Playback Controls */
.playback-controls-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  max-width: 520px;
}

.buttons-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  padding: 8px;
  border-radius: 50%;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: scale(1.12);
}

.btn-play-pause {
  width: 46px;
  height: 46px;
  background: #ffffff !important;
  color: #12060c !important;
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-play-pause svg {
  fill: currentColor;
  display: block;
}

.btn-play-pause:hover {
  background: #14080e !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  transform: scale(1.1) !important;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.4) !important;
}

.btn-play-pause:active {
  transform: scale(0.96) !important;
}

/* Timeline & Scrubber */
.timeline-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.time-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}

.scrubber-track {
  position: relative;
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  cursor: pointer;
  transition: height 0.15s ease;
  touch-action: none;
}

.scrubber-track::before {
  content: '';
  position: absolute;
  top: -12px;
  bottom: -12px;
  left: 0;
  right: 0;
}

.scrubber-track:hover {
  height: 7px;
}

.scrubber-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #ffffff;
  border-radius: 999px;
  pointer-events: none;
  width: 0%;
  transition: width 0.1s linear;
  will-change: width;
}

.scrubber-thumb {
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.scrubber-track:hover .scrubber-thumb {
  opacity: 1;
}

/* Right Control Group: Volume & Extras */
.player-controls-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 250px;
  justify-content: flex-end;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 75px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

/* ==========================================================================
   Modals & Drawers: Theme Picker, Song Selector & LRC Editor
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  background: #190f14;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 50%;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Theme Cards Grid */
.theme-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.theme-card-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-card-option:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.theme-card-option.active {
  background: rgba(230, 57, 70, 0.15);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(230, 57, 70, 0.3);
}

.theme-card-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.theme-card-info p {
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

.theme-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* File Drop Zone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.02);
}

.dropzone:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-dim);
}

.form-input, .form-textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: monospace;
  font-size: 0.85rem;
}

.btn-primary {
  background: #ffffff;
  color: #0b0507;
  border: none;
  font-weight: 600;
  padding: 0.8rem 1.4rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

/* Mandatory & Optional Badges */
.required-badge {
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.35rem;
}

.optional-badge {
  color: var(--color-text-dim);
  font-size: 0.72rem;
  font-weight: 400;
  margin-left: 0.35rem;
}

/* 2-Column Responsive Form Layout */
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Cover Artwork Picker */
.cover-picker-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.cover-preview-box {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cover-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 4px;
}

.cover-preview-box:hover .cover-preview-overlay {
  opacity: 1;
}

.cover-picker-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

/* Track Card Thumbnail & Edit Action in List */
.track-thumb-img {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: #151515;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-edit-custom {
  color: #93c5fd !important;
  border-color: rgba(147, 197, 253, 0.3) !important;
}

.btn-edit-custom:hover {
  background: rgba(147, 197, 253, 0.15) !important;
  border-color: #93c5fd !important;
  color: #ffffff !important;
}

/* Animations */
@keyframes spin-disc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 0.3; transform: scale(1) translateZ(0); }
  50% { opacity: 0.55; transform: scale(1.02) translateZ(0); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .song-header-section {
    padding: 4.5rem 2rem 0.5rem 2rem;
  }
  .stage-split {
    grid-template-columns: 1fr;
    padding: 0 2rem;
    gap: 1.5rem;
  }
  .visualizer-container {
    display: none !important; /* Hide vinyl on smaller screens to prioritize lyrics */
  }
  .artist-amharic { font-size: 2.1rem; }
  .song-title-amharic { font-size: 2.3rem; }
  .lyric-line { font-size: 1.6rem; }
  .player-bar-dock {
    width: calc(100% - 1.5rem);
    padding: 0 1rem;
  }
  .track-pill-info {
    width: 140px;
  }
  .volume-container {
    display: none !important;
  }
}

/* Mobile Devices & Smartphones (max-width: 680px) */
@media (max-width: 680px) {
  /* 1. Top Navigation Bar */
  .top-bar {
    height: 52px;
    padding: 0 0.65rem;
  }
  .brand-badge {
    padding: 0.35rem 0.55rem;
    gap: 0.35rem;
  }
  .brand-title {
    display: none; /* Hide text, keep musical icon badge */
  }
  .top-actions {
    gap: 0.3rem;
  }
  .top-actions .btn-pill {
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
  }
  .top-actions .btn-pill span:not(:first-child) {
    display: none; /* Hide labels on mobile, keep clean icons: 🎨, 📂, ✍️, ⛶ */
  }

  /* 2. Song Header Section */
  .song-header-section {
    padding: 3.6rem 0.85rem 0.35rem 0.85rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
  }
  .artist-heading {
    align-items: center;
    text-align: center;
    gap: 0.1rem;
    width: 100%;
  }
  .song-title-box {
    order: -1; /* Song title on top */
    text-align: center;
    width: 100%;
  }
  .song-title-amharic {
    font-size: 1.65rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .artist-amharic {
    font-size: 1.15rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .artist-english {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    opacity: 0.75;
  }

  /* 3. Stage & Lyrics Viewport */
  .main-stage {
    padding-bottom: 96px; /* Space for 2-row docked bottom bar */
  }
  .stage-split {
    padding: 0 0.75rem;
    height: 100%;
    gap: 0;
  }
  .lyrics-scroll-wrap {
    gap: 1.25rem;
  }
  .lyric-line {
    font-size: 1.05rem;
    line-height: 1.35;
    text-align: center;
    justify-content: center;
    padding: 0.15rem 0;
  }
  .lyric-line.active {
    font-size: 1.45rem !important;
    line-height: 1.35;
  }
  .lyric-line.prev,
  .lyric-line.next,
  .lyric-line.near {
    font-size: 1.05rem !important;
  }
  .lyrics-no-content {
    min-height: 200px;
    padding: 1rem 0;
    align-items: center;
    text-align: center;
  }
  .no-lyrics-icon { font-size: 2.2rem; }
  .no-lyrics-title { font-size: 1.35rem; }
  .no-lyrics-subtitle { font-size: 0.85rem; margin-bottom: 1rem; }
  .no-lyrics-actions { justify-content: center; }

  /* 4. Docked Bottom Audio Bar (Native Mobile 2-Row Grid Layout) */
  .player-bar-dock {
    display: grid !important;
    grid-template-areas:
      "track buttons speed"
      "timeline timeline timeline";
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 0.35rem 0.5rem;
    height: auto !important;
    min-height: 82px;
    bottom: 0.5rem;
    width: calc(100% - 1rem);
    padding: 0.5rem 0.75rem;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.65);
  }

  .track-pill-info {
    grid-area: track;
    width: auto !important;
    max-width: 140px;
    gap: 0.5rem;
  }
  .track-mini-art {
    width: 34px;
    height: 34px;
    border-radius: 6px;
  }
  .track-mini-title {
    font-size: 0.82rem;
    max-width: 95px;
  }
  .track-mini-artist {
    font-size: 0.7rem;
    max-width: 95px;
  }

  .playback-controls-center {
    display: contents !important; /* Promotes buttons-row & timeline-container to grid items */
  }

  .buttons-row {
    grid-area: buttons;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
  }
  .buttons-row .ctrl-btn {
    padding: 5px;
  }
  .buttons-row .ctrl-btn svg {
    width: 17px;
    height: 17px;
  }
  .btn-play-pause {
    width: 38px !important;
    height: 38px !important;
  }
  .btn-play-pause svg {
    width: 18px !important;
    height: 18px !important;
  }

  .player-controls-right {
    grid-area: speed;
    width: auto !important;
    gap: 0;
    justify-content: flex-end;
  }
  #btnSpeed {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
  }
  .volume-container {
    display: none !important;
  }

  .timeline-container {
    grid-area: timeline;
    width: 100% !important;
    gap: 0.45rem;
  }
  .time-label {
    font-size: 0.7rem;
    min-width: 28px;
  }
  .scrubber-track {
    height: 4px;
  }

  /* 5. Modals on Mobile */
  .modal-overlay {
    padding: 0.5rem;
  }
  .modal-card {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 88vh;
    padding: 1.25rem 0.85rem;
    border-radius: 16px;
  }
  .modal-header h2 {
    font-size: 1.15rem;
  }
  #themeOptionsList {
    grid-template-columns: 1fr !important;
    gap: 0.6rem;
  }
  .form-grid-2col {
    grid-template-columns: 1fr !important;
  }
  .cover-picker-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* 6. LRC Editor Mobile Optimization */
  .lrc-editor-card {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 92vh !important;
    max-height: 92vh !important;
    padding: 0.75rem 0.5rem;
    border-radius: 14px;
  }
  .lrc-tab-nav {
    gap: 0.2rem;
    padding: 0 0.25rem 0.4rem 0.25rem;
  }
  .lrc-tab-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
  .sync-instruction-pill {
    font-size: 0.75rem;
    padding: 0.35rem 0.55rem;
  }
  .sync-lyric-display {
    min-height: 160px;
    padding: 0.6rem 0.4rem;
  }
  .sync-curr-line {
    font-size: 1.2rem;
  }
  .sync-context-line {
    font-size: 0.8rem;
  }
  .sync-controls {
    gap: 0.3rem;
  }
  .sync-controls button {
    padding: 0.38rem 0.6rem;
    font-size: 0.75rem;
  }
  .lrc-edit-row {
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem;
  }
  .lrc-time-control {
    order: 1;
  }
  .lrc-row-actions {
    order: 2;
    margin-left: auto;
  }
  .lrc-text-input {
    order: 3;
    min-width: 100% !important;
    margin-top: 0.2rem;
    font-size: 0.85rem;
  }
  .edit-toolbar {
    gap: 0.35rem;
  }
  .btn-shift-fix {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }
}

/* ==========================================================================
   LRC Editor - Full Visual Authoring Tool
   ========================================================================== */

/* Wider modal card for the editor */
.lrc-editor-card {
  max-width: 860px;
  width: 95vw;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

/* Tab Nav */
.lrc-tab-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.lrc-tab-btn {
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.lrc-tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: var(--transition-fast);
  border-radius: 2px 2px 0 0;
}

.lrc-tab-btn:hover { color: var(--color-text-main); }
.lrc-tab-btn.active { color: var(--color-primary); }
.lrc-tab-btn.active::after { transform: scaleX(1); }

/* Tab Panel Container */
.lrc-tab-panels {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.lrc-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  gap: 0.75rem;
}

.lrc-panel[data-panel="edit"] {
  overflow: hidden;
}

.lrc-panel.active { display: flex; }

.lrc-hint {
  font-size: 0.82rem;
  color: var(--color-text-dim);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.lrc-hint code {
  background: rgba(255,255,255,0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--color-accent);
}

.lrc-hint kbd {
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 0.1em 0.5em;
  font-size: 0.85em;
  font-family: var(--font-sans);
  color: var(--color-text-main);
}

/* Import textarea */
.lrc-import-textarea {
  min-height: 220px;
  resize: vertical;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* -- Sync Tab -- */
.sync-mini-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
}

.sync-timeline-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.sync-timeline-wrap .scrubber-track {
  flex: 1;
  height: 4px;
}

.sync-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sync-play-btn:hover { background: #ff4d5e; }

/* Progress bar across all lines */
.sync-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

#lrcSyncProgressFill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Lyric display - teleprompter style */
.sync-lyric-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.25rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  text-align: center;
  min-height: 220px;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Gradient fade mask top/bottom */
.sync-lyric-display::before,
.sync-lyric-display::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 45px;
  pointer-events: none;
  z-index: 1;
}
.sync-lyric-display::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(12,6,10,0.9), transparent);
}
.sync-lyric-display::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(12,6,10,0.9), transparent);
}

.sync-context-line {
  font-family: var(--font-ethiopic);
  line-height: 1.5;
  transition: opacity 0.2s ease, font-size 0.2s ease;
  width: 100%;
  padding: 0.1rem 0;
}

/* 2 lines above - already stamped */
.sync-far-prev {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  opacity: 0.3;
}

.sync-prev-line {
  font-size: 0.92rem;
  color: var(--color-text-dim);
  opacity: 0.55;
}

/* Active / current line */
.sync-curr-line {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-main);
  font-family: var(--font-ethiopic);
  line-height: 1.4;
  padding: 0.35rem 0;
  text-shadow: 0 0 24px rgba(230, 57, 70, 0.5), 0 0 8px rgba(230,57,70,0.25);
  position: relative;
  z-index: 2;
}

/* Next lines - upcoming */
.sync-next-line {
  font-size: 0.95rem;
  color: var(--color-text-dim);
  opacity: 0.65;
}

.sync-far-next {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  opacity: 0.38;
}

.sync-far-next2 {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  opacity: 0.2;
}

.sync-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.sync-controls .btn-primary {
  padding: 0.55rem 1.25rem;
}

.btn-save-lyrics {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease !important;
}

.btn-save-lyrics:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5) !important;
}

.sync-status {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-dim);
  padding-top: 0.25rem;
}

.sync-instruction-pill {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  animation: pulse-instruction 3s infinite ease-in-out;
}

@keyframes pulse-instruction {
  0%, 100% { border-color: rgba(255, 255, 255, 0.12); }
  50% { border-color: rgba(99, 102, 241, 0.4); box-shadow: 0 0 15px rgba(99, 102, 241, 0.2); }
}

.btn-shift-fix {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #c7d2fe !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.btn-shift-fix:hover {
  background: rgba(99, 102, 241, 0.35) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3) !important;
  transform: translateY(-1px);
}

/* -- Edit Tab -- */
.edit-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.edit-toolbar label {
  font-size: 0.82rem;
  color: var(--color-text-dim);
  white-space: nowrap;
}

.lrc-offset-input {
  width: 90px;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  text-align: center;
}

.lrc-lines-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding-right: 0.4rem;
  margin-top: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
}

.lrc-lines-list::-webkit-scrollbar {
  width: 6px;
}

.lrc-lines-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.lrc-lines-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.lrc-lines-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

.lrc-edit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  transition: var(--transition-fast);
}

.lrc-edit-row:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}

.lrc-row-num {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  min-width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.lrc-time-control {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.lrc-time-display {
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  color: var(--color-accent);
  min-width: 72px;
  text-align: center;
  background: rgba(0,0,0,0.25);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

.lrc-nudge-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border);
  color: var(--color-text-main);
  border-radius: 5px;
  padding: 0.22rem 0.45rem;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.lrc-nudge-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
}

.lrc-nudge-small {
  min-width: 22px;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.2rem 0.3rem;
}

.lrc-stamp-btn { color: var(--color-accent); }
.lrc-del-btn   { color: #ff6b6b; }
.lrc-del-btn:hover { background: rgba(255, 107, 107, 0.15); }

.lrc-text-input {
  flex: 1;
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  font-family: var(--font-ethiopic);
  min-width: 0;
}

.lrc-row-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

/* -- Export Tab -- */
.lrc-export-preview {
  flex: 1;
  min-height: 280px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  resize: none;
  color: var(--color-accent);
  background: rgba(0,0,0,0.35);
  line-height: 1.7;
}
