/* === Player (left sidebar) === */

/* === Обложка трека === */

.player__cover {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;

  /* фон-заглушка, если картинка не подгрузилась */
  background-color: rgba(255, 255, 255, 0.08);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Иконка-заглушка (нота) — видна, только пока нет реальной обложки */
.player__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 24 24' fill='rgba(255,255,255,0.35)'><path d='M12 3v10.55A4 4 0 1014 17V7h4V3h-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 38% auto;
  opacity: 0.9;
  z-index: 0;
  pointer-events: none;
}

/* Скрыть заглушку, если внутри появилась картинка ИЛИ inline-фон от myradio24 */
.player__cover:has(img)::before,
.player__cover[style*="background-image"]::before {
  display: none;
}

/* Если внутри окажется img — растягиваем по контейнеру */
.player__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  position: relative;
  z-index: 1;
}

/* === Meta (artist + track) === */

.player__meta {
  text-align: center;
  min-height: 56px;
  flex-shrink: 0;
}

.player__artist {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.05em;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__track {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--c-text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Главная кнопка play === */

.play-big {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  flex-shrink: 0;
  align-self: center;
  padding: 0;
  margin: 4px auto;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #2c4a66;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.play-big:hover {
  background: #fff;
  transform: scale(1.05);
}

.play-big svg {
  width: 28px;
  height: 28px;
}

/* Переключение play/pause */
.play-big .icon-pause { display: none; }
.player.playing .play-big .icon-play { display: none; }
.player.playing .play-big .icon-pause { display: block; }

/* === LIVE indicator === */

.player__live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #fff;
  text-transform: uppercase;
  flex-shrink: 0;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* === Volume === */

.player__volume {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
}

.player__volume svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.player__volume input[type="range"] {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.player__volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.player__volume input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* === Action buttons (like, share) === */

.player__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, color 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

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

.icon-btn.is-active {
  background: rgba(255,255,255,0.95);
  color: #2c4a66;
  border-color: #fff;
}

/* === Playlist toggle === */

.player__playlist-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-h);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.player__playlist-btn:hover {
  background: rgba(255,255,255,0.2);
}

.player__playlist-btn svg {
  width: 14px;
  height: 14px;
}

/* === Wave / Визуализатор === */

.player__wave {
  margin-top: auto;
  padding-top: 16px;
  width: 100%;
  height: 70px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#visualizer {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.25));
  opacity: 0.9;
  transition: opacity 0.5s ease;
}

.player:not(.playing) #visualizer {
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  #visualizer { display: none; }
  .player__wave::after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
  }
}