/* Copyright Ayers Electronics Inc. All rights reserved. */
/* The mini player: a persistent bar at the foot of On Demand and the Guide while music plays
   (js/mini-player.js). Never over Now Playing's own full screen (js/now-playing-music.js sets
   body.now-playing-open, which js/mini-player.js reads before ever showing this bar). */

#miniPlayer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
  box-sizing: border-box;
  padding: 0 12px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--panel);
  border-top: 1px solid var(--border-soft);
}
#miniPlayer.hidden {
  display: none;
}
/* Every page of Music Mode ends at the bar's top edge (js/mini-player.js measures the bar into
   --mini-player-height), so no row or card is left under it. */
body.mini-player-over-music #ondemand,
body.mini-player-over-music #musicHome,
body.mini-player-over-music #searchPage,
body.mini-player-over-music #settingsPage,
body.mini-player-over-music #serversPage {
  padding-bottom: var(--mini-player-height, 0px);
}
/* Three zones: the side columns are equal (1fr each), so the centre column stands on the bar's centre
   line whatever the sides hold. */
.mini-player-left {
  display: flex;
  align-items: center;
  min-width: 0;
}
.mini-player-surface {
  display: block;
  flex: none;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}
#miniPlayerArt {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-small);
  object-fit: cover;
  background: var(--elevated);
}
.mini-player-text {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: 12px;
}
.mini-player-title,
.mini-player-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-player-title {
  color: var(--on-panel);
  font-weight: 600;
}
.mini-player-artist {
  color: var(--on-panel-variant);
  font-size: 0.85em;
}
/* The centre: the transport row, the seek line under it, the times at the line's two ends. */
.mini-player-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(46vw, 440px);
}
.mini-player-scrub {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 4px;
}
.mini-player-scrub > * + * {
  margin-left: 8px;
}
.mini-player-time {
  flex: none;
  min-width: 3ch;
  color: var(--on-panel-variant);
  font-size: 0.8em;
  text-align: center;
}
.mini-player-track {
  position: relative;
  flex: 1 1 auto;
  height: 2px;
  background: var(--track);
}
.mini-player-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--accent);
}
.mini-player-right {
  display: flex;
  justify-content: flex-end;
  justify-self: end;
}
/* The controls: the info screen's icon buttons in one row, every one the same square. */
.mini-player-controls {
  display: flex;
  flex: none;
  align-items: center;
}
.mini-player-controls > * + * {
  margin-left: 8px;
}
#miniPlayer .icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--info-button-h);
  height: var(--info-button-h);
  padding: 0;
  border: 1px solid var(--border-soft);
}
/* Play or Pause is the bar's one lit control. */
#miniPlayerPlayPause {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* Nothing playing: the bar rests. No art box and no seek line; the transport stays, plainly idle and
   centred, and the track line says nothing is playing. */
#miniPlayer.resting #miniPlayerSurface,
#miniPlayer.resting .mini-player-scrub {
  display: none;
}
#miniPlayer.resting #miniPlayerArtist {
  display: none;
}
#miniPlayer .icon-btn:disabled {
  opacity: 0.4;
}
#miniPlayerPlayPause:disabled {
  background: transparent;
  border-color: var(--border-soft);
  color: inherit;
}

@media (max-width: 767px) {
  #miniPlayer {
    height: 52px;
  }
  .mini-player-scrub {
    display: none;
  }
}
