:root {
  --bg: #f8f9fa;
  --text: #222;
  --card-bg: #ffffff;
  --header-bg: #1976d2;
  --player-bg: #222;
  --player-text: #fff;
  --btn-bg: #4caf50;
  --border-color: #ccc;
}

[data-theme="dark"] {
  --bg: #121212;
  --text: #e0e0e0;
  --card-bg: #1e1e1e;
  --header-bg: #0d47a1;
  --player-bg: #000;
  --player-text: #fff;
  --btn-bg: #43a047;
  --border-color: #444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 90px;
  transition: background 0.3s, color 0.3s;
  line-height: 1.5;
}

header {
  background: var(--header-bg);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.logo-link {
  text-decoration: none;
  color: white;
  font-weight: bold;
}

.logo-link h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  color: rgba(255,255,255,0.9);
}
.lang-switch a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  margin: 0 4px;
}
.lang-switch a.active {
  color: white;
  font-weight: bold;
}

.theme-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 900px;
  margin: 16px auto;
  padding: 0 16px;
}

.btn {
  background: var(--btn-bg);
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  margin: 12px 0;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background 0.2s, transform 0.1s;
}
.btn:hover {
  transform: translateY(-1px);
}

.search-input {
  width: 100%;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--btn-bg);
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.country-item {
  display: block;
  padding: 12px;
  background: var(--card-bg);
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: var(--header-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background 0.2s, transform 0.1s;
}
.country-item:hover {
  background: #e3f2fd;
  transform: translateY(-2px);
}

.station {
  display: flex;
  align-items: center;
  padding: 12px;
  margin: 8px 0;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background 0.2s;
}
.station:hover {
  background: #f0f7ff;
}

.station-logo {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 12px;
  background: #eee;
  flex-shrink: 0;
}

.station-info {
  flex: 1;
  text-align: left;
}

.station-info strong {
  font-size: 1.1em;
  display: block;
  color: var(--text);
}

.tags {
  color: #666;
  font-size: 0.9em;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
[data-theme="dark"] .tags {
  color: #aaa;
}

.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--player-bg);
  color: var(--player-text);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  box-sizing: border-box;
}

.player-logo {
  width: 40px;
  height: 40px;
  margin-right: 12px;
  border-radius: 4px;
  background: #444;
  flex-shrink: 0;
}

#play-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--player-text);
  font-size: 18px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

@media (max-width: 600px) {
  .station { padding: 10px; }
  .station-logo { width: 40px; height: 40px; }
  .player-logo { width: 36px; height: 36px; }
  .btn { padding: 10px; }
  .search-input { padding: 10px; }
}

#favorites-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}
#favorites-section h2 {
  margin-bottom: 16px;
  color: var(--header-bg);
}
