/* ==========================================================================
   TruZillah Premium — Music Player v2.0.0
   Styles for the real HTML5 player rendered by [tzn_player].
   ========================================================================== */

.tzn-player {
  background: var(--wp--preset--color--surface, var(--tzn-surface, #0b101f));
  border: 1px solid var(--tzn-border, rgba(139,147,184,0.14));
  border-radius: var(--tzn-r-xl, 24px);
  overflow: hidden;
  box-shadow: var(--tzn-shadow-card, 0 4px 24px rgba(0,0,0,0.45));
}

/* ── DECK ── */
.tzn-player-deck {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.75rem;
  padding: 1.75rem;
  align-items: center;
  position: relative;
  background:
    radial-gradient(ellipse 70% 90% at 0% 50%, rgba(59,91,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 100% 20%, rgba(0,212,255,0.08) 0%, transparent 60%);
}

/* Cover art */
.tzn-player-cover { position: relative; width: 160px; height: 160px; }
.tzn-player-cover-art {
  width: 100%; height: 100%;
  border-radius: var(--tzn-r-md, 14px);
  background: linear-gradient(135deg, #111a33 0%, #0b101f 100%);
  border: 1px solid rgba(126,231,255,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--tzn-electric, #00d4ff);
  overflow: hidden;
  position: relative;
  z-index: 1;
  background-size: cover;
  background-position: center;
}
.tzn-player-cover-art.has-art .tzn-player-cover-fallback { display: none; }
.tzn-player-disc-glow {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,91,255,0.35) 0%, rgba(0,212,255,0.12) 45%, transparent 70%);
  filter: blur(14px);
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 0;
}
.tzn-player.is-playing .tzn-player-disc-glow { opacity: 1; animation: tzn-pulse 2.4s ease-in-out infinite; }
@keyframes tzn-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.75; }
  50%      { transform: scale(1.07); opacity: 1; }
}

/* Now playing */
.tzn-player-main { min-width: 0; }
.tzn-player-eyebrow {
  font-family: var(--wp--preset--font-family--dm-mono, 'DM Mono', monospace);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tzn-electric, #00d4ff);
}
.tzn-player-track-title {
  font-family: var(--wp--preset--font-family--space-grotesk, 'Space Grotesk', sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--wp--preset--color--text, #eef2ff);
  margin: 0.2rem 0 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tzn-player-track-genre {
  font-size: 0.8rem;
  color: var(--wp--preset--color--muted, #8b93b8);
  margin-bottom: 0.75rem;
}

/* Visualizer canvas */
.tzn-player-visualizer {
  width: 100%;
  height: 72px;
  display: block;
  border-radius: var(--tzn-r-sm, 8px);
  margin-bottom: 0.75rem;
}

/* Seek row */
.tzn-player-seek-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.tzn-player-time {
  font-family: var(--wp--preset--font-family--dm-mono, 'DM Mono', monospace);
  font-size: 0.72rem;
  color: var(--wp--preset--color--muted, #8b93b8);
  min-width: 36px;
}
.tzn-player-time-total { text-align: right; }

/* Range inputs — gradient fill via --fill custom property set by JS */
.tzn-player-seek,
.tzn-player-volume {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--tzn-royal, #3b5bff), var(--tzn-electric, #00d4ff)) 0 0 / var(--fill, 0%) 100% no-repeat,
    rgba(139,147,184,0.2);
  cursor: pointer;
  outline: none;
}
.tzn-player-seek::-webkit-slider-thumb,
.tzn-player-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tzn-electric, #00d4ff);
  box-shadow: 0 0 10px rgba(0,212,255,0.6);
  cursor: pointer;
  transition: transform 120ms ease;
}
.tzn-player-seek::-webkit-slider-thumb:hover,
.tzn-player-volume::-webkit-slider-thumb:hover { transform: scale(1.2); }
.tzn-player-seek::-moz-range-thumb,
.tzn-player-volume::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tzn-electric, #00d4ff);
  box-shadow: 0 0 10px rgba(0,212,255,0.6);
  cursor: pointer;
}

/* Transport controls */
.tzn-player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.tzn-player-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--tzn-border, rgba(139,147,184,0.14));
  background: rgba(255,255,255,0.04);
  color: var(--wp--preset--color--text, #eef2ff);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  flex-shrink: 0;
}
.tzn-player-btn:hover {
  border-color: var(--tzn-electric, #00d4ff);
  box-shadow: 0 0 16px rgba(0,212,255,0.35);
  transform: translateY(-1px);
}
.tzn-player-toggle {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--tzn-royal, #3b5bff) 0%, var(--tzn-electric, #00d4ff) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 18px rgba(59,91,255,0.5), 0 0 32px rgba(0,212,255,0.2);
}
.tzn-player-toggle:hover {
  box-shadow: 0 6px 24px rgba(59,91,255,0.6), 0 0 44px rgba(0,212,255,0.35);
  border: none;
}

/* Volume */
.tzn-player-volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  color: var(--wp--preset--color--muted, #8b93b8);
  width: 130px;
}
.tzn-player-volume { --fill: 90%; }

/* ── PLAYLIST ── */
.tzn-track-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1rem 1rem;
  border-top: 1px solid var(--tzn-border, rgba(139,147,184,0.14));
}
.tzn-track-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--tzn-border, rgba(139,147,184,0.14));
  cursor: pointer;
  transition: background 150ms ease;
  border-radius: var(--tzn-r-sm, 8px);
}
.tzn-track-item:hover { background: rgba(59,91,255,0.08); }
.tzn-track-item:last-child { border-bottom: none; }
.tzn-track-item.no-audio { opacity: 0.5; cursor: default; }

.tzn-track-num {
  font-family: var(--wp--preset--font-family--dm-mono, 'DM Mono', monospace);
  font-size: 0.75rem;
  color: var(--wp--preset--color--muted, #8b93b8);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.tzn-track-play-icon {
  display: none;
  width: 22px;
  color: var(--tzn-electric, #00d4ff);
  text-align: center;
  flex-shrink: 0;
}
.tzn-track-item:hover:not(.no-audio) .tzn-track-num { display: none; }
.tzn-track-item:hover:not(.no-audio) .tzn-track-play-icon { display: flex; align-items: center; justify-content: center; }

.tzn-track-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tzn-track-name {
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--wp--preset--color--text, #eef2ff);
}
.tzn-track-genre { font-size: 0.75rem; color: var(--wp--preset--color--muted, #8b93b8); margin-top: 0.15rem; }
.tzn-track-duration {
  font-family: var(--wp--preset--font-family--dm-mono, 'DM Mono', monospace);
  font-size: 0.75rem;
  color: var(--wp--preset--color--muted, #8b93b8);
  flex-shrink: 0;
}

/* Active track state */
.tzn-track-item.is-active .tzn-track-name { color: var(--tzn-electric-pale, #7ee7ff); }
.tzn-track-item.is-active .tzn-track-num  { color: var(--tzn-electric, #00d4ff); }

/* Equalizer bars — only animate while actually playing */
.tzn-track-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; flex-shrink: 0; }
.tzn-track-eq i {
  width: 3px;
  background: linear-gradient(180deg, var(--tzn-electric, #00d4ff), var(--tzn-royal, #3b5bff));
  border-radius: 1px;
  animation: tzn-eq 0.9s ease-in-out infinite;
}
.tzn-track-eq i:nth-child(1) { height: 60%; animation-delay: 0s; }
.tzn-track-eq i:nth-child(2) { height: 100%; animation-delay: 0.25s; }
.tzn-track-eq i:nth-child(3) { height: 40%; animation-delay: 0.5s; }
@keyframes tzn-eq {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}
.tzn-player.is-playing .tzn-track-item.is-active .tzn-track-eq { display: flex; }
.tzn-player.is-playing .tzn-track-item.is-active .tzn-track-duration { display: none; }

/* No-audio notice */
.tzn-player-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--tzn-border, rgba(139,147,184,0.14));
  background: rgba(59,91,255,0.08);
  font-size: 0.85rem;
  color: var(--wp--preset--color--muted, #8b93b8);
  text-align: center;
}
.tzn-player-notice a { color: var(--tzn-electric, #00d4ff); font-weight: 600; }
.tzn-player-notice.is-flash { animation: tzn-notice-flash 1.2s ease; }
@keyframes tzn-notice-flash {
  0%, 100% { background: rgba(59,91,255,0.08); }
  25%      { background: rgba(0,212,255,0.22); }
}

/* Empty state */
.tzn-player-empty {
  padding: 2rem;
  text-align: center;
  color: var(--wp--preset--color--muted, #8b93b8);
  border-top: 1px solid var(--tzn-border, rgba(139,147,184,0.14));
}
.tzn-player-empty a { color: var(--tzn-electric, #00d4ff); font-weight: 600; }

/* ── STICKY MINI-PLAYER ── */
.tzn-miniplayer {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%) translateY(120%);
  width: min(560px, calc(100vw - 2rem));
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 0.9rem;
  background: rgba(11,16,31,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(59,91,255,0.35);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 24px rgba(59,91,255,0.25);
  z-index: 200;
  transition: transform 350ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.tzn-miniplayer.is-shown { transform: translateX(-50%) translateY(0); }
.tzn-miniplayer[hidden] { display: none; }

.tzn-miniplayer-cover {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #111a33, #0b101f) center / cover no-repeat;
  border: 1px solid rgba(126,231,255,0.3);
  flex-shrink: 0;
}
.tzn-miniplayer.is-playing .tzn-miniplayer-cover { animation: tzn-spin 6s linear infinite; }
@keyframes tzn-spin { to { transform: rotate(360deg); } }

.tzn-miniplayer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tzn-miniplayer-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wp--preset--color--text, #eef2ff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tzn-miniplayer-genre { font-size: 0.7rem; color: var(--wp--preset--color--muted, #8b93b8); }

.tzn-miniplayer-progress {
  width: 90px;
  height: 4px;
  border-radius: 999px;
  background: rgba(139,147,184,0.2);
  overflow: hidden;
  flex-shrink: 0;
}
.tzn-miniplayer-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--tzn-royal, #3b5bff), var(--tzn-electric, #00d4ff));
  border-radius: 999px;
}
.tzn-miniplayer-toggle { width: 38px; height: 38px; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .tzn-player-deck { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem; }
  .tzn-player-cover { width: 120px; height: 120px; margin: 0 auto; }
  .tzn-player-nowplaying { text-align: center; }
  .tzn-player-controls { justify-content: center; flex-wrap: wrap; }
  .tzn-player-volume-wrap { margin: 0 auto; width: 100%; max-width: 220px; }
  .tzn-miniplayer-progress { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tzn-miniplayer { transition: none; }
  .tzn-miniplayer-cover, .tzn-player-disc-glow, .tzn-track-eq i { animation: none !important; }
}
