*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-elevated: #121212;
  --bg-elevated-2: #181818;
  --accent: #1db954;
  --accent-soft: rgba(29, 185, 84, 0.16);
  --accent-border: rgba(29, 185, 84, 0.6);
  --text-primary: #ffffff;
  --text-muted: #b3b3b3;
  --text-soft: #8b8b8b;
  --border-subtle: #282828;
  --error: #ff6b6b;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, #282828 0, #000000 45%, #000000 100%);
  color: var(--text-primary);
}

/* Layout */

.app-root {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, #1db954, #1ed760);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}

.brand-logo .material-icons {
  font-size: 22px;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.35rem;
}

.brand-text p {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Buttons */

.icon-button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.1s ease,
    color 0.1s ease,
    transform 0.1s ease;
}

.icon-button:hover {
  background: #282828;
  color: var(--text-primary);
  transform: translateY(-0.5px);
}

.primary-button {
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #000;
  padding: 0.35rem 0.9rem;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    filter 0.1s ease;
}

.primary-button .material-icons {
  font-size: 18px;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.8);
  filter: brightness(1.05);
}

/* App layout */

.app-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

/* Player area */

.player-area {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Spotify-style player card */

.player-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #181818 0%, #121212 50%, #000000 100%);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 700px) {
  .player-card {
    grid-template-columns: 1fr;
  }
}

.artwork-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.artwork {
  width: min(250px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, #1db954, #1ed760);
  background-size: cover;
  background-position: center;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.artwork::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.35) 100%);
}

.player-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.track-text .track-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.track-text h2 {
  margin: 0.25rem 0 0.15rem;
  font-size: 1.2rem;
}

.track-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.station-extra {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* Player controls */

.player-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.play-button {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9);
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    opacity 0.1s ease,
    filter 0.1s ease;
}

.play-button .material-icons {
  font-size: 30px;
}

.play-button:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.play-button:not(:disabled):hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 23px 50px rgba(0, 0, 0, 1);
  filter: brightness(1.03);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.volume-icon {
  font-size: 20px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1db954, #1ed760);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -5px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.9);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1db954, #1ed760);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.9);
}

/* Tech section */

.tech-section {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.tech-section h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.tech-hint {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
}

.tech-item {
  padding: 0.4rem 0.6rem;
  border-radius: 9px;
  background: #181818;
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}

.tech-label {
  display: block;
  color: var(--text-soft);
  margin-bottom: 0.15rem;
}

.tech-value {
  font-weight: 500;
}

/* Browse area (search + lists) */

.browse-area {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Search card */

.search-card {
  padding: 0.7rem 0.8rem 0.6rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.search-row {
  display: grid;
  grid-template-columns: 1.6fr auto auto;
  gap: 0.4rem;
  align-items: center;
}

@media (max-width: 700px) {
  .search-row {
    grid-template-columns: 1fr;
  }
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  font-size: 18px;
  color: var(--text-soft);
}

.search-input-wrapper input {
  width: 100%;
  padding: 0.45rem 0.7rem 0.45rem 2.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid #282828;
  background: #181818;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.search-input-wrapper input::placeholder {
  color: var(--text-soft);
}

.search-mode {
  border-radius: var(--radius-pill);
  border: 1px solid #282828;
  background: #181818;
  color: var(--text-primary);
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

.search-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* List card */

.list-card {
  padding: 0.4rem 0.5rem 0.6rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.list-tabs {
  display: inline-flex;
  align-self: flex-start;
  background: #181818;
  border-radius: var(--radius-pill);
  padding: 0.12rem;
  border: 1px solid #282828;
  margin-bottom: 0.4rem;
}

.list-tab {
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 0.22rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-soft);
  cursor: pointer;
}

.list-tab .material-icons {
  font-size: 16px;
}

.list-tab.active {
  background: #282828;
  color: var(--text-primary);
}

.list-content {
  flex: 1;
}

.hidden {
  display: none !important;
}

/* Station list */

.station-list {
  list-style: none;
  margin: 0;
  padding: 0.3rem 0.2rem 0.1rem;
  max-height: 420px;
  overflow-y: auto;
}

.station-item {
  padding: 0.35rem 0.4rem;
  border-radius: 9px;
  transition:
    background 0.1s ease,
    transform 0.1s ease;
}

.station-item:hover {
  background: #181818;
  transform: translateY(-0.5px);
}

.station-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  align-items: center;
}

.station-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, #1db954, #1ed760);
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8);
}

.station-text {
  min-width: 0;
}

.station-name {
  margin: 0;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-meta {
  margin: 0.08rem 0 0;
  font-size: 0.78rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.chip-button {
  border-radius: var(--radius-pill);
  border: 1px solid #282828;
  background: #181818;
  color: var(--text-primary);
  padding: 0.18rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.1s ease,
    transform 0.1s ease;
}

.chip-button .material-icons {
  font-size: 18px;
}

.chip-button:hover {
  background: #282828;
  transform: translateY(-0.5px);
}

.fav-button .material-icons {
  font-size: 20px;
}

.fav-button.favorited {
  color: var(--accent);
}

/* Current playing highlight */

.station-item.current {
  background: var(--accent-soft);
}

/* Misc */

.error-message {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--error);
}

.empty-state {
  font-size: 0.82rem;
  color: var(--text-soft);
  padding: 0.4rem 0.2rem;
}

/* Overlay / About dialog */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.about-dialog {
  width: min(420px, 94vw);
  background: #181818;
  border-radius: 16px;
  padding: 0.9rem 1rem 0.8rem;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.9);
  border: 1px solid #333333;
}

.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.about-header h2 {
  margin: 0;
  font-size: 1rem;
}

.about-body p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.about-body p:first-of-type {
  margin-top: 0.25rem;
}

.about-meta {
  margin-bottom: 0.3rem;
}

.about-note {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.about-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.3rem;
}
