/* =========================================
KELIBATMU V2
DESKTOP LYRICS SYSTEM V2
DESKTOP LYRICS IMMERSION POLISH
More emotional, atmospheric, and focused synced lyric experience
========================================= */

.desktop-lyrics-panel {

  position: relative;

  width: 100%;

  max-width: 520px;

  min-height: 620px;

  max-height: 620px;

  border-radius: 32px;

  background:
    linear-gradient(
      180deg,
      rgba(18,18,18,0.96) 0%,
      rgba(10,10,10,0.98) 100%
    );

  border:
    1px solid rgba(255,255,255,0.06);

  overflow: hidden;

  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  box-shadow:
    0 24px 80px rgba(0,0,0,0.36);

  display: flex;
  flex-direction: column;
}

/* =========================================
HEADER
========================================= */

.desktop-lyrics-header {

  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 18px;

  padding:
    26px 28px 22px;

  border-bottom:
    1px solid rgba(255,255,255,0.05);

  flex-shrink: 0;
  min-height: 118px;
}

.desktop-lyrics-meta {

  flex: 1;

  min-width: 0;
}

.desktop-lyrics-label {

  display: inline-block;

  margin-bottom: 10px;

  font-size: 0.76rem;

  letter-spacing: 0.14em;

  text-transform: uppercase;

  color:
    rgba(255,255,255,0.42);
}

