/* ==============================================================
 * admin-dashboard.css — Obsidian Aurora
 * Stats Grid, Section Headers, Live Monitor, Gateway Cards
 * ============================================================== */

/* ─── Main Content Area ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 28px 32px 60px;
  min-height: calc(100vh - var(--topbar-height));
  flex: 1;
  min-width: 0;
  animation: fadeIn 0.35s ease both;
}

/* ─── Section Header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.section-subtitle {
  font-size: 13.5px;
  color: var(--text-4);
  font-weight: 400;
  margin-top: 4px;
  line-height: 1.5;
}

/* ─── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  /* Left accent bar */
  border-left: 3px solid rgba(129,140,248,0.40);
}

/* Hover: subtle lift + glow */
.stat-card:hover {
  border-color: rgba(129,140,248,0.15);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.35), 0 0 40px rgba(129,140,248,0.06);
}

/* Ambient corner glow */
.stat-card::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Color variants — accent bar + corner glow */
.stat-card.green  { border-left-color: rgba(52,211,153,0.55); }
.stat-card.green::after  { background: radial-gradient(circle, rgba(52,211,153,0.06) 0%, transparent 70%); }
.stat-card.blue   { border-left-color: rgba(56,189,248,0.55); }
.stat-card.blue::after   { background: radial-gradient(circle, rgba(56,189,248,0.06) 0%, transparent 70%); }
.stat-card.purple { border-left-color: rgba(139,92,246,0.55); }
.stat-card.purple::after { background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%); }
.stat-card.amber  { border-left-color: rgba(251,191,36,0.55); }
.stat-card.amber::after  { background: radial-gradient(circle, rgba(251,191,36,0.05) 0%, transparent 70%); }

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-4);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* ─── Live Monitor Card ──────────────────────────────────────── */
.live-monitor-card {
  background: var(--card);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
/* Subtle top-line gradient */
.live-monitor-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--sky), var(--mint));
  opacity: 0.5;
}

.live-monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.live-monitor-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-monitor-subtitle {
  font-size: 12px;
  color: var(--text-5);
}

.ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}
.ws-badge.connected {
  background: var(--mint-light);
  color: var(--mint-text);
  border: 1px solid rgba(52,211,153,0.12);
}
.ws-badge.disconnected {
  background: var(--rose-light);
  color: var(--rose-text);
  border: 1px solid rgba(251,113,133,0.12);
}
.ws-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseGlow 2s ease-in-out infinite;
}

/* RPM Monitor items */
#liveRpmContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.rpm-item {
  padding: 14px 18px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.rpm-item:hover { background: rgba(255,255,255,0.03); border-color: var(--border); }
.rpm-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 4px;
}
.rpm-item-info {
  font-size: 12px;
  color: var(--text-4);
  line-height: 1.6;
}

/* Live API Stream card */
.live-stream-card {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.live-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.live-stream-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
#liveEventCount {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-4);
}
#liveLogContainer {
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-4);
  line-height: 1.8;
}
.log-entry {
  padding: 3px 0;
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeIn 0.2s ease;
}

/* ─── Gateway / Config Cards ─────────────────────────────────── */
.gw-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.gw-card {
  background: var(--card);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.gw-card:hover {
  border-color: rgba(129,140,248,0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.30);
}
.gw-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.gw-card-subtitle {
  font-size: 12px;
  color: var(--text-5);
  margin-bottom: 14px;
}
.gw-card-body { font-size: 13px; color: var(--text-3); }
.gw-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.gw-card-row:last-child { border-bottom: none; }
.gw-card-label { font-weight: 500; color: var(--text-4); }
.gw-card-value { font-weight: 600; color: var(--text-2); font-family: var(--mono); font-size: 12.5px; }
