/* === ЛОКАЛЬНИЙ ШРИФТ INTER (варіативний, замість Google Fonts) === */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === ОСНОВНІ КОЛЬОРИ === */
:root {
  --bg-color: #0f172a;
  --player-bg: #1e293b;
  --text-color: #f8fafc;
  --primary-accent: #B4020A;
  --secondary-accent: #ffffff;
  --error-color: #f87171;
  --inactive-color: #334155;
  --border-radius: 20px;
  --box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  --neon-glow: 0 0 15px rgba(255, 59, 48, 0.7);
}

/* === БАЗОВІ СТИЛІ === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: transparent;
  color: var(--text-color);
  padding: 20px;
}

/* === ОСНОВНИЙ КОНТЕЙНЕР ПЛЕЄРА === */
.radio-player {
  width: 100%;
  max-width: 320px;
  background-color: var(--player-bg);
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  padding: 30px 25px;
  transition: transform 0.3s ease;
  position: relative;
}

.radio-player:hover {
  transform: translateY(-5px);
}

/* === ЗАГОЛОВОК І НАВІГАЦІЯ === */
.station-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 25px;
}

.station-nav-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.station-nav-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.station-name {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  user-select: none;
  cursor: default;
  transition: color 0.5s ease;
  flex-grow: 1;

  /* --- ДОДАНО ДЛЯ ВИРІШЕННЯ ПРОБЛЕМИ --- */
  min-width: 0;             /* Дозволяє тексту стискатися менше за його вміст */
  white-space: nowrap;      /* Забороняє тексту переноситись на новий рядок */
  overflow: hidden;         /* Ховає текст, який не вміщується */
  text-overflow: ellipsis;  /* Додає три крапки в кінці обрізаного тексту */
}

.station-name.ukraine-colors {
  background: linear-gradient(180deg, #0057B8 50%, #FFD700 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

/* === ВІЗУАЛІЗАТОР АУДІО === */
.visualizer {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 50px;
  gap: 8px;
  margin-bottom: 30px;
}

.bar {
  width: 6px;
  height: 15px;
  background-color: var(--primary-accent);
  border-radius: 3px;
  transform-origin: bottom;
  opacity: 0.8;
}

.visualizer.active .bar:nth-child(1) { animation: pulse 0.8s infinite ease-in-out; }
.visualizer.active .bar:nth-child(2) { animation: pulse 1.1s infinite ease-in-out; }
.visualizer.active .bar:nth-child(3) { animation: pulse 0.7s infinite ease-in-out; }
.visualizer.active .bar:nth-child(4) { animation: pulse 1.2s infinite ease-in-out; }
.visualizer.active .bar:nth-child(5) { animation: pulse 0.9s infinite ease-in-out; }
.visualizer.active .bar:nth-child(6) { animation: pulse 1s infinite ease-in-out; }

@keyframes pulse {
  0%, 100% { transform: scaleY(1); opacity: 0.6; }
  50% { transform: scaleY(2.5); opacity: 1; box-shadow: var(--neon-glow); }
}

/* === КНОПКИ КЕРУВАННЯ === */
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
}

.play-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--primary-accent);
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

.play-btn svg {
  width: 26px;
  height: 26px;
  fill: var(--text-color);
}

.quality-buttons {
  display: flex;
  gap: 15px;
}

.quality-btn {
  padding: 8px 15px;
  border-radius: 15px;
  border: none;
  background-color: var(--inactive-color);
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quality-btn.active {
  background-color: var(--primary-accent);
  color: var(--player-bg);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* === ГУЧНІСТЬ === */
.volume-control {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-color);
  stroke-width: 2;
  fill: none;
  cursor: pointer;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.volume-icon:hover {
  transform: scale(1.1);
  stroke: var(--primary-accent);
}

#muteBtn {
  cursor: pointer;
}

.volume-slider {
  flex-grow: 1;
  -webkit-appearance: none;
  height: 5px;
  background: var(--inactive-color);
  border-radius: 5px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--secondary-accent);
  box-shadow: var(--neon-glow);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--secondary-accent);
  box-shadow: var(--neon-glow);
  cursor: pointer;
}

/* === СТАТУС І ЛОАДЕР === */
.status-message {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 14px;
  text-align: center;
  margin-bottom: 10px;
  min-height: 20px;
}

.loader {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--secondary-accent);
  animation: spin 1s ease-in-out infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}