/* ================================================================
   rdios.me — Dark Mode
   ================================================================ */

:root {
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --color-primary:       #7c3aed;
  --color-primary-dark:  #6d28d9;
  --color-primary-light: #8b5cf6;

  /* Dark palette */
  --bg-base:    #0d0d1a;
  --bg-surface: #13132b;
  --bg-card:    #1a1a2e;
  --bg-input:   #1e1e38;
  --bg-hover:   #222240;
  --bg-table-head: #111126;

  --border:     #2a2a4a;
  --border-light: #222244;

  --text-primary:   #e8e6f4;
  --text-secondary: #9490c0;
  --text-muted:     #5e5a8a;

  --sidebar-bg:     #0b0b1e;
  --sidebar-text:   #a89de8;
  --sidebar-hover:  #18183a;
  --sidebar-active: #7c3aed;
}

/* ── Reset / Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
}

/* ── Layout ──────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-brand-name { color: #fff; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-brand-sub  { color: var(--sidebar-text); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; display: block; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }

.sidebar-section-title {
  color: var(--text-muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 12px 20px 4px;
  display: block;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: 6px;
  margin: 1px 8px;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.is-active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.sidebar-icon { font-size: 18px; flex-shrink: 0; opacity: 0.8; width: 20px; text-align: center; }
.sidebar-link.is-active .sidebar-icon { opacity: 1; }

.sidebar-footer { padding: 14px 20px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.sidebar-user-name { color: #fff; font-size: 0.85rem; font-weight: 600; }
.sidebar-user-role { color: var(--sidebar-text); font-size: 0.72rem; }

/* ── Main area ───────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-base);
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title  { flex: 1; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Page content ────────────────────────────────────────────── */
.page-content { flex: 1; padding: 28px; }

/* ── Bulma overrides: body background ───────────────────────── */
.notification { color: var(--text-primary) !important; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card) !important;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  border: 1px solid var(--border) !important;
  color: var(--text-primary);
}
.card-header { border-bottom: 1px solid var(--border) !important; padding: 14px 20px; }
.card-header-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary) !important; }
.card-content { background: var(--bg-card) !important; color: var(--text-primary); }
.card-footer  { background: var(--bg-card) !important; border-top: 1px solid var(--border) !important; }

/* ── Stat cards ──────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.stat-card-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-card-value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-card-sub   { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; }
.stat-card-icon  { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-success { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-danger  { background: rgba(239,68,68,0.15);  color: #f87171; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-info    { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-neutral { background: rgba(148,163,184,0.1); color: var(--text-secondary); }

.badge-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.badge-success .badge-dot { background: #10b981; }
.badge-danger  .badge-dot { background: #ef4444; }
.badge-warning .badge-dot { background: #f59e0b; }
.badge-info    .badge-dot { background: #3b82f6; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-card {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.table {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}
.table th {
  font-size: 0.72rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted) !important;
  font-weight: 600;
  background: var(--bg-table-head) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 10px 14px !important;
  border-color: var(--border) !important;
}
.table td {
  padding: 12px 14px !important;
  vertical-align: middle !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
}
.table tr:last-child td { border-bottom: none !important; }
.table.is-hoverable tbody tr:hover td { background: var(--bg-hover) !important; }
.table.is-striped tbody tr:nth-child(even) { background: rgba(255,255,255,0.02) !important; }

/* ── Forms ───────────────────────────────────────────────────── */
.label { color: var(--text-secondary) !important; font-size: 0.82rem !important; }

.input, .select select, .textarea {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  border-radius: 6px !important;
  color: var(--text-primary) !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted) !important; }
.input:focus, .select select:focus, .textarea:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2) !important;
  background: var(--bg-input) !important;
}
.input:disabled, .textarea:disabled, .select select:disabled {
  background: rgba(30,30,60,0.5) !important;
  color: var(--text-muted) !important;
}

.select::after { border-color: var(--text-secondary) !important; }
.select select option { background: var(--bg-input); color: var(--text-primary); }

.checkbox, .radio { color: var(--text-primary) !important; }

