/* ========================================================= */
/* DELTA BOT HUB — Design System "Neon Kineticism"           */
/* ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Manrope:wght@200;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─── CSS Variables ────────────────────────────────────── */
:root {
  /* Surface Hierarchy */
  --surface-dim:              #16081f;
  --surface:                  #16081f;
  --surface-container-lowest: #000000;
  --surface-container-low:    #1d0c26;
  --surface-container:        #24122e;
  --surface-container-high:   #2b1736;
  --surface-container-highest:#321d3f;
  --surface-bright:           #3a2347;
  --surface-variant:          #321d3f;

  /* Primary: Neon Pink */
  --primary:           #ff8aa3;
  --primary-container: #ff7293;
  --primary-fixed:     #ff7293;
  --primary-fixed-dim: #ff5484;
  --primary-dim:       #e50062;
  --on-primary:        #630026;
  --on-primary-container: #4d001c;
  --on-primary-fixed:  #000000;
  --inverse-primary:   #bd0050;

  /* Secondary: Electric Cyan */
  --secondary:           #00f4fe;
  --secondary-container: #00696e;
  --secondary-fixed:     #00f4fe;
  --secondary-fixed-dim: #00e5ee;
  --secondary-dim:       #00e5ee;
  --on-secondary:        #00575b;
  --on-secondary-container: #dffdff;

  /* Tertiary: Electric Purple */
  --tertiary:           #c57eff;
  --tertiary-container: #bb6bfb;
  --tertiary-fixed:     #d299ff;
  --tertiary-fixed-dim: #c986ff;
  --tertiary-dim:       #c57eff;
  --on-tertiary:        #340058;
  --on-tertiary-container: #1c0032;

  /* Error */
  --error:           #ff6e84;
  --error-container: #a70138;
  --error-dim:       #d73357;
  --on-error:        #490013;
  --on-error-container: #ffb2b9;

  /* Text */
  --on-surface:         #f6ddfe;
  --on-surface-variant: #baa3c2;
  --on-background:      #f6ddfe;
  --outline:            #826e8b;
  --outline-variant:    #53415c;

  /* Typography */
  --font-headline: 'Space Grotesk', sans-serif;
  --font-body:     'Manrope', sans-serif;
  --font-label:    'Plus Jakarta Sans', sans-serif;

  /* Transitions */
  --transition-snappy: 200ms ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--surface-dim);
  color: var(--on-surface);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--secondary);
  color: var(--surface);
}

/* ─── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-variant); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ─── Background Textures ──────────────────────────────── */
.halftone-overlay {
  background-image: radial-gradient(rgba(197, 126, 255, 0.05) 1px, transparent 1px);
  background-size: 8px 8px;
}

.speed-lines {
  background: repeating-linear-gradient(
    90deg,
    transparent, transparent 10px,
    rgba(255, 138, 163, 0.03) 10px,
    rgba(255, 138, 163, 0.03) 12px
  );
}

.speed-lines-cyan {
  background: repeating-linear-gradient(
    90deg,
    transparent, transparent 10px,
    rgba(0, 244, 254, 0.03) 10px,
    rgba(0, 244, 254, 0.03) 12px
  );
}

.speed-line-diag {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent, transparent 10px,
    rgba(255, 114, 147, 0.05) 10px,
    rgba(255, 114, 147, 0.05) 12px
  );
}

/* ─── Ambient Glows ────────────────────────────────────── */
.ambient-glow-purple {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -2;
}
.ambient-glow-purple::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 70vw; height: 70vw;
  border-radius: 50%;
  background: var(--tertiary);
  opacity: 0.08;
  filter: blur(120px);
  mix-blend-mode: screen;
}
.ambient-glow-purple::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 60vw; height: 60vw;
  border-radius: 50%;
  background: var(--secondary);
  opacity: 0.08;
  filter: blur(100px);
  mix-blend-mode: screen;
}

/* ─── Typography ───────────────────────────────────────── */
.font-headline { font-family: var(--font-headline); }
.font-body     { font-family: var(--font-body); }
.font-label    { font-family: var(--font-label); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-headline); }

/* ─── Navigation ───────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(22, 8, 31, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(123, 44, 191, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.top-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.nav-brand {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.05em;
  color: #7B2CBF;
  text-decoration: none;
  text-shadow: 0 0 20px rgba(123, 44, 191, 0.6);
  transition: text-shadow var(--transition-snappy);
}
.nav-brand:hover { text-shadow: 0 0 30px rgba(123, 44, 191, 0.9); }

.nav-links { display: flex; gap: 1.5rem; align-items: center; }

.nav-link {
  font-family: var(--font-headline);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: rgba(186, 163, 194, 0.7);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all var(--transition-snappy);
}
.nav-link:hover { color: var(--secondary); background: rgba(123, 44, 191, 0.15); }
.nav-link.active { color: var(--secondary); border-bottom: 2px solid var(--secondary); }

/* ─── Sidebar ──────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 18rem;
  height: 100vh;
  background: rgba(49, 15, 75, 0.4);
  backdrop-filter: blur(24px);
  border-right: 1px solid rgba(123, 44, 191, 0.1);
  box-shadow: 0 0 25px rgba(0, 244, 254, 0.05);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 5rem 0.5rem 1.5rem;
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(186, 163, 194, 0.5);
  transition: box-shadow var(--transition-snappy);
}
.sidebar:hover { box-shadow: 0 0 40px rgba(0, 244, 254, 0.1); }

.sidebar-header { padding: 0 1.5rem 2rem; display: flex; flex-direction: column; align-items: center; }

.sidebar-avatar {
  width: 4rem; height: 4rem;
  border-radius: 0.25rem;
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  box-shadow: 0 0 32px rgba(0, 244, 254, 0.1);
}

.sidebar-avatar-notch {
  position: absolute;
  top: -4px; right: -4px;
  width: 12px; height: 12px;
  background: var(--secondary-container);
  border: 1px solid var(--secondary);
  box-shadow: 0 0 10px rgba(0, 244, 254, 0.5);
  transform: rotate(45deg);
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.125rem; }

.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  color: rgba(186, 163, 194, 0.5);
  text-decoration: none;
  transition: all var(--transition-snappy);
  position: relative;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  transform: translateX(4px);
}
.sidebar-link.active {
  background: linear-gradient(to right, rgba(123, 44, 191, 0.2), rgba(0, 244, 254, 0.1));
  color: var(--secondary);
  border-left: 4px solid var(--secondary);
}

.sidebar-footer { padding: 1rem; margin-top: auto; border-top: 1px solid rgba(123, 44, 191, 0.1); }

/* ─── Buttons ──────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--on-primary-container);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-snappy);
  box-shadow: 0 0 20px rgba(255, 138, 163, 0.2);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(255, 138, 163, 0.4); transform: scale(1.01); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: transparent;
  color: var(--secondary);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 244, 254, 0.3);
  cursor: pointer;
  transition: all var(--transition-snappy);
}
.btn-secondary:hover {
  border-color: var(--secondary);
  box-shadow: 0 0 15px rgba(0, 244, 254, 0.2);
}

/* ─── Cards / Modules ──────────────────────────────────── */
.card {
  background: rgba(29, 12, 38, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(83, 65, 92, 0.15);
  border-radius: 0.5rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-snappy);
}
.card:hover { border-color: rgba(83, 65, 92, 0.4); }

.card-glass {
  background: rgba(36, 18, 46, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(83, 65, 92, 0.3);
  border-radius: 0.5rem;
}

.card-accent-left { border-left: 2px solid var(--tertiary); }
.card-accent-top  { border-top: 2px solid var(--secondary); }

/* Speed-line accent inside card */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(rgba(197, 126, 255, 0.05) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0;
  transition: opacity var(--transition-snappy);
}
.card:hover::after { opacity: 0.5; }

/* ─── Kinetic Badge ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.625rem;
  border-radius: 0.125rem;
}
.badge-secondary {
  background: rgba(0, 105, 110, 0.3);
  color: var(--secondary);
  border: 1px solid rgba(0, 244, 254, 0.2);
}
.badge-error {
  background: rgba(167, 1, 56, 0.2);
  color: var(--error-dim);
  border: 1px solid rgba(215, 51, 87, 0.2);
}
.badge-tertiary {
  background: rgba(53, 0, 88, 0.3);
  color: var(--tertiary);
  border: 1px solid rgba(197, 126, 255, 0.2);
}

/* ─── Inputs ───────────────────────────────────────────── */
.input-field {
  width: 100%;
  background: var(--surface-container-highest);
  border: 1px solid rgba(83, 65, 92, 0.5);
  border-radius: 0.25rem;
  padding: 0.875rem 1rem;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition-snappy);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.input-field:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 1px rgba(0, 244, 254, 0.5), inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.input-field::placeholder { color: var(--outline); }

.input-label {
  display: block;
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  margin-bottom: 0.5rem;
  transition: color var(--transition-snappy);
}
.input-group:focus-within .input-label { color: var(--secondary); }

/* ─── Progress Bar ─────────────────────────────────────── */
.progress-bar-track {
  height: 6px;
  background: var(--surface-container-lowest);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-container), var(--secondary));
  border-radius: 999px;
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 16px;
  background: rgba(255, 255, 255, 0.4);
  filter: blur(2px);
}

/* ─── Toggle Switch ────────────────────────────────────── */
.toggle {
  position: relative;
  width: 3rem; height: 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-snappy);
}
.toggle-off {
  background: var(--surface-container-highest);
  border: 1px solid var(--outline-variant);
}
.toggle-on {
  background: rgba(255, 138, 163, 0.2);
  border: 1px solid var(--primary);
  box-shadow: 0 0 10px rgba(255, 138, 163, 0.2);
}
.toggle-knob {
  position: absolute;
  top: 4px;
  width: 1rem; height: 1rem;
  border-radius: 50%;
  transition: all var(--transition-snappy);
}
.toggle-knob-off { left: 4px; background: var(--outline); }
.toggle-knob-on  { right: 4px; background: var(--primary); }

/* ─── Status Dot ───────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.status-online  { background: var(--secondary); box-shadow: 0 0 8px rgba(0, 244, 254, 0.8); animation: pulse-cyan 2s infinite; }
.status-offline { background: var(--error); box-shadow: 0 0 8px rgba(255, 110, 132, 0.8); animation: pulse-red 2s infinite; }
.status-warning { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.8); }

@keyframes pulse-cyan {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 244, 254, 0.8); }
  50%       { box-shadow: 0 0 16px rgba(0, 244, 254, 1); }
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 110, 132, 0.8); }
  50%       { box-shadow: 0 0 16px rgba(255, 110, 132, 1); }
}

/* ─── Log Entry ────────────────────────────────────────── */
.log-entry {
  display: flex; gap: 1rem;
  padding: 0.25rem;
  border-radius: 0.125rem;
  font-family: var(--font-label);
  font-size: 0.7rem;
  transition: background var(--transition-snappy);
}
.log-entry:hover { background: rgba(50, 29, 63, 0.5); }
.log-entry.log-error { background: rgba(167, 1, 56, 0.1); border-left: 2px solid var(--error); }

.log-ts    { color: var(--secondary-dim); width: 5rem; flex-shrink: 0; }
.log-type  { width: 4.5rem; flex-shrink: 0; }
.log-type-sys  { color: var(--tertiary); }
.log-type-net  { color: var(--secondary); }
.log-type-warn { color: var(--error); }
.log-msg   { color: var(--on-surface); }

/* ─── Stat Cards ───────────────────────────────────────── */
.stat-card {
  background: rgba(29, 12, 38, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(83, 65, 92, 0.15);
  border-radius: 0.5rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-snappy);
}
.stat-card-left-bar {
  position: absolute;
  left: 0; top: 0;
  width: 4px; height: 0;
  transition: height 0.4s ease;
}
.stat-card:hover .stat-card-left-bar { height: 100%; }

.stat-value {
  font-family: var(--font-headline);
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(to bottom, white, var(--primary-container));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Ghost Border ─────────────────────────────────────── */
.ghost-border::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--outline-variant);
  opacity: 0.15;
  border-radius: inherit;
  pointer-events: none;
}

/* ─── Section decorators ───────────────────────────────── */
.section-accent-bar {
  position: absolute;
  left: -1rem; top: 0;
  width: 4px; height: 100%;
  background: var(--secondary);
  box-shadow: 0 0 15px var(--secondary);
}

/* ─── Bento Grid ───────────────────────────────────────── */
.bento { display: grid; gap: 1.5rem; }
.bento-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.bento-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ─── Utility ──────────────────────────────────────────── */
.text-gradient-pr {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-ps {
  background: linear-gradient(90deg, var(--secondary), var(--tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-primary   { box-shadow: 0 0 32px rgba(255, 138, 163, 0.3); }
.glow-secondary { box-shadow: 0 0 32px rgba(0, 244, 254, 0.3); }
.glow-tertiary  { box-shadow: 0 0 32px rgba(197, 126, 255, 0.3); }

/* ─── Animations ───────────────────────────────────────── */
@keyframes blinker { 50% { opacity: 0; } }
.cursor-blink { animation: blinker 1s linear infinite; }

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.animate-slide-in { animation: slideInLeft 0.3s ease forwards; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeInUp 0.4s ease forwards; }

/* ─── Mobile ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-with-sidebar { margin-left: 0 !important; }
  .nav-links .hide-mobile { display: none; }
}
