/* ============================================================
   LUMEXIS — Player
   Uses the custom properties from lumexis.css. Sharp edges, no radius
   ============================================================ */

.lx-player {
  --lx-pct: 0%;
  display: grid;
  grid-template-columns: 132px 1fr;
  grid-template-areas:
    "art  body"
    "list list";
  gap: 0 28px;
  padding: 20px 24px;
  background: linear-gradient(160deg, var(--bg-raise, #0e1018), var(--bg-deep, #06080f));
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  position: relative;
  color: var(--text, #f0f2ff);
  font-family: "Inter", system-ui, sans-serif;
}

.lx-player::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 2;
  background: linear-gradient(90deg, var(--accent, #7fc7ff), var(--accent-warm, #ffb980));
  opacity: 0.8;
}

/* ---- Background EQ ---- */
.lx-player__viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%);
}
.lx-player > :not(.lx-player__viz):not(script) { position: relative; z-index: 1; }

/* ---- Art ---- */
.lx-player__art { grid-area: art; position: relative; align-self: center; }
.lx-player__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  transition: opacity var(--transition-med, 240ms ease-out);
}
.lx-player__img.is-swapping { opacity: 0; }
.lx-player.is-playing .lx-player__img {
  box-shadow: 0 0 36px rgba(127,199,255,0.12);
}

/* ---- Body ---- */
.lx-player__body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.lx-player__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent, #7fc7ff);
}
.lx-player__dot {
  width: 6px;
  height: 6px;
  background: var(--text-dim, #2e3a50);
  transition: background var(--transition, 160ms ease-out);
}
.lx-player.is-playing .lx-player__dot {
  background: var(--accent, #7fc7ff);
  animation: lx-pulse 1.6s ease-in-out infinite;
}
@keyframes lx-pulse { 50% { opacity: 0.25; } }

.lx-player__title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.1;
  color: #e0e8ff;
}
.lx-player__meta {
  margin: 4px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted, #6a7a96);
}
.lx-player__desc {
  margin: 8px 0 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #b0c4e0;
}

/* ---- Progress ---- */
.lx-player__progress { margin-top: 12px; }
.lx-player__seek {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.lx-player__seek:disabled { cursor: default; }
.lx-player__seek::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(90deg, var(--accent, #7fc7ff) var(--lx-pct), rgba(255,255,255,0.08) var(--lx-pct));
}
.lx-player__seek::-moz-range-track { height: 3px; background: rgba(255,255,255,0.08); }
.lx-player__seek::-moz-range-progress { height: 3px; background: var(--accent, #7fc7ff); }
.lx-player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4px;
  background: var(--text, #f0f2ff);
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 0 3px rgba(127,199,255,0.18);
}
.lx-player__seek::-moz-range-thumb {
  width: 11px;
  height: 11px;
  background: var(--text, #f0f2ff);
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 0 3px rgba(127,199,255,0.18);
}
.lx-player__seek:focus-visible { outline: 1px solid var(--accent-border, rgba(127,199,255,0.22)); outline-offset: 4px; }

.lx-player__times {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted, #6a7a96);
}

/* ---- Controls ---- */
.lx-player__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.lx-player__spacer { flex: 1; }

.lx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  color: var(--text, #f0f2ff);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition, 160ms ease-out), background var(--transition, 160ms ease-out), color var(--transition, 160ms ease-out);
}
.lx-btn svg { width: 16px; height: 16px; fill: currentColor; }
.lx-btn:hover { border-color: var(--border-hover, rgba(127,199,255,0.35)); background: var(--accent-soft, rgba(127,199,255,0.10)); }
.lx-btn:focus-visible { outline: 1px solid var(--accent, #7fc7ff); outline-offset: 2px; }

.lx-btn--play {
  width: 44px;
  height: 44px;
  background: var(--accent, #7fc7ff);
  border-color: var(--accent, #7fc7ff);
  color: var(--bg-deep, #06080f);
}
.lx-btn--play svg { width: 19px; height: 19px; }
.lx-btn--play:hover { background: #a8d8ff; border-color: #a8d8ff; }
.lx-btn--play .lx-icon-pause { display: none; }
.lx-player.is-playing .lx-btn--play .lx-icon-play { display: none; }
.lx-player.is-playing .lx-btn--play .lx-icon-pause { display: block; }

.lx-btn--ghost {
  width: auto;
  padding: 0 12px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--text-muted, #6a7a96);
}
.lx-btn--ghost:hover { color: var(--text, #f0f2ff); }
.lx-player__pop { width: 36px; padding: 0; }

/* ---- Track list ---- */
.lx-player__list {
  grid-area: list;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.lx-player__pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  color: var(--text-muted, #6a7a96);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition, 160ms ease-out), color var(--transition, 160ms ease-out), background var(--transition, 160ms ease-out);
}
.lx-player__pick img { width: 44px; height: 44px; object-fit: cover; flex: none; }
.lx-player__pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-player__pick:hover { border-color: var(--border-hover, rgba(127,199,255,0.35)); color: var(--text, #f0f2ff); }
.lx-player__pick.is-current {
  border-color: var(--accent-border, rgba(127,199,255,0.22));
  background: var(--accent-soft, rgba(127,199,255,0.10));
  color: var(--text, #f0f2ff);
}
.lx-player__pick:focus-visible { outline: 1px solid var(--accent, #7fc7ff); outline-offset: 2px; }

/* ---- Native audio: visible only if JS fails ---- */
.lx-player__audio { grid-column: 1 / -1; width: 100%; }
.lx-player.is-ready .lx-player__audio { display: none; }

/* ---- Pop-out window ---- */
.lx-popout-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg, #0a0c12);
}
.lx-popout-body main { width: 100%; }
.lx-player--popout {
  grid-template-columns: 1fr;
  grid-template-areas: "art" "body" "list";
  gap: 0;
  padding: 20px;
  border: 0;
}
.lx-player--popout .lx-player__art { margin-bottom: 18px; }
.lx-player--popout .lx-player__title { font-size: 1.4rem; }
.lx-player--popout .lx-player__desc { display: none; }
.lx-player--popout .lx-player__list { grid-template-columns: 1fr; gap: 6px; }
.lx-player__empty { text-align: center; color: var(--text-muted, #6a7a96); }

/* ---- Small screens ---- */
@media (max-width: 680px) {
  .lx-player {
    grid-template-columns: 1fr;
    grid-template-areas: "art" "body" "list";
    padding: 18px;
  }
  .lx-player__art { max-width: 180px; margin-bottom: 16px; }
  .lx-player__list { grid-template-columns: 1fr; gap: 6px; }
  .lx-player__pop { display: none; } /* pop-ups are miserable on phones */
}

@media (prefers-reduced-motion: reduce) {
  .lx-player.is-playing .lx-player__dot { animation: none; }
  .lx-player__img { transition: none; }
}
