/* NZ Net Radio — Player Home Screen standalone styles
   Loaded directly (not via wp_enqueue) to avoid jQuery/Astra overhead. */

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

html, body {
  background: #0f0f0f;
  color: #fff;
  margin: 0;
  padding: 0;
  height: 100%;
  font: 14px/1.4 sans-serif;
  -webkit-text-size-adjust: 100%;
}

body.nznr-player-home {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#nznr-home-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  max-width: 480px;
  margin: 0 auto;
}

/* Top bar */
#nznr-home-topbar {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 16px;
  border-bottom: 1px solid #1e1e1e;
}
.nznr-site-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #555;
  font-size: 11px;
  text-decoration: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.nznr-site-link:hover { color: #999; }
.nznr-a2hs-btn {
  background: #2196F3;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}
.nznr-a2hs-btn:hover { filter: brightness(1.1); }

/* Player section */
#nznr-home-player {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 10px;
  gap: 10px;
}
#art-container {
  position: relative;
  width: min(260px, 60vw);
  height: min(260px, 60vw);
  border-radius: 10px;
  overflow: hidden;
  background: #222;
  flex-shrink: 0;
}
#album-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#art-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e1e1e;
}
#art-placeholder img {
  width: 75%;
  height: 75%;
  object-fit: contain;
}

/* Metadata */
#nznr-home-meta {
  width: 100%;
  text-align: center;
  min-width: 0;
}
#nznr-home-meta .scroll-container { margin-bottom: 3px; }
#now-playing  { font-size: 1em; font-weight: 600; }
#track-album  { font-size: 0.85em; opacity: 0.55; }
#player-status {
  font-size: 0.75em;
  color: #ffb74d;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Now-playing colour conventions (matched in player.js) */
#now-playing .pp-artist  { color: #fff; }
#now-playing .pp-sep     { color: #aaa; }
#now-playing .pp-title   { color: #81c784; }

/* Controls */
#nznr-home-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
#play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2196F3;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
#play-btn svg { width: 28px; height: 28px; fill: #fff; }
#play-btn.playing,
#play-btn[aria-pressed="true"] { background: #555; }

/* Cast button slot */
#cast-btn-slot {
  display: inline-flex;
  align-items: center;
}

/* Recently played */
#nznr-home-recent-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid #1e1e1e;
  background: #0f0f0f;
}
.nznr-home-recent-label {
  font-size: 0.65em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.38;
  padding: 8px 14px 2px;
  color: #fff;
}

/* Scrolling text (player.js adds/removes .scrolling class) */
.scroll-container {
  width: 100%;
  overflow: hidden;
  position: relative;
}
.scroll-text {
  display: inline-block;
  white-space: nowrap;
  animation: none;
}
.scroll-text.scrolling {
  animation: marquee 12s linear infinite;
  padding-right: 60px;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* iOS Add to Home Screen overlay */
#nznr-ios-hint {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
#nznr-ios-hint[hidden] { display: none; }
#nznr-ios-hint-inner {
  background: #1c1c1e;
  border-radius: 16px 16px 0 0;
  padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  position: relative;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
}
.nznr-ios-hint-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: #888;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
#nznr-ios-hint-inner p  { margin: 0 0 8px; }
#nznr-ios-hint-inner ol { padding-left: 1.4em; margin: 8px 0 0; }
#nznr-ios-hint-inner li { margin-bottom: 10px; }
.share-icon {
  display: inline-block;
  border: 1px solid #aaa;
  border-radius: 4px;
  padding: 0 3px;
  font-size: 0.9em;
}

/* Already installed as PWA */
@media (display-mode: standalone) {
  #nznr-a2hs-btn { display: none !important; }
  #nznr-home-topbar { border-bottom-color: transparent; }
}
