/* ============================================
   MINI PLAYER
   Persistent bottom bar for cross-page playback
   ============================================ */

/* --- Hide on album page --- */
body.is-album-page .mini-player { display: none; }

/* --- Extra footer padding when bar is visible --- */
body.has-mini-player .site-footer { padding-bottom: 72px; }

/* --- Fixed bottom bar --- */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: 56px;
  background: rgba(29, 26, 21, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(232, 191, 130, 0.1);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', system-ui, sans-serif;
}

.mini-player.mp-visible {
  transform: translateY(0);
}

.mini-player.mp-hiding {
  transform: translateY(100%);
}

/* --- Control buttons --- */
.mp-btn {
  background: none;
  border: none;
  color: var(--mist, #c7baaa);
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
  flex-shrink: 0;
}

.mp-btn:hover {
  opacity: 1;
  color: var(--warm-light, #e8bf82);
}

.mp-btn svg {
  width: 18px;
  height: 18px;
}

.mp-btn-play svg {
  width: 22px;
  height: 22px;
}

/* --- Track info --- */
.mp-track-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-shrink: 1;
  gap: 1px;
}

.mp-track-title {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--mist, #c7baaa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.mp-track-number {
  font-size: 0.65rem;
  font-weight: 300;
  color: var(--concrete-light, #756a5a);
  line-height: 1.2;
}

/* --- Progress bar --- */
.mp-progress {
  flex: 1;
  min-width: 60px;
  height: 32px;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0 4px;
}

.mp-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(117, 106, 90, 0.3);
  border-radius: 2px;
  position: relative;
  overflow: visible;
}

.mp-progress-fill {
  height: 100%;
  background: var(--warm-light, #e8bf82);
  border-radius: 2px;
  width: 0%;
  position: relative;
  transition: none;
}

.mp-progress-fill::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm-light, #e8bf82);
  box-shadow: 0 0 6px rgba(232, 191, 130, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
}

.mp-progress:hover .mp-progress-fill::after {
  opacity: 1;
}

/* --- Time display --- */
.mp-time {
  font-size: 0.65rem;
  color: var(--concrete-light, #756a5a);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 32px;
  text-align: right;
}

/* --- Close button --- */
.mp-btn-close {
  opacity: 0.4;
}

.mp-btn-close:hover {
  opacity: 1;
  color: var(--mist, #c7baaa);
}

/* --- Countdown overlay (replaces track info inside bar) --- */
.mp-countdown {
  display: none;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mp-countdown.mp-countdown-active {
  display: flex;
}

.mini-player.mp-countdown-mode .mp-track-info,
.mini-player.mp-countdown-mode .mp-progress,
.mini-player.mp-countdown-mode .mp-time {
  display: none;
}

.mp-countdown-text {
  font-size: 0.78rem;
  color: var(--mist, #c7baaa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-countdown-timer {
  font-size: 0.72rem;
  color: var(--warm-light, #e8bf82);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.mp-countdown-btn {
  background: none;
  border: 1px solid rgba(232, 191, 130, 0.3);
  color: var(--warm-light, #e8bf82);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.mp-countdown-btn:hover {
  background: rgba(232, 191, 130, 0.1);
  border-color: rgba(232, 191, 130, 0.5);
}

.mp-countdown-btn-cancel {
  color: var(--fog, #a09485);
  border-color: rgba(160, 148, 133, 0.3);
}

.mp-countdown-btn-cancel:hover {
  background: rgba(160, 148, 133, 0.1);
  border-color: rgba(160, 148, 133, 0.5);
}

/* --- Album page: floating countdown toast --- */
.mp-album-countdown {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(29, 26, 21, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(232, 191, 130, 0.15);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 45;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', system-ui, sans-serif;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.mp-album-countdown.mp-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mp-album-countdown .mp-countdown-text {
  font-size: 0.82rem;
}

.mp-album-countdown .mp-countdown-timer {
  font-size: 0.78rem;
  min-width: 24px;
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .mini-player {
    padding: 0 10px;
    gap: 8px;
    height: 52px;
  }

  body.has-mini-player .site-footer { padding-bottom: 64px; }

  .mp-btn svg {
    width: 16px;
    height: 16px;
  }

  .mp-btn-play svg {
    width: 20px;
    height: 20px;
  }

  .mp-track-title {
    font-size: 0.72rem;
    max-width: 100px;
  }

  .mp-track-number {
    display: none;
  }

  .mp-time {
    display: none;
  }

  .mp-countdown-text {
    font-size: 0.7rem;
  }

  .mp-album-countdown {
    bottom: 12px;
    padding: 10px 14px;
    gap: 8px;
    left: 12px;
    right: 12px;
    transform: translateX(0) translateY(20px);
  }

  .mp-album-countdown.mp-toast-visible {
    transform: translateX(0) translateY(0);
  }
}