.desktop-lyrics-title {

  margin: 0;

  font-size: 1.18rem;

  font-weight: 700;

  color:
    rgba(255,255,255,0.92);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-lyrics-artist {

  margin-top: 7px;

  font-size: 0.95rem;

  color:
    rgba(255,255,255,0.56);
}

/* =========================================
MODE BADGE
========================================= */

.desktop-lyrics-mode-badge {

  padding:
    8px 14px;

  border-radius: 999px;

  background:
    rgba(255,255,255,0.06);

  border:
    1px solid rgba(255,255,255,0.08);

  font-size: 0.78rem;

  font-weight: 700;

  color:
    rgba(255,255,255,0.72);

  white-space: nowrap;
}

/* =========================================
MODES - COMPLETE ARCHITECTURE SEPARATION
Each mode now owns its own layout independently
NO shared flex/overflow/viewport behavior
========================================= */

.desktop-reading-mode,
.desktop-synced-mode {

  display: none;
}

/* READING MODE - Simple manuscript layout */
.desktop-lyrics-panel[data-desktop-mode="reading"]
.desktop-reading-mode {

  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* SYNCED MODE - Independent viewport system */
.desktop-lyrics-panel[data-desktop-mode="synced"]
.desktop-synced-mode {

  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* =========================================
READING MODE - Simple Manuscript Reader
Natural scroll, no forced centering, clean and stable
========================================= */

.desktop-reading-scroll {

  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 36px 60px;
  
  /* Natural scrolling behavior */
  -webkit-overflow-scrolling: touch;
}

.desktop-reading-content {

  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.desktop-reading-line {

  text-align: center;
  font-size: 1.04rem;
  line-height: 1.95;
  color: rgba(255,255,255,0.84);
}

/* =========================================
SYNCED MODE - Independent Cinematic Viewport
Stable centered focus area, no reading mode inheritance
========================================= */

.desktop-synced-mode {
  /* Each mode manages its own layout independently */
  position: relative;
}

.desktop-synced-active {
  flex-shrink: 0;
  padding: 24px 34px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.045),
      rgba(255,255,255,0.018)
    );
}

.desktop-synced-active-text {
  position: relative;
  min-height: 3.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.08rem;
  line-height: 1.55;
  font-weight: 680;
  color: var(--kv2-lyric-active, #F3F5F7);
  text-shadow:
    0 0 4px rgba(34, 197, 94, 0.05),
    0 0 7px rgba(160, 126, 214, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.22);
}

.desktop-synced-active-text:not(.kv2-lyrics-active--instrumental) {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--kv2-lyric-active, #F3F5F7);
}

.desktop-synced-active-text::after {
  content: none;
}

.desktop-synced-active-text::before {
  content: none;
}

.desktop-lyrics-panel[data-lyrics-source="advanced"] .desktop-synced-active-text::after,
.desktop-lyrics-panel[data-lyrics-source="advanced"] .desktop-synced-active-text::before {
  opacity: 0;
}

.desktop-synced-active-text.kv2-lyrics-active--instrumental {
  color: rgba(255, 218, 170, 0.86);
  font-style: italic;
}

.desktop-lyric-active-marker {
  position: relative;
  display: block;
  width: min(220px, 72%);
  height: 12px;
  margin: 2px auto 0;
  border-radius: 999px;
  background: transparent;
}

.desktop-lyric-active-marker[hidden] {
  display: none;
}

.lyric-active-orb {
  position: absolute;
  left: calc(var(--kv2-lyrics-progress, 0) * 100%);
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 255, 247, 0.96) 0%, rgba(134, 239, 172, 0.88) 58%, rgba(216, 198, 255, 0.72) 100%);
  box-shadow: 0 0 7px rgba(34,197,94,.2);
  transform: translate(-50%, -50%);
}

.desktop-synced-line.is-upcoming .desktop-synced-text {
  color: rgba(203, 213, 225, 0.72);
  font-weight: 560;
}

.lyric-active-marker.is-bumping .lyric-active-orb {
  animation: lyricOrbBump 120ms ease-out;
}

@keyframes lyricOrbBump {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.18); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.lyric-char,
.lyric-word-highlight {
  color: #B7F5D4;
}

.desktop-synced-active-text .lyric-char {
  white-space: pre;
}

.lyric-char.is-sung,
.lyric-word-highlight {
  background: linear-gradient(90deg, #eefbf3 0%, #a9eebf 54%, #d8c6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #B7F5D4;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 5px rgba(134, 239, 172, 0.06);
}

.lyric-char.is-unsung {
  color: rgba(226,232,240,.62);
  -webkit-text-fill-color: rgba(226,232,240,.62);
  text-shadow: none;
}

.lyric-interlude-visual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 1.55em;
  color: rgba(134, 239, 172, .75);
  text-shadow: 0 0 8px rgba(34,197,94,.22);
}

.lyric-interlude-note {
  display: inline-block;
  font-size: clamp(26px, 2.2vw, 34px);
  color: rgba(134, 239, 172, .75);
  animation: lyricInterludeNote 1.8s ease-in-out infinite;
  animation-delay: calc(var(--note-index, 0) * 150ms);
}

.lyric-interlude-note:nth-child(2) {
  color: rgba(125, 211, 252, .55);
}

@keyframes lyricInterludeNote {
  0%, 100% {
    opacity: 0.44;
    transform: translateY(3px);
  }
  50% {
    opacity: 0.92;
    transform: translateY(-5px);
  }
}

.desktop-synced-viewport {

  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  
  /* Custom scrollbar for synced view */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) rgba(255,255,255,0.04);
  
  padding: 28px 32px 42px;
  
  position: relative;
  
  /* Stable viewport ownership - no transform fighting */
}

.desktop-synced-viewport::-webkit-scrollbar {
  width: 4px;
}

.desktop-synced-viewport::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}

.desktop-synced-viewport::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
}

.desktop-synced-lines {

  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  
  padding-bottom: 24px;
}

/* =========================================
DEFAULT LINE - Atmospheric, soft presence
========================================= */

.desktop-synced-line {

  text-align: center;
  cursor: pointer;
  position: relative;
  
  opacity: 0.32;
  transform: scale(0.96);
  
  transition: all 0.35s cubic-bezier(0.25, 0.95, 0.4, 1);
  
  filter: blur(0.2px);
  
  padding: 6px 0;
}

.kv2-lyrics-line__progress {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: min(220px, 72%);
  height: 1px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      var(--kv2-lyric-fill-start, #8FE8B5) calc(var(--kv2-lyrics-progress, 0) * 100%),
      rgba(243, 245, 247, 0.08) 0
    );
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.22s ease, background 0.22s ease;
}

.desktop-synced-line:hover {
  opacity: 0.52;
  transform: scale(0.98);
}

.desktop-synced-line.kv2-lyrics-line--sticky-hidden {
  visibility: hidden;
  pointer-events: none;
}