/* ── Buttons ─────────────────────────────────────────────────── */
.button {
  border-radius: 6px !important;
  font-weight: 500;
  transition: all 0.15s;
}
.button.is-primary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}
.button.is-primary:hover {
  background-color: var(--color-primary-dark) !important;
  border-color: var(--color-primary-dark) !important;
}
.button.is-light {
  background: var(--bg-hover) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
.button.is-light:hover { background: #2a2a50 !important; }
.button.is-ghost {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--text-secondary) !important;
}
.button.is-ghost:hover { color: var(--text-primary) !important; background: var(--bg-hover) !important; }
.button.is-small { font-size: 0.78rem !important; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-card { background: var(--bg-card) !important; border: 1px solid var(--border); }
.modal-card-head {
  background: #0b0b22 !important;
  border-bottom: 1px solid var(--border) !important;
}
.modal-card-title { color: var(--text-primary) !important; }
.modal-card-body  { background: var(--bg-card) !important; color: var(--text-primary) !important; }
.modal-card-foot  { background: var(--bg-surface) !important; border-top: 1px solid var(--border) !important; }
.modal-background { background: rgba(0,0,0,0.75) !important; }

/* ── Flash messages ──────────────────────────────────────────── */
.flash-container {
  position: fixed; top: 70px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 380px;
}
.flash-message {
  padding: 12px 16px; border-radius: 8px; font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Now Playing bar ─────────────────────────────────────────── */
.nowplaying-bar {
  background: linear-gradient(135deg, #1a1040 0%, #261560 100%);
  border: 1px solid rgba(124,58,237,0.3);
  color: #fff;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 14px;
  font-size: 0.82rem;
}
.nowplaying-bar .track-info  { flex: 1; }
.nowplaying-bar .track-title { font-weight: 600; }
.nowplaying-bar .track-artist { color: #a5b4fc; font-size: 0.78rem; }

/* ── Panels / boxes ──────────────────────────────────────────── */
.box {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown-menu { background: var(--bg-card) !important; border: 1px solid var(--border) !important; }
.dropdown-item { color: var(--text-primary) !important; }
.dropdown-item:hover { background: var(--bg-hover) !important; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination-link, .pagination-previous, .pagination-next {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
.pagination-link:hover, .pagination-previous:hover, .pagination-next:hover {
  background: var(--bg-hover) !important;
  border-color: var(--color-primary) !important;
}
.pagination-link.is-current {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}

/* ── Progress bar ────────────────────────────────────────────── */
progress { background: var(--border) !important; }

/* ── HR / divider ────────────────────────────────────────────── */
hr { background: var(--border) !important; height: 1px !important; }

/* ── Links ───────────────────────────────────────────────────── */
a { color: var(--color-primary-light); }
a:hover { color: #fff; }

/* ── Headings inside content ─────────────────────────────────── */
h1,h2,h3,h4,h5 { color: var(--text-primary) !important; }
p { color: var(--text-primary); }

/* ── Columns fix ─────────────────────────────────────────────── */
.columns { color: inherit; }

/* ── Public player ───────────────────────────────────────────── */
.public-player {
  background: linear-gradient(135deg, #0d0d28 0%, #1a1040 100%);
  border-radius: 16px; padding: 32px; color: #fff; text-align: center;
  border: 1px solid var(--border);
}
.public-player-cover {
  width: 180px; height: 180px; border-radius: 12px;
  object-fit: cover; margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ── Auth layout ─────────────────────────────────────────────── */
body.auth-page {
  background: linear-gradient(135deg, var(--bg-base) 0%, #12113a 100%);
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}

/* ── Scrollbar dark ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .main-area { margin-left: 0; }
}

/* ── NowPlaying card loader ──────────────────────────────────── */
.np-card { position: relative; }
.np-card::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--color-primary-light, #7c3aed);
  animation: np-spin 0.7s linear infinite;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.np-card.np-loading::after { opacity: 1; }
@keyframes np-spin { to { transform: rotate(360deg); } }
.ph-spin { animation: np-spin 1s linear infinite; }

/* ── Switch toggle ── */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  transition: background 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #9ca3af;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .switch-slider {
  background: rgba(124,58,237,0.35);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(16px);
  background: #7c3aed;
}
