/* =============================================
   RunBeat Radio – Enhanced Sticky Player
   ============================================= */

.rb-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  flex-direction: column;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.rb-player-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(180deg, #1a1c20 0%, #111214 100%);
  border-top: 1px solid #2a2c30;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

/* ── Album Art ─────────────────────────────── */
.rb-art-wrap {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #222428;
  position: relative;
}

.rb-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.rb-art-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #1a1c20, #2a2c30);
}

/* ── Track Info ────────────────────────────── */
.rb-track-info {
  flex: 1;
  min-width: 0;
  padding-right: 0.5rem;
}

.rb-now-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #EC008C;
  margin-bottom: 0.15rem;
}

.rb-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}

.rb-artist {
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}

/* ── Controls ──────────────────────────────── */
.rb-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.rb-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #EC008C, #c4006e);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.rb-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(236,0,140,0.4);
}

.rb-play-btn:active { transform: scale(0.95); }

.rb-play-btn.rb-playing {
  background: linear-gradient(135deg, #00AEEF, #0088cc);
}

.rb-play-btn svg { display: block; }

/* ── Volume ────────────────────────────────── */
.rb-vol-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.rb-vol {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.rb-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00AEEF;
  cursor: pointer;
}

.rb-vol::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00AEEF;
  border: none;
  cursor: pointer;
}

/* ── History Toggle ────────────────────────── */
.rb-history-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.rb-history-toggle:hover {
  background: rgba(255,255,255,0.08);
}

.rb-history-toggle svg { display: block; }

/* ── Recently Played Panel ─────────────────── */
.rb-history {
  background: #1a1c20;
  border-top: 1px solid #2a2c30;
  max-height: 320px;
  overflow-y: auto;
}

.rb-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  border-bottom: 1px solid #2a2c30;
  position: sticky;
  top: 0;
  background: #1a1c20;
}

.rb-history-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
}

.rb-history-close:hover { color: #f0f0f0; }

.rb-history-list { padding: 0.25rem 0; }

.rb-history-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.25rem;
  transition: background 0.15s;
}

.rb-history-item:hover { background: rgba(255,255,255,0.03); }

.rb-history-art-wrap {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #222428;
}

.rb-history-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rb-history-art-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #1a1c20, #2a2c30);
}

.rb-history-meta {
  flex: 1;
  min-width: 0;
}

.rb-history-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-history-artist {
  font-size: 0.7rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-history-time {
  font-size: 0.7rem;
  color: #555;
  flex-shrink: 0;
}

.rb-history-empty {
  padding: 1.5rem;
  text-align: center;
  color: #555;
  font-size: 0.85rem;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 600px) {
  .rb-player-main { padding: 0.4rem 0.75rem; gap: 0.5rem; }
  .rb-art-wrap { width: 44px; height: 44px; }
  .rb-title { font-size: 0.85rem; }
  .rb-artist { font-size: 0.72rem; }
  .rb-play-btn { width: 42px; height: 42px; }
  .rb-vol-wrap { display: none; }
  .rb-history-toggle { display: none; }
}

/* ── Footer padding to prevent player overlap ── */
body.has-player footer { padding-bottom: 80px; }
