:root {
  --bg-base: #060913;
  --bg-surface: #0c1222;
  --bg-elevated: #121b33;
  --bg-hover: #182544;
  --border-subtle: rgba(56, 189, 248, 0.14);
  --blue-primary: #2563eb;
  --blue-bright: #38bdf8;
  --blue-glow: rgba(56, 189, 248, 0.28);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #22c55e;
  --player-height: 88px;
}

body.accent-cyan {
  --blue-primary: #0284c7;
  --blue-bright: #22d3ee;
  --blue-glow: rgba(34, 211, 238, 0.3);
}

body.accent-cobalt {
  --blue-primary: #1d4ed8;
  --blue-bright: #60a5fa;
  --blue-glow: rgba(96, 165, 250, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* ==================== AUTH & COMPULSORY OTP ==================== */
.auth-overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.22), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.16), transparent 45%),
    var(--bg-base);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup.center {
  justify-content: center;
  margin-bottom: 24px;
}

.songza-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff, var(--blue-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title.sm {
  font-size: 1.25rem;
}

.brand-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-base);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.auth-tab.active {
  background: var(--blue-primary);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.otp-banner {
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 12px;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.otp-code-input {
  text-align: center;
  font-size: 1.4rem !important;
  letter-spacing: 0.35em;
  font-weight: 700;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
}

.auth-feedback {
  margin-top: 14px;
  font-size: 0.85rem;
  text-align: center;
  min-height: 20px;
  color: var(--blue-bright);
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: linear-gradient(135deg, var(--blue-primary), #1d4ed8);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--blue-glow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--blue-bright);
}

.btn-outline {
  background: transparent;
  color: var(--blue-bright);
  border: 1px solid var(--blue-bright);
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
}

.btn-link {
  background: none;
  border: none;
  color: var(--blue-bright);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.sm {
  padding: 7px 13px;
  font-size: 0.84rem;
}

.full-width {
  width: 100%;
}

.icon-btn,
.icon-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  padding: 6px;
  border-radius: 8px;
  transition: 0.15s;
}

.icon-btn:hover,
.icon-btn-sm:hover {
  color: var(--blue-bright);
  background: rgba(56, 189, 248, 0.1);
}

.icon-btn.active {
  color: var(--blue-bright);
}

/* ==================== APP SHELL LAYOUT ==================== */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding-bottom: var(--player-height);
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--player-height));
}

.badge-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--blue-bright);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: 0.18s;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.28), rgba(56, 189, 248, 0.1));
  color: var(--blue-bright);
  border-left: 3px solid var(--blue-bright);
}

.sidebar-playlists {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.sidebar-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sidebar-playlist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-pl-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-pl-item:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-bright));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-status {
  font-size: 0.74rem;
  color: var(--blue-bright);
}

/* ==================== MAIN WORKSPACE ==================== */
.main-content {
  padding: 22px 28px;
  max-width: 1280px;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 12px;
}

.mobile-brand {
  display: none;
}

.admin-notice {
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid var(--blue-bright);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  color: #e0f2fe;
}

.hero-banner {
  background: linear-gradient(135deg, #0f1d3d 0%, #0b132b 55%, #132a5e 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.hero-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue-bright);
}

.hero-banner h2 {
  font-size: 1.75rem;
  margin: 6px 0 8px;
}

.hero-banner p {
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 18px;
}

.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.visualizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 64px;
}

.visualizer-bars span {
  width: 8px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue-primary));
  transition: height 0.2s;
}

.visualizer-bars.playing span {
  animation: eqPulse 0.9s infinite ease-in-out alternate;
}

.visualizer-bars.playing span:nth-child(2) { animation-delay: 0.15s; }
.visualizer-bars.playing span:nth-child(3) { animation-delay: 0.3s; }
.visualizer-bars.playing span:nth-child(4) { animation-delay: 0.1s; }
.visualizer-bars.playing span:nth-child(5) { animation-delay: 0.4s; }
.visualizer-bars.playing span:nth-child(6) { animation-delay: 0.2s; }
.visualizer-bars.playing span:nth-child(7) { animation-delay: 0.35s; }

@keyframes eqPulse {
  from { height: 14px; }
  to { height: 62px; }
}

.section-block {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==================== MOOD CARDS & TRACK LIST ==================== */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
}

.mood-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: 0.2s;
}

.mood-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-bright);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.mood-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-bright));
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-row {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 12px;
  transition: 0.18s;
}

.track-row:hover {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.track-row.playing {
  background: rgba(37, 99, 235, 0.18);
  border-color: var(--blue-bright);
}

.track-art {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
}

.track-info {
  min-width: 0;
  cursor: pointer;
}

.track-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== SEARCH & PLAYLISTS ==================== */
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 12px;
  margin: 14px 0;
}

.search-bar-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  box-shadow: none !important;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}

.chip.active,
.chip:hover {
  background: var(--blue-primary);
  color: #fff;
  border-color: var(--blue-bright);
}

.playlist-workspace {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

.playlist-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playlist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
}

.playlist-card.active {
  border-color: var(--blue-bright);
  background: var(--bg-elevated);
}

.playlist-detail-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
}

.playlist-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

/* ==================== SETTINGS & ADMIN PANEL ==================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 20px;
  margin-top: 16px;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.input-sm {
  width: 190px;
}

.admin-unlock-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-base);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
}

.admin-user-item {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.admin-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.admin-controls-grid label {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==================== PERSISTENT BOTTOM PLAYER BAR ==================== */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  background: rgba(10, 16, 32, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  align-items: center;
  padding: 0 22px;
  gap: 16px;
  z-index: 50;
}

.player-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-cover {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-bright));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  flex-shrink: 0;
}

.player-meta {
  min-width: 0;
}

.player-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.play-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue-primary));
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--blue-glow);
}

.progress-row {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  width: 36px;
  text-align: center;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: #1e293b;
  border-radius: 999px;
  cursor: pointer;
  flex: 1;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--blue-bright);
}

.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.player-right input[type="range"] {
  max-width: 110px;
}

/* ==================== MODAL & RESPONSIVE ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 15, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form input {
  flex: 1;
}

.modal-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 144px;
  }
  .sidebar {
    display: none;
  }
  .mobile-brand {
    display: block;
  }
  .playlist-workspace,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .player-bar {
    bottom: 56px;
    grid-template-columns: 1fr 1.2fr;
    padding: 0 12px;
  }
  .player-right {
    display: none;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 60;
  }
  .mobile-nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    gap: 2px;
  }
  .mobile-nav-btn.active {
    color: var(--blue-bright);
  }
}