/* ============================================================
   Spotify Monitor – Dark Dashboard Stylesheet
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --color-bg:      #0d0d0d;
  --color-surface: #1a1a1a;
  --color-card:    #1e1e1e;
  --color-border:  #2a2a2a;
  --color-text:    #e0e0e0;
  --color-muted:   #707070;
  --color-green:   #1db954;
  --color-red:     #e53935;
  --color-yellow:  #ffc107;
  --color-blue:    #2196f3;
}

/* ---- Base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

/* ---- Login page ------------------------------------------- */
.login-page { background: radial-gradient(ellipse at top, #1a1a2e 0%, #0d0d0d 70%); }
.login-card {
  background: var(--color-card) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 16px;
}
.login-logo { animation: pulse-green 2s infinite; }
@keyframes pulse-green {
  0%,100% { filter: drop-shadow(0 0 0px #1db954); }
  50%      { filter: drop-shadow(0 0 14px #1db954); }
}

/* ---- Layout ----------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #111;
  border-right: 1px solid var(--color-border);
  z-index: 1000;
  transition: transform .25s ease;
  overflow-y: auto;
}
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); }

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left .25s ease;
}
.main-content.expanded { margin-left: 0; }

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(13,13,13,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 900;
}

/* ---- Sidebar nav ------------------------------------------ */
.sidebar-brand { border-bottom: 1px solid var(--color-border); }
.nav-link {
  color: var(--color-muted) !important;
  padding: .6rem 1.2rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  transition: color .15s, background .15s;
}
.nav-link:hover, .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.06);
}
.nav-link.active { border-left: 3px solid var(--color-green); padding-left: calc(1.2rem - 3px); }

/* ---- Cards ------------------------------------------------- */
.card {
  background: var(--color-card) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 12px;
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--color-border) !important;
  padding: .8rem 1.2rem;
}

/* ---- Stat cards ------------------------------------------- */
.stat-card { cursor: default; transition: transform .2s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { font-size: 1.4rem; margin-bottom: .4rem; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--color-muted); font-size: .75rem; text-transform: uppercase; margin-top: .3rem; }

/* ---- Tables ----------------------------------------------- */
.table-dark { --bs-table-bg: transparent; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---- Badges ----------------------------------------------- */
.badge-playing  { background: #1db95422; color: var(--color-green); border: 1px solid #1db95455; }
.badge-paused   { background: #ffc10722; color: var(--color-yellow); border: 1px solid #ffc10755; }
.badge-closed   { background: #e5393522; color: var(--color-red); border: 1px solid #e5393555; }
.badge-online   { background: #1db95422; color: var(--color-green); border: 1px solid #1db95455; }
.badge-offline  { background: #33333355; color: var(--color-muted); border: 1px solid #44444455; }

/* ---- Online dot indicator --------------------------------- */
.online-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 6px var(--color-green);
  animation: blink 2s infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .3; }
}

/* ---- Now playing card ------------------------------------- */
.now-playing-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #1e1e1e 100%) !important;
  border: 1px solid #1db95433 !important;
}

/* ---- Round control buttons -------------------------------- */
.round-btn {
  width: 40px; height: 40px;
  border-radius: 50% !important;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Battery bar ------------------------------------------ */
.battery-bar {
  display: inline-block;
  width: 36px; height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
  position: relative;
  vertical-align: middle;
}
.battery-bar::after {
  content: '';
  position: absolute;
  right: -5px; top: 3px;
  width: 3px; height: 6px;
  background: currentColor;
  border-radius: 0 2px 2px 0;
}
.battery-fill {
  position: absolute;
  left: 1px; top: 1px; bottom: 1px;
  border-radius: 1px;
  background: currentColor;
}

/* ---- Alert type colors ------------------------------------ */
.alert-row-offline        { border-left: 3px solid var(--color-muted) !important; }
.alert-row-spotify_closed { border-left: 3px solid var(--color-red) !important; }
.alert-row-spotify_paused { border-left: 3px solid var(--color-yellow) !important; }
.alert-row-battery_low    { border-left: 3px solid #ff7043 !important; }
.alert-row-connection_lost{ border-left: 3px solid var(--color-red) !important; }

/* ---- Scrollbar -------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}
