:root {
  --font-main: 'Outfit', sans-serif;
  --bg-dark: #0f172a;
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.3);
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-main);
  color: var(--text-primary);
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

/* Glass Panel */
.glass-panel {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 280px;
  z-index: 10;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #cbd5e1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
    box-shadow: 0 0 8px #4ade80;
  }

  50% {
    opacity: 0.5;
    box-shadow: 0 0 4px #4ade80;
  }

  100% {
    opacity: 1;
    box-shadow: 0 0 8px #4ade80;
  }
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.value {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

/* AI Visualization Panel */
.ai-panel {
  top: 24px;
  right: 24px;
  left: auto;
  width: 400px;
}

.ai-panel.hidden {
  transform: translateX(450px);
  opacity: 0;
  pointer-events: none;
}

.training-indicator {
  width: 8px;
  height: 8px;
  background-color: #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 8px #6366f1;
  animation: pulse-training 1.5s infinite;
}

@keyframes pulse-training {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px #6366f1;
  }

  50% {
    opacity: 0.6;
    box-shadow: 0 0 4px #6366f1;
  }
}

.training-indicator.active {
  background-color: #f59e0b;
  box-shadow: 0 0 12px #f59e0b;
  animation: pulse-active 0.8s infinite;
}

@keyframes pulse-active {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 12px #f59e0b;
  }

  50% {
    opacity: 0.8;
    transform: scale(1.2);
    box-shadow: 0 0 16px #f59e0b;
  }
}

/* Model Info Section */
.model-info {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.info-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.neural-viz {
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
}

#neuralCanvas {
  width: 100%;
  height: 200px;
  display: block;
}

.ai-metrics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-width: 80px;
}

.metric-bar {
  flex: 1;
  height: 8px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.metric-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  position: relative;
}

.metric-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.metric-fill.memory {
  background: linear-gradient(90deg, #a78bfa, #ec4899);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

.metric-value {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 70px;
  text-align: right;
}

/* Action Buttons */
.ai-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

.action-btn {
  flex: 1;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.action-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.3));
  border-color: rgba(239, 68, 68, 0.5);
  color: #fee2e2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.action-btn:active {
  transform: translateY(0);
}

/* Toggle AI Button */
.toggle-ai-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999;
  width: 48px;
  height: 48px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.toggle-ai-btn:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.toggle-ai-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2));
  border-color: rgba(56, 189, 248, 0.4);
}

.toggle-icon {
  filter: grayscale(0.5);
  transition: filter 0.3s ease;
}

.toggle-ai-btn.active .toggle-icon {
  filter: grayscale(0);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .ai-panel {
    width: 320px;
  }

  .ai-panel.hidden {
    transform: translateX(370px);
  }

  #neuralCanvas {
    height: 160px;
  }
}

@media (max-width: 1024px) {
  .ai-panel {
    top: auto;
    bottom: 24px;
    right: 24px;
    width: 280px;
  }

  .ai-panel.hidden {
    transform: translateX(330px);
  }

  .toggle-ai-btn {
    top: auto;
    bottom: 24px;
  }
}