/* ═══════════════════════════════════════════════════════════════════
   VELLUNOX DASHBOARD - Neural Command Center Theme
   Living breathing AI ecosystem - Neural-style interface
   ═══════════════════════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Neural Colors */
  --primary: #3b82f6;
  --secondary: #3b82f6;
  --accent: #f43f5e;
  --positive: #22c55e;
  --negative: #ef4444;
  --warning: #f59e0b;
  
  /* Backgrounds */
  --bg-void: #030308;
  --bg-deep: #0a0a12;
  --bg-surface: #12121f;
  --bg-card: #1a1a2e;
  --bg-hover: #252540;
  
  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.7);
  
  /* Effects */
  --border: rgba(59, 130, 246, 0.12);
  --glow: rgba(59, 130, 246, 0.4);
  --glass: rgba(255, 255, 255, 0.03);
  
  /* Gradients */
  --gradient-neural: linear-gradient(135deg, var(--primary), var(--secondary));
  --gradient-card: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-surface) 100%);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ═══ Neural Background ═══ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 15% 15%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 85%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
  z-index: -1;
  animation: neural-pulse 10s ease-in-out infinite;
}

@keyframes neural-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Grid Pattern */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

.dashboard-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -280px;
    transition: left 0.3s ease;
    z-index: 1000;
  }
  .sidebar.open {
    left: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════ */

.sidebar {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-void) 100%);
  border-right: 1px solid var(--border);
  padding: 24px;
  position: fixed;
  width: 260px;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
  text-decoration: none;
}

.logo img {
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 0 10px var(--glow));
  animation: logo-glow 3s ease-in-out infinite;
}

@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 10px var(--glow)); }
  50% { filter: drop-shadow(0 0 20px var(--glow)); }
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-neural);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 30px;
  padding-left: 52px;
}

/* Brain Status Indicator */
.brain-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.brain-status::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 10px var(--positive);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--positive); }
  50% { opacity: 0.6; box-shadow: 0 0 20px var(--positive); }
}

/* Navigation */
.nav-section {
  margin-bottom: 24px;
}

.nav-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  padding-left: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-neural);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

.nav-item:hover {
  background: var(--glass);
  color: var(--text-primary);
}

.nav-item:hover::before {
  transform: scaleY(1);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-item img {
  width: 24px;
  height: 24px;
  opacity: 0.8;
}

.nav-item span {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════ */

.main-content {
  margin-left: 260px;
  padding: 24px 32px;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
}

/* Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.header-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.header-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════ */

.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
  animation: synapse-flow 4s linear infinite;
}

@keyframes synapse-flow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(59, 130, 246, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-neural);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
}

.card-change.positive {
  color: var(--positive);
  background: rgba(34, 197, 94, 0.15);
}

.card-change.negative {
  color: var(--negative);
  background: rgba(239, 68, 68, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════
   GRIDS
   ═══════════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   AI TEAM AVATARS
   ═══════════════════════════════════════════════════════════════════ */

.ai-team-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .ai-team-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 500px) {
  .ai-team-grid { grid-template-columns: repeat(2, 1fr); }
}

.ai-avatar-card {
  text-align: center;
  padding: 20px;
  cursor: pointer;
}

.ai-avatar-card img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 3px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              var(--gradient-neural) border-box;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
}

.ai-avatar-card:hover img {
  transform: scale(1.1);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
}

.ai-avatar-card h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.ai-avatar-card p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--positive);
  margin-top: 8px;
}

.ai-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--positive);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-neural);
  color: var(--bg-void);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════ */

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

td {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

tr:hover {
  background: var(--glass);
}

/* ═══════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

.text-gradient {
  background: var(--gradient-neural);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* Section Title */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--gradient-neural);
  border-radius: 2px;
}

/* Loading Spinner */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  margin-bottom: 10px;
  color: var(--text-secondary);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--positive);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--negative);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}
