/* ═══════════════════════════════════════════════════════════════
   main.css — Design System & Layout
   AdminPanel — HelloMindspace
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-base:       #080810;
  --bg-surface:    #0e0e1a;
  --bg-elevated:   #13131f;
  --bg-overlay:    #1a1a28;

  /* Sidebar */
  --sidebar-bg:    #0a0a16;
  --sidebar-w:     240px;

  /* Accent palette */
  --accent:        #6366f1;
  --accent-hover:  #5254cc;
  --accent-glow:   rgba(99, 102, 241, 0.25);
  --accent-subtle: rgba(99, 102, 241, 0.10);

  /* Semantic colors */
  --success:       #10b981;
  --success-bg:    rgba(16, 185, 129, 0.10);
  --success-border:rgba(16, 185, 129, 0.25);

  --warning:       #f59e0b;
  --warning-bg:    rgba(245, 158, 11, 0.10);
  --warning-border:rgba(245, 158, 11, 0.25);

  --danger:        #ef4444;
  --danger-bg:     rgba(239, 68, 68, 0.10);
  --danger-border: rgba(239, 68, 68, 0.25);

  --info:          #3b82f6;
  --info-bg:       rgba(59, 130, 246, 0.10);
  --info-border:   rgba(59, 130, 246, 0.25);

  /* Text */
  --text-primary:  #e2e8f0;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --text-inverse:  #0e0e1a;

  /* Borders */
  --border:        rgba(255, 255, 255, 0.07);
  --border-hover:  rgba(255, 255, 255, 0.14);
  --border-accent: rgba(99, 102, 241, 0.40);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 30px rgba(99,102,241,0.15);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --transition: 0.18s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { height: 100%; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ─────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 40%,
    var(--accent) 60%,
    transparent 100%);
  opacity: 0.15;
}

/* Logo / brand */
.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--accent-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  user-select: none;
  margin-bottom: 2px;
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--warning);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer-info {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 5px;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Main Content ──────────────────────────────────────────── */
#main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-base);
  position: relative;
}

/* Subtle grid background */
#main-content::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeUp 0.25s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Toast notifications ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  animation: slideInRight 0.25s ease;
  backdrop-filter: blur(12px);
}

.toast.success { border-color: var(--success-border); color: var(--success); }
.toast.error   { border-color: var(--danger-border);  color: var(--danger);  }
.toast.warning { border-color: var(--warning-border); color: var(--warning); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }

.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning); }
.text-danger   { color: var(--danger); }
.text-accent   { color: var(--accent); }

.font-mono {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}