.desktop-synced-text {

  font-size: 1rem;
  line-height: 1.75;
  font-weight: 500;
  
  color: rgba(148,163,184,.45);
  
  letter-spacing: 0.01em;
  
  transition: all 0.35s cubic-bezier(0.25, 0.95, 0.4, 1);
}

/* =========================================
ACTIVE LINE - Emotional focal point
Stable cinematic spotlight without fighting layout
========================================= */

.desktop-synced-line.active {

  opacity: 0.76;
  transform: scale(1);
  filter: blur(0);
}

.desktop-synced-line.active
.desktop-synced-text {

  color: rgba(226, 230, 235, 0.84);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: 1rem;
  font-weight: 560;
  letter-spacing: 0;
  text-shadow: none;
}

/* =========================================
PREVIOUS ACTIVE LINE - Subtle memory state
Softer presence, reduced visual weight
========================================= */

.desktop-synced-line.prev-active {

  opacity: 0.52;
  transform: scale(0.98);
  filter: blur(0.1px);
}

.desktop-synced-line.prev-active
.desktop-synced-text {

  font-size: 0.96rem;
  color: rgba(148,163,184,.45);
  letter-spacing: 0.005em;
  text-shadow: none;
  font-weight: 500;
}

/* =========================================
EMPTY STATE
========================================= */

.desktop-lyrics-empty {

  text-align: center;
  color: rgba(255,255,255,0.42);
  font-size: 1rem;
  padding: 48px 24px;
}

/* =========================================
MOBILE OFF
========================================= */

@media (max-width: 768px) {

  .desktop-lyrics-panel {

    display: none !important;
  }
}

/* =========================================
ACTIVE MODE BADGE - Visual feedback only
========================================= */

.desktop-lyrics-panel[data-desktop-mode="reading"]
.desktop-lyrics-mode-badge {

  background:
    rgba(255,255,255,0.08);

  border:
    1px solid rgba(255,255,255,0.12);

  color:
    rgba(255,255,255,0.92);
}

.desktop-lyrics-panel[data-desktop-mode="synced"]
.desktop-lyrics-mode-badge {

  background:
    linear-gradient(
      135deg,
      rgba(255,140,0,0.26),
      rgba(255,94,0,0.22)
    );

  border:
    1px solid rgba(255,140,0,0.34);

  color:
    #ffb36b;

  box-shadow:
    0 0 24px rgba(255,140,0,0.14);
}

/* =========================================
RESPONSIVE HEIGHT ADJUSTMENTS
Maintains stability across different screen sizes
========================================= */

@media (min-width: 1440px) {
  .desktop-lyrics-panel {
    max-height: 680px;
    min-height: 680px;
  }
  
  .desktop-synced-viewport {
    padding: 32px 36px;
  }
  
  .desktop-synced-lines {
    gap: 24px;
  }
  
  .desktop-synced-text {
    font-size: 1rem;
  }
  
  .desktop-synced-line.active .desktop-synced-text {
    font-size: 1.02rem;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .desktop-lyrics-panel {
    max-height: 560px;
    min-height: 560px;
  }
  
  .desktop-synced-viewport {
    padding: 24px 28px;
  }
  
  .desktop-synced-lines {
    gap: 18px;
  }
  
  .desktop-synced-text {
    font-size: 0.95rem;
  }
  
  .desktop-synced-line.active .desktop-synced-text {
    font-size: 0.98rem;
  }
}

/* =========================================
REDUCED MOTION PREFERENCE
========================================= */

@media (prefers-reduced-motion: reduce) {
  .desktop-synced-lines,
  .desktop-synced-line,
  .desktop-synced-text,
  .lyric-active-orb,
  .lyric-active-marker.is-bumping .lyric-active-orb,
  .lyric-interlude-note {
    transition: none !important;
    animation: none !important;
  }
  
  .desktop-synced-line.active {
    transform: none;
  }
}

.desktop-synced-line.active .kv2-lyrics-line__progress {
  opacity: 0;
}

.desktop-synced-line.kv2-lyrics-line--instrumental
.desktop-synced-text {
  color: rgba(255, 218, 170, 0.82);
  font-style: italic;
  letter-spacing: 0.04em;
}
