/* Pochtrons Radio - Styles */
:root {
  --bg: #0b0e13;
  --bg-elevated: #151a22;
  --bg-card: #1d242e;
  --border: rgba(255,255,255,0.08);
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: #0F6E56;
  --accent-light: #5DCAA5;
  --danger: #E24B4A;
  --radius: 12px;
  --pad: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f0;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --border: rgba(0,0,0,0.08);
    --text: #1a1a1a;
    --text-muted: #666;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

body {
  padding-bottom: 80px;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Login */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.login-box {
  background: var(--bg-elevated);
  padding: 32px 24px; border-radius: var(--radius);
  width: 100%; max-width: 360px; text-align: center;
}
.login-box h1 { margin: 0 0 4px; font-size: 24px; font-weight: 500; }
.login-box .subtitle { color: var(--text-muted); margin: 0 0 24px; font-size: 13px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box input, .login-box button {
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 16px;
}
.login-box button {
  background: var(--accent); color: white; border: none;
  font-weight: 500; cursor: pointer;
}
.error { color: var(--danger); font-size: 14px; margin: 0 0 12px; }

/* Header */
.app-header {
  padding: env(safe-area-inset-top) 16px 12px;
  padding-top: calc(env(safe-area-inset-top) + 12px);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.app-header h1 { margin: 0; font-size: 20px; font-weight: 500; }
.subtitle { color: var(--text-muted); margin: 2px 0 0; font-size: 12px; }
.icon-btn {
  background: none; border: none; color: var(--text);
  font-size: 20px; padding: 8px; cursor: pointer;
}

/* Search */
.search-bar { padding: 0 16px 12px; }
.search-bar input {
  width: 100%; padding: 10px 14px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 15px;
}

/* Player */
.player {
  margin: 0 16px 16px;
  padding: 14px;
  background: var(--accent);
  border-radius: var(--radius);
  color: white;
}
.player-info {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.player-info img {
  width: 48px; height: 48px; border-radius: 10px;
  background: rgba(255,255,255,0.15); object-fit: cover;
}
.player-info p { margin: 0; }
.player-info p:first-child { font-weight: 500; font-size: 15px; }
.player-info p:last-child { font-size: 12px; opacity: 0.85; }
.player-controls {
  display: flex; justify-content: center; gap: 24px; align-items: center;
}
.player-controls .icon-btn { color: white; }
.btn-play {
  width: 48px; height: 48px; border-radius: 50%;
  background: white; color: var(--accent);
  border: none; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Tabs */
.tabs {
  display: flex; gap: 8px; padding: 0 16px 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 6px 14px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 16px;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Genre filter */
.genre-filter { padding: 0 16px 12px; }
.genre-filter select {
  width: 100%; padding: 10px 14px;
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px;
}

/* Stations list */
.stations-list {
  padding: 0 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.loading { color: var(--text-muted); text-align: center; padding: 32px; }

.station-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; background: var(--bg-card);
  border-radius: 10px; cursor: pointer;
  transition: background 0.1s;
}
.station-row:active { background: var(--bg-elevated); }
.station-row.playing { border: 1px solid var(--accent); }
.station-logo {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 10px; font-weight: 500;
  object-fit: cover; flex-shrink: 0;
}
.station-info { flex: 1; min-width: 0; }
.station-info p { margin: 0; }
.station-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.station-row .icon-btn { color: var(--text-muted); font-size: 16px; }
.station-row.fav .btn-fav { color: var(--danger); }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.nav-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; padding: 4px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer;
}
.nav-btn span { font-size: 10px; }
.nav-btn.active { color: var(--text); }

/* Admin */
.admin-section {
  margin-bottom: 32px; padding: 16px;
  background: var(--bg-elevated); border-radius: var(--radius);
}
.admin-section h2 { margin: 0 0 16px; font-size: 16px; font-weight: 500; }
.admin-section h3 { margin: 24px 0 12px; font-size: 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td {
  padding: 8px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--text-muted); font-weight: 500; }
.admin-table button {
  padding: 4px 10px; margin: 2px; font-size: 12px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); cursor: pointer;
}
.admin-table .btn-danger { color: var(--danger); border-color: var(--danger); }
form input, form button, form select {
  padding: 8px 12px; margin: 4px 0;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font-size: 14px;
}
form button {
  background: var(--accent); color: white; border: none; cursor: pointer;
}
form label { display: block; margin: 6px 0; font-size: 13px; }
