/* ====== Base Reset ====== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ====== Layout Containers ====== */
#container > div {
  padding: 10px;
  margin: 5px;
  background-color: #f0f0f0;
}

/* ====== Station Cards ====== */
.station-card {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ccc;
  padding: 10px;
  font-family: sans-serif;
  transition: opacity 0.3s ease;
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.col {
  padding: 5px;
}

.station {
  width: 220px;
  font-weight: bold;
  margin-left: 15px;
}

.language {
  width: 100px;
}

.genre {
  flex-grow: 1;
  min-width: 130px;
  max-width: 300px;
  padding-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 700px) {
  .language,
  .genre {
    display: none;
  }
}

.player {
  flex-grow: 1;
  text-align: right;
}

.website a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  background-color: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #007acc;
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
}

.website a:hover {
  background-color: #e6f0fa;
}

/* ====== Station Card Logos ====== */
.logo-play-trigger, .country {
  width: 100px;
  height: 100px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
  margin-right: 15px;
}

.logo-play-trigger img.flag,
.country img.flag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.logo-play-trigger .hover-play-icon,
.country .hover-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.logo-play-trigger::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  border-radius: 8px;
}

.logo-play-trigger:hover::after {
  opacity: 1;
}

.logo-play-trigger:hover .hover-play-icon,
.country:hover .hover-play-icon {
  opacity: 1;
}

.logo-play-trigger:hover img.flag {
  transform: scale(1.05);
}

/* ====== Main Audio Player ====== */
.main-player-info {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background-color: #222;
  border-top: 1px solid #444;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  color: white;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.main-player-info * {
  color: white;
}

.main-logo-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

#mainFlag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.main-overlay-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  opacity: 0.8;
  pointer-events: none;
  user-select: none;
  z-index: 10;
}

.main-player-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.station-name {
  font-weight: bold;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.station-name.scroll .scrolling-text {
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 18s linear infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.stream-status {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 6px;
  background-color: #444;
  color: #fff;
  white-space: nowrap;
}

.stream-status.live {
  background-color: #3cb043;
}

.stream-status.offline,
.stream-status.error {
  background-color: #b22222;
}

.stream-status.loading {
  background-color: #d4af37;
  color: black;
}

#mainPlayer {
  display: none;
}

#volumeContainer {
  display: flex;
  align-items: center;
  gap: 6px;
}

#volumeSlider {
  width: 100px;
  accent-color: white;
  background-color: #444;
  cursor: pointer;
}

.volume-controls button {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  margin-right: 8px;
  color: white;
}
.volume-controls button:hover {
  opacity: 0.8;
}

#muteButton {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 8px;
  padding: 4px;
}

#muteButton img {
  width: 20px;
  height: 20px;
  filter: invert(100%); /* Makes icon white on dark background */
}

/* Pagination */
#pagination button {
  margin: 2px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

#pagination button:disabled {
  background-color: #ccc;
  cursor: default;
}

/* Responsive tweaks */
@media (max-width: 620px) {
  .main-player-text {
    align-items: flex-start;
  }

  .station-name {
    margin-bottom: 4px;
    max-width: 100%;
  }
}
