/* ═══════════════════════════════════════════════════════
   QT Music Player – Front-End Player Styles
   Design: deep cinematic dark, warm amber accent
═══════════════════════════════════════════════════════ */

:root {
  --qtmp-bg:          #141414;
  --qtmp-surface:     #1e1e1e;
  --qtmp-surface2:    #282828;
  --qtmp-border:      #333;
  --qtmp-accent:      #f5a623;
  --qtmp-accent-dim:  rgba(245,166,35,.18);
  --qtmp-text:        #f0f0f0;
  --qtmp-text-muted:  #888;
  --qtmp-active-bg:   rgba(245,166,35,.12);
  --qtmp-radius:      10px;
  --qtmp-shadow:      0 8px 40px rgba(0,0,0,.55);
}

/* ── Wrapper ── */
.qtmp-player-wrap {
  background: var(--qtmp-bg);
  border-radius: var(--qtmp-radius);
  box-shadow: var(--qtmp-shadow);
  max-width: 720px;
  margin: 24px auto;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--qtmp-text);
  user-select: none;
}

/* ═══════════════
   STAGE (art + info)
═══════════════ */
.qtmp-stage {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 24px 16px;
  background: linear-gradient(160deg, #1e1e1e 60%, #1a1510);
}

.qtmp-artwork-wrap {
  position: relative;
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.qtmp-artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .3s;
}
.qtmp-artwork[src=""] { opacity: 0; }
.qtmp-artwork-placeholder {
  position: absolute;
  inset: 0;
  background: var(--qtmp-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--qtmp-text-muted);
  z-index: 0;
}
.qtmp-artwork-wrap img[src]:not([src=""]) + .qtmp-artwork-placeholder { display: none; }

.qtmp-now-info { flex: 1; min-width: 0; }
.qtmp-now-title {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}
.qtmp-now-artist { font-size: .9rem; color: var(--qtmp-accent); font-weight: 500; margin-bottom: 2px; }
.qtmp-now-album  { font-size: .8rem; color: var(--qtmp-text-muted); }

/* ═══════════════
   PROGRESS
═══════════════ */
.qtmp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 24px 10px;
}
.qtmp-time-current,
.qtmp-time-total {
  font-size: .75rem;
  color: var(--qtmp-text-muted);
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}
.qtmp-time-total { text-align: right; }

.qtmp-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--qtmp-surface2);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: height .15s;
}
.qtmp-progress-bar:hover { height: 6px; }
.qtmp-progress-fill {
  height: 100%;
  background: var(--qtmp-accent);
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
  transition: width .1s linear;
}
.qtmp-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .15s, left .1s linear;
  pointer-events: none;
}
.qtmp-progress-bar:hover .qtmp-progress-thumb { opacity: 1; }

/* ═══════════════
   CONTROLS
═══════════════ */
.qtmp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 24px 16px;
}

.qtmp-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--qtmp-text-muted);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s, transform .1s;
  line-height: 1;
}
.qtmp-btn svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.qtmp-btn:hover { color: var(--qtmp-text); background: var(--qtmp-surface2); }
.qtmp-btn:active { transform: scale(.92); }

.qtmp-play-pause {
  width: 52px;
  height: 52px;
  background: var(--qtmp-accent) !important;
  color: #000 !important;
  box-shadow: 0 2px 12px rgba(245,166,35,.4);
}
.qtmp-play-pause svg { width: 26px; height: 26px; }
.qtmp-play-pause:hover { background: #fbb730 !important; }

/* hide whichever icon isn't needed */
.qtmp-play-pause.qtmp-play  .qtmp-icon-pause { display: none; }
.qtmp-play-pause.qtmp-pause .qtmp-icon-play  { display: none; }

/* volume */
.qtmp-volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}
.qtmp-mute svg { width: 20px; height: 20px; }
.qtmp-icon-muted { display: none; }
.qtmp-muted .qtmp-icon-vol   { display: none; }
.qtmp-muted .qtmp-icon-muted { display: block; }

.qtmp-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--qtmp-surface2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.qtmp-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--qtmp-accent);
  cursor: pointer;
}
.qtmp-volume::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--qtmp-accent);
  border: none;
  cursor: pointer;
}

/* ═══════════════
   TRACK LIST
═══════════════ */
.qtmp-tracklist-wrap {
  border-top: 1px solid var(--qtmp-border);
  padding: 0 0 8px;
}

.qtmp-tracklist-header {
  display: grid;
  grid-template-columns: 32px 44px 1fr 56px;
  gap: 0 10px;
  padding: 10px 16px 6px;
  font-size: .7rem;
  color: var(--qtmp-text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--qtmp-border);
}

.qtmp-tracklist { list-style: none; margin: 0; padding: 0; }

.qtmp-track-row-li {
  display: grid;
  grid-template-columns: 32px 44px 1fr 56px;
  gap: 0 10px;
  align-items: center;
  padding: 6px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}
.qtmp-track-row-li:hover { background: var(--qtmp-surface); }
.qtmp-track-row-li.qtmp-active {
  background: var(--qtmp-active-bg);
  border-left-color: var(--qtmp-accent);
}

.qtmp-tl-num {
  font-size: .75rem;
  color: var(--qtmp-text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.qtmp-track-row-li.qtmp-active .qtmp-tl-num { display: none; }
.qtmp-tl-playing-indicator {
  display: none;
  text-align: center;
  color: var(--qtmp-accent);
  font-size: 14px;
  animation: qtmpPulse 1.2s ease-in-out infinite;
}
.qtmp-track-row-li.qtmp-active.is-playing .qtmp-tl-playing-indicator { display: block; }

@keyframes qtmpPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .35; }
}

.qtmp-tl-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.qtmp-tl-thumb-placeholder {
  width: 36px;
  height: 36px;
  background: var(--qtmp-surface2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--qtmp-text-muted);
}

.qtmp-tl-info { min-width: 0; }
.qtmp-tl-title  { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qtmp-tl-artist { font-size: .75rem; color: var(--qtmp-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qtmp-track-row-li.qtmp-active .qtmp-tl-title  { color: var(--qtmp-accent); }

.qtmp-tl-dur {
  font-size: .75rem;
  color: var(--qtmp-text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════
   RESPONSIVE
═══════════════ */
@media (max-width: 500px) {
  .qtmp-stage { padding: 16px 16px 12px; gap: 14px; }
  .qtmp-artwork-wrap { width: 80px; height: 80px; }
  .qtmp-now-title { font-size: 1rem; }
  .qtmp-volume-wrap { display: none; } /* hide volume on tiny screens */
  .qtmp-tracklist-header,
  .qtmp-track-row-li { grid-template-columns: 28px 36px 1fr 48px; gap: 0 6px; padding: 5px 10px; }
}

/* ═══════════════
   HIDDEN AUDIO
═══════════════ */
.qtmp-audio { display: none; }

/* ═══════════════
   POPUP BANNER
═══════════════ */
.qtmp-popup-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #1a1510, #1e1a10);
  border-top: 1px solid #3a2e10;
  border-bottom: 1px solid #3a2e10;
  font-size: .8rem;
  color: #d4a843;
  flex-wrap: wrap;
}
.qtmp-popup-banner.qtmp-banner-visible { display: flex; }

.qtmp-banner-icon { font-size: 1.1rem; flex-shrink: 0; }
.qtmp-banner-text { flex: 1; min-width: 160px; }

.qtmp-open-popup {
  background: var(--qtmp-accent);
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s;
}
.qtmp-open-popup:hover  { background: #fbb730; }
.qtmp-open-popup:active { transform: scale(.96); }

.qtmp-dismiss-banner {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  flex-shrink: 0;
}
.qtmp-dismiss-banner:hover { color: var(--qtmp-text); }

/* ── "Playing in popup" indicator ── */
.qtmp-in-popup-msg {
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(245,166,35,.08);
  border-top: 1px solid rgba(245,166,35,.2);
  border-bottom: 1px solid rgba(245,166,35,.2);
  font-size: .8rem;
  color: var(--qtmp-accent);
  flex-wrap: wrap;
}
.qtmp-in-popup-msg span { flex: 1; }

/* ── Popup blocked warning ── */
.qtmp-popup-blocked-msg {
  padding: 10px 16px;
  background: rgba(180, 50, 30, .15);
  border-top: 1px solid rgba(180, 50, 30, .3);
  color: #e07060;
  font-size: .8rem;
  line-height: 1.5;
}
