/* styles.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: #fff;
  overflow: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background: #1e1e1e;
  font-family: Montserrat, sans-serif;
}

#loading-screen {
  position: fixed;
  display: flex;
  z-index: 10000;
  background: #1e1e1e;
  justify-content: center;
  align-items:  center;
  width: 100%;
  height: 100%;
  transition: opacity .5s;
  top: 0;
  left: 0;
}

.loading-content {
  text-align: center;
}

.loader {
  animation: spin 1s linear infinite;
  border: 3px solid #3e3e42;
  border-top-color: #4fc3f7;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: #4fc3f7;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}

.loading-subtext {
  color: #858585;
  font-size: 12px;
  font-weight: 400;
}

#scene-container {
  position: fixed;
  width: 100%;
  height: 100vh;
  top: 0;
  left: 0;
}

#ui-overlay {
  position: fixed;
  pointer-events: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

#ui-overlay > * {
  pointer-events: auto;
}

.mobile-menu-btn {
  position: fixed;
  display: none;
  cursor: pointer;
  z-index: 1001;
  background: #252526;
  border: 1px solid #3e3e42;
  border-radius: 6px;
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  width: 56px;
  height: 56px;
  bottom: 80px;
  left: 15px;
}

.hamburger {
  position: relative;
  background: #4fc3f7;
  width: 24px;
  height: 2px;
}

.hamburger:before, .hamburger:after {
  content: "";
  position: absolute;
  background: #4fc3f7;
  width: 24px;
  height: 2px;
  left: 0;
}

.hamburger:before {
  top: -7px;
}

.hamburger:after {
  bottom: -7px;
}

.top-bar {
  position: absolute;
  display: flex;
  z-index: 100;
  background: #252526;
  border-bottom: 1px solid #3e3e42;
  justify-content: space-between;
  align-items:  center;
  height: 60px;
  padding: 0 20px;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 2px 8px #0000004d;
}

.top-bar-left {
  display: flex;
  align-items:  center;
  gap: 12px;
}

.app-logo {
  font-size: 28px;
}

.app-title {
  color: #4fc3f7;
  letter-spacing: 1px;
  font-size: 16px;
  font-weight: 700;
}

.top-bar-center {
  flex: 1;
  margin: 0 auto;
  padding: 0 10px;
}

.search-container {
  width: 100%;
}

#global-search {
  color: #fff;
  outline: none;
  background: #1e1e1e;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  width: 100%;
  padding: 8px 12px;
  transition: border-color .2s, box-shadow .2s;
  font-family: Montserrat, sans-serif;
  font-size: 13px;
  font-weight: 500;
}

#global-search:focus {
  border-color: #4fc3f7;
  box-shadow: 0 0 0 2px #4fc3f74d;
}

.top-bar-right {
  display: flex;
  gap: 8px;
}

.icon-button {
  position: relative;
  color: #ccc;
  display: flex;
  cursor: pointer;
  background: #2d2d30;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  justify-content: center;
  align-items:  center;
  width: 40px;
  height: 40px;
  transition: background .2s, box-shadow .2s;
}

.icon-button:hover {
  background: #37373d;
  box-shadow: 0 0 12px #4fc3f74d;
}

.icon-button .icon {
  font-size: 18px;
}

.icon-button .count {
  position: absolute;
  color: #fff;
  text-align: center;
  background: #ec407a;
  border-radius: 10px;
  min-width: 18px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  top: -6px;
  right: -6px;
}

.qt-panel {
  background: linear-gradient(#252526, #232324);
  border: 1px solid #3e3e42;
  border-radius: 6px;
  box-shadow: 0 2px 8px #0000004d;
}

.panel-header {
  display: flex;
  background: #2d2d30;
  border-bottom: 1px solid #3e3e42;
  border-radius: 6px 6px 0 0;
  justify-content: space-between;
  align-items:  center;
  padding: 12px 16px;
}

.header-title {
  color: #4fc3f7;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 700;
}

.mobile-close-btn {
  display: none;
  color: #ccc;
  cursor: pointer;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 32px;
  line-height: 1;
}

.left-panel {
  position: absolute;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 320px;
  height: calc(100vh - 210px);
  transition: transform .3s;
  top: 80px;
  left: 20px;
}

.region-search, .station-search {
  position: sticky;
  z-index: 1;
  background: #252526;
  border-bottom: 1px solid #3e3e42;
  padding: 12px 16px;
  top: 48px;
}

.region-search input, .station-search input {
  color: #fff;
  outline: none;
  background: #1e1e1e;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  width: 100%;
  padding: 8px 12px;
  font-family: Montserrat, sans-serif;
  font-size: 12px;
}

.region-search input:focus, .station-search input:focus {
  border-color: #4fc3f7;
  box-shadow: 0 0 0 2px #4fc3f74d;
}

.region-list, .stations-container, #station-list {
  overflow-y: auto;
  flex: 1;
}

.region-item {
  cursor: pointer;
  border-bottom: 1px solid #3e3e42;
  padding: 12px 16px;
  transition: background .2s;
}

.region-item:hover, .region-item:active {
  background: #2d2d30;
}

.region-header {
  display: flex;
  align-items:  center;
  gap: 10px;
  margin-bottom: 6px;
}

.region-emoji {
  font-size: 20px;
}

.region-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.region-meta {
  color: #858585;
  font-size: 11px;
}

.station-count {
  background: #2d2d30;
  border-radius: 3px;
  padding: 2px 8px;
}

.list-header {
  display: flex;
  position: sticky;
  z-index: 1;
  background: #2d2d30;
  border-bottom: 1px solid #3e3e42;
  align-items:  center;
  gap: 12px;
  padding: 12px 16px;
  top: 0;
}

.back-btn {
  color: #4fc3f7;
  cursor: pointer;
  background: none;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  padding: 6px 12px;
  transition: background .2s;
  font-family: Montserrat, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.back-btn:hover, .back-btn:active {
  background: #37373d;
}

.station-item {
  border-bottom: 1px solid #3e3e42;
  padding: 12px 16px;
  transition: background .2s;
}

.station-item:hover, .station-item:active {
  background: #2d2d30;
}

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

.station-item-name {
  color: #fff;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
}

.station-item-location {
  color: #858585;
  font-size: 11px;
}

.station-play-btn {
  color: #1e1e1e;
  display: flex;
  cursor: pointer;
  background: #4fc3f7;
  border: none;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  transition: transform .2s, box-shadow .2s;
  font-size: 12px;
}

.station-play-btn:hover, .station-play-btn:active {
  transform: scale(1.1);
  box-shadow: 0 0 12px #4fc3f780;
}

.station-item-meta {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.genre-indicator {
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.station-genre {
  color: #858585;
  text-transform: uppercase;
  font-size: 10px;
}

.right-panel {
  position: absolute;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  width: 320px;
  height: calc(100vh - 154px);
  transition: transform .3s;
  top: 80px;
  right: 20px;
}

#scrollable-content {
  overflow-y: auto;
  flex: 1;
}

.favorites-panel {
  position: absolute;
  display: flex;
  overflow: hidden;
  z-index: 100;
  flex-direction: column;
  width: 320px;
  height: calc(100vh - 230px);
  transition: transform .3s ease-out;
  top: 80px;
  right: 20px;
  transform: translateX(calc(100% + 20px));
}

.favorites-panel.open {
  transform: translateX(0);
}

.favorites-container {
  overflow-y: auto;
  flex: 1;
  padding: 12px 16px;
}

.no-favorites-message {
  text-align: center;
  color: #858585;
  padding: 20px;
}

.close-favorites-btn {
  color: #ccc;
  cursor: pointer;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 32px;
  line-height: 1;
}

.now-playing {
  border-bottom: 1px solid #3e3e42;
  padding: 20px;
}

.station-artwork {
  aspect-ratio: 1;
  display: flex;
  background: #1e1e1e;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  justify-content: center;
  align-items:  center;
  width: 100%;
  margin-bottom: 16px;
}

.artwork-placeholder {
  opacity: .3;
  font-size: 64px;
}

.station-name {
  color: #fff;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.station-location {
  color: #ccc;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
}

.station-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-tag, .stream-quality {
  display: inline-block;
  color: #1e1e1e;
  letter-spacing: .5px;
  background: #4fc3f7;
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
}

.stream-quality {
  color: #858585;
  background: #2d2d30;
}

.audio-controls {
  position: relative;
  border-bottom: 1px solid #3e3e42;
  padding: 20px;
}

.play-button {
  color: #1e1e1e;
  display: flex;
  cursor: pointer;
  background: #4fc3f7;
  border: none;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  transition: transform .2s, box-shadow .2s;
  font-size: 24px;
}

.play-button:hover, .play-button:active {
  transform: scale(1.05);
  box-shadow: 0 0 20px #4fc3f780;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items:  center;
  margin: 0 auto 20px;
}

.spinner {
  animation: spin .8s linear infinite;
  border: 3px solid #3e3e42;
  border-top-color: #4fc3f7;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

.volume-section {
  display: flex;
  align-items:  center;
  gap: 12px;
}

.mute-btn {
  color: #ccc;
  cursor: pointer;
  background: none;
  border: none;
  min-width: 24px;
  font-size: 20px;
}

.volume-slider {
  -webkit-appearance: none;
  outline: none;
  background: #3e3e42;
  border-radius: 2px;
  flex: 1;
  height: 4px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  cursor: pointer;
  background: #4fc3f7;
  border-radius: 50%;
  width: 14px;
  height: 14px;
}

.volume-slider::-moz-range-thumb {
  cursor: pointer;
  background: #4fc3f7;
  border: none;
  border-radius: 50%;
  width: 14px;
  height: 14px;
}

.volume-value {
  color: #858585;
  text-align: right;
  min-width: 40px;
  font-size: 12px;
  font-weight: 600;
}

.stream-status {
  border-bottom: 1px solid #3e3e42;
  padding: 12px 20px;
}

.status-indicator {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.status-dot {
  background: #858585;
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.status-dot.status-playing {
  animation: pulse 1.5s ease-in-out infinite;
  background: #2ecc71;
}

.status-dot.status-connecting {
  background: #f39c12;
}

.status-dot.status-error {
  background: #e74c3c;
}

.status-dot.status-paused {
  background: #858585;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}

.status-text {
  color: #ccc;
  font-size: 12px;
  font-weight: 500;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.action-btn {
  color: #ccc;
  display: flex;
  cursor: pointer;
  background: #2d2d30;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  align-items:  center;
  gap: 10px;
  padding: 10px 16px;
  transition: background .2s, box-shadow .2s;
  font-family: Montserrat, sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.action-btn:hover, .action-btn:active {
  background: #37373d;
  box-shadow: 0 0 12px #4fc3f74d;
}

.action-btn .icon {
  font-size: 16px;
}

.roulette-btn {
  position: fixed;
  display: flex;
  cursor: pointer;
  z-index: 200;
  animation: roulettePulse 2s ease-in-out infinite;
  background: linear-gradient(135deg, #ec407a, #ab47bc);
  border: 3px solid #3e3e42;
  border-radius: 50%;
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  width: 80px;
  height: 80px;
  transition: transform .3s, box-shadow .3s;
  bottom: 120px;
  right: 30px;
  box-shadow: 0 4px 20px #ec407a66;
}

.roulette-btn:hover, .roulette-btn:active {
  transform: scale(1.1);
  box-shadow: 0 6px 30px #ec407a99;
}

@keyframes roulettePulse {
  0%, 100% {
    box-shadow: 0 4px 20px #ec407a66;
  }

  50% {
    box-shadow: 0 6px 30px #ec407ab3;
  }
}

.roulette-icon {
  margin-bottom: 4px;
  font-size: 32px;
}

.roulette-text {
  letter-spacing: .5px;
  text-align: center;
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
}

.roulette-glow {
  position: absolute;
  pointer-events: none;
  background: radial-gradient(circle, #ec407a4d, #0000);
  border-radius: 50%;
  inset: -3px;
}

.roulette-overlay {
  position: fixed;
  display: flex;
  z-index: 9999;
  background: #000000d9;
  justify-content: center;
  align-items:  center;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.roulette-content {
  text-align: center;
}

.roulette-spinner {
  animation: spin 1s linear infinite;
  margin-bottom: 30px;
  font-size: 120px;
}

.roulette-countdown {
  color: #4fc3f7;
  margin-bottom: 20px;
  font-size: 80px;
  font-weight: 700;
}

.roulette-message {
  color: #ccc;
  letter-spacing: 1px;
  font-size: 20px;
  font-weight: 600;
}

.mobile-player-bar {
  display: none;
  position: fixed;
  z-index: 150;
  background: #252526;
  border-top: 1px solid #3e3e42;
  align-items:  center;
  gap: 12px;
  height: 64px;
  padding: 8px 12px;
  bottom: 0;
  left: 0;
  right: 0;
}

.mobile-player-info {
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.mobile-station-name {
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 600;
}

.mobile-station-location {
  color: #858585;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
}

.mobile-station-genre {
  color: #4fc3f7;
  text-transform: uppercase;
  margin-top: 2px;
  font-size: 9px;
}

.mobile-player-controls {
  display: flex;
  flex-shrink: 0;
  align-items:  center;
  gap: 8px;
}

.mobile-play-btn {
  color: #1e1e1e;
  display: flex;
  cursor: pointer;
  background: #4fc3f7;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.mobile-favorite-btn {
  color: #fff;
  display: flex;
  cursor: pointer;
  background: #ec407a;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 44px;
  height: 44px;
  transition: background .2s, box-shadow .2s;
  font-size: 16px;
  font-weight: normal;
  line-height: 1;
}

.mobile-favorite-btn:hover {
  box-shadow: 0 0 12px #ec407a80;
}

.mobile-expand-btn {
  color: #ccc;
  background: #2d2d30;
}

.bottom-bar {
  position: absolute;
  display: flex;
  background: linear-gradient(#252526, #232324);
  border: 1px solid #3e3e42;
  border-radius: 6px;
  align-items:  center;
  gap: 20px;
  padding: 12px 20px;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px #0000004d;
}

.global-stats {
  display: flex;
  border-right: 1px solid #3e3e42;
  gap: 20px;
  padding-right: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items:  center;
}

.stat-number {
  color: #4fc3f7;
  font-size: 16px;
  font-weight: 700;
}

.stat-text {
  color: #858585;
  font-size: 10px;
}

.globe-controls {
  display: flex;
  gap: 8px;
}

.control-btn {
  color: #ccc;
  display: flex;
  cursor: pointer;
  background: #2d2d30;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  justify-content: center;
  align-items:  center;
  width: 36px;
  height: 36px;
  transition: background .2s, box-shadow .2s;
  font-size: 16px;
}

.control-btn:hover, .control-btn:active {
  background: #37373d;
  box-shadow: 0 0 12px #4fc3f74d;
}

.footer {
  position: fixed;
  color: #858585;
  z-index: 50;
  font-size: 11px;
  font-weight: 500;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.footer a {
  color: #4fc3f7;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.region-list::-webkit-scrollbar {
  background: none;
  width: 0;
}

.stations-container::-webkit-scrollbar {
  background: none;
  width: 0;
}

.right-panel::-webkit-scrollbar {
  background: none;
  width: 0;
}

#station-list::-webkit-scrollbar {
  background: none;
  width: 0;
}

.favorites-container::-webkit-scrollbar {
  background: none;
  width: 0;
}

.region-list::-webkit-scrollbar-track {
  background: none;
}

.stations-container::-webkit-scrollbar-track {
  background: none;
}

.right-panel::-webkit-scrollbar-track {
  background: none;
}

#station-list::-webkit-scrollbar-track {
  background: none;
}

.favorites-container::-webkit-scrollbar-track {
  background: none;
}

.region-list::-webkit-scrollbar-thumb {
  background: none;
}

.stations-container::-webkit-scrollbar-thumb {
  background: none;
}

.right-panel::-webkit-scrollbar-thumb {
  background: none;
}

#station-list::-webkit-scrollbar-thumb {
  background: none;
}

.favorites-container::-webkit-scrollbar-thumb {
  background: none;
}

.region-list::-webkit-scrollbar-thumb:hover {
  background: none;
}

.stations-container::-webkit-scrollbar-thumb:hover {
  background: none;
}

.right-panel::-webkit-scrollbar-thumb:hover {
  background: none;
}

#station-list::-webkit-scrollbar-thumb:hover {
  background: none;
}

.favorites-container::-webkit-scrollbar-thumb:hover {
  background: none;
}

@media (width <= 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .top-bar {
    flex-wrap: wrap;
    gap: 8px;
    height: auto;
    padding: 8px;
  }

  .top-bar-left {
    gap: 8px;
  }

  .app-logo {
    font-size: 24px;
  }

  .app-title {
    font-size: 11px;
  }

  .top-bar-center {
    width: 100%;
    max-width: none;
    margin-top: 4px;
  }

  #global-search {
    padding: 6px 10px;
    font-size: 12px;
  }

  .top-bar-right {
    gap: 6px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .icon-button .icon {
    font-size: 16px;
  }

  .left-panel {
    z-index: 1000;
    height: 100vh;
    max-height: 100vh;
    top: 0;
    left: -340px;
  }

  .left-panel.mobile-open {
    transform: translateX(340px);
  }

  .right-panel {
    display: none;
  }

  .right-panel.mobile-expanded {
    display: flex;
    position: fixed;
    z-index: 1002;
    overflow-y: auto;
    border-radius: 0;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - 64px);
    inset: 0;
  }

  .right-panel.mobile-expanded .now-playing {
    flex-shrink: 0;
    padding: 15px;
  }

  .right-panel.mobile-expanded .station-artwork {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
  }

  .right-panel.mobile-expanded .audio-controls, .right-panel.mobile-expanded .stream-status, .right-panel.mobile-expanded .quick-actions {
    flex-shrink: 0;
  }

  .mobile-close-btn {
    display: block;
  }

  .mobile-player-bar {
    display: flex;
  }

  .roulette-btn {
    width: 64px;
    height: 64px;
    bottom: 80px;
    right: 12px;
  }

  .roulette-icon {
    font-size: 26px;
  }

  .roulette-text {
    font-size: 6px;
  }

  .bottom-bar {
    gap: 12px;
    padding: 8px 12px;
    bottom: 76px;
  }

  .global-stats {
    gap: 12px;
    padding-right: 12px;
  }

  .stat-number {
    font-size: 13px;
  }

  .stat-text {
    font-size: 9px;
  }

  .control-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .footer {
    display: none;
  }
}

@media (width <= 480px) {
  .app-title {
    font-size: 10px;
  }

  .roulette-btn {
    width: 56px;
    height: 56px;
  }

  .roulette-icon {
    font-size: 22px;
  }

  .roulette-text {
    font-size: 5px;
  }
}
