/* ===== 1. КНОПКИ: ВИЗУАЛ, ПОДЛОЖКИ И ЭФФЕКТЫ ===== */
.audio-button {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  z-index: 1;
}

.audio-button svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Черный круг-подложка (всегда) */
.audio-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  z-index: -1;
}

/* Светлый блик (при наведении) */
.audio-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.audio-button:hover::after {
  opacity: 1;
}

.audio-button:hover {
  transform: scale(1.05);
}

/* КНОПКА ГРОМКОСТИ (Дублируем стиль один в один) */
.volume-mute-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  z-index: 1;
}

.volume-mute-btn svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.volume-mute-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: transparent;
  border-radius: 50%;
  z-index: -1;
}

.volume-mute-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.volume-mute-btn:hover::after {
  opacity: 1;
}

.volume-mute-btn:hover {
  transform: scale(1.05);
}

/* Скрываем перечеркнутую иконку по умолчанию */
.volume-mute-btn .mute-icon {
  display: none;
}

/* ===== 2. ОСНОВНОЙ БЛОК ПЛЕЕРА (В СТАТЬЕ) ===== */
.audio-block {
  background: linear-gradient(180deg, #322520 0%, #1b1411 100%);
  padding: 25px;
  margin: 40px auto;
  border-radius: 12px;
  border: 1px solid rgba(221, 159, 89, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  max-width: 800px;
  box-sizing: border-box;
}

.audio-description {
  font-family: 'Montserrat', sans-serif;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  margin-bottom: 20px;
  text-align: left;
}

/* Внутренняя панель управления */
.audio-controls {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #2a241f 0%, #1f1a16 100%);
  border-radius: 16px;
  padding: 20px;
  gap: 16px;
  border: 1px solid rgba(221, 159, 89, 0.3);
  position: relative;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(221, 159, 89, 0.2);
  font-family: 'Montserrat', sans-serif;
}

/* Прогресс-бар */
.audio-progress {
  width: 100%;
  cursor: pointer;
  padding: 15px 0;
  margin-top: -10px; 
  margin-bottom: -10px;
}

.audio-progress-bar {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
}

.audio-progress-bar::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 30px;
  background: transparent;
  z-index: 10;
}

.audio-progress-fill {
  position: absolute;
  height: 100%;
  background: #dd9f59;
  border-radius: 4px;
  width: 0%;
}

.audio-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #dd9f59;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Ряд кнопок (фиксированный) */
.audio-buttons {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
}

/* КАПСУЛА ГРОМКОСТИ */
.volume-capsule {
  display: flex;
  align-items: center;
  /* Полупрозрачный черный фон, как у таймера */
  background-color: rgba(0, 0, 0, 0.3); 
  /* Скругление, как у таймера */
  border-radius: 20px; 
  /* Отступ слева (для иконки) и справа (до края полоски) */
  padding: 0 15px 0 0; 
  /* Высота ровно 36px, как у таймера */
  height: 40px; 
  /* Расстояние между иконкой и полоской */
  gap: 8px; 
  /* Минимальная ширина, чтобы не прыгала */
  min-width: 140px; 
  box-sizing: border-box;
  /* Убираем возможный transition, чтобы не влиял на размеры */
  transition: none !important; 
}

.volume-progress-bar {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  flex-grow: 1;
  width: 60px;
  cursor: pointer;
  display: block;
}

.volume-progress-bar::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 24px;
  background: transparent;
  z-index: 10;
}

.volume-progress-fill {
  position: absolute;
  height: 100%;
  background: #dd9f59;
  border-radius: 4px;
}

.volume-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #dd9f59;
  border-radius: 50%;
}

/* Управление видимостью иконок внутри кнопки громкости */
#volumeButton .volume-icon {
    display: block; /* По умолчанию виден динамик */
}

#volumeButton .mute-icon {
    display: none; /* По умолчанию скрыт перечеркнутый динамик */
}

/* Когда кнопка получает класс 'is-muted', меняем их местами */
#volumeButton.is-muted .volume-icon {
    display: none;
}

#volumeButton.is-muted .mute-icon {
    display: block;
}

/* ТАЙМЕР: БЕЗ ПРЫЖКОВ ШИРИНЫ */
.timer-capsule {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  padding: 6px 15px;
  margin-left: auto; /* Всегда справа */
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 110px; /* Запас места под цифры */
  box-sizing: border-box;
}

.audio-timer {
  color: #fff;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.timer-separator {
  margin: 0 4px;
  opacity: 0.6;
}

/* ===== 3. ПЛЕЙЛИСТ И ТРЕКИ ===== */
.track-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(221, 159, 89, 0.3);
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.track-card:hover {
  background: rgba(221, 159, 89, 0.1);
  border-color: #dd9f59;
  transform: translateX(5px);
}

.track-name {
  font-weight: 600;
  color: #fcfce7;
  font-size: 16px;
}

/* ===== 4. АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  /* Уменьшаем общие отступы плеера */
  .audio-block {
    padding: 12px;
    margin: 20px 5px;
  }

  /* Сокращаем расстояние между кнопками и капсулами */
  .audio-buttons {
    gap: 6px !important; 
  }

  /* УМЕНЬШАЕМ КНОПКИ (Play, Prev, Next) */
  .audio-button, .volume-mute-btn {
    width: 32px !important;
    height: 32px !important;
  }
  
  .audio-button svg, .volume-mute-btn svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* УМЕНЬШАЕМ КАПСУЛУ ГРОМКОСТИ */
  .volume-capsule {
    height: 32px !important;
    min-width: 90px !important; /* Сужаем, чтобы сэкономить место */
    padding: 0 8px 0 0 !important;
    gap: 4px !important;
  }

  .volume-progress-bar {
    width: 35px !important; /* Делаем саму полоску короче */
  }

  /* УМЕНЬШАЕМ КАПСУЛУ ТАЙМЕРА */
  .timer-capsule {
    height: 32px !important;
    min-width: 80px !important; /* Компактнее */
    padding: 0 8px !important;
  }

  /* УМЕНЬШАЕМ ТЕКСТ ТАЙМЕРА */
  .audio-timer {
    font-size: 11px !important; /* Меньше шрифт */
  }

  /* Уменьшаем подложки кнопок */
  .audio-button::before, .volume-mute-btn::before {
    width: 32px !important;
    height: 32px !important;
  }
}

.volume-progress-fill, 
.volume-progress-thumb,
.audio-progress-fill,
.audio-progress-thumb {
  transition: none !important; 
}