/* Deep Space Dark + Glass Theme */
/* CSS Custom Properties for consistent theming */
:root {
  /* Primary Colors */
  --accent-primary: #7c5cff;
  --accent-primary-hover: #6b4dff;
  --accent-primary-active: #5a3eff;
  --accent-primary-light: rgba(124, 92, 255, 0.1);
  --accent-primary-medium: rgba(124, 92, 255, 0.2);
  
  /* Neutral Colors */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  
  /* Deep Space Theme Colors */
  --bg-primary: #030308;
  --bg-secondary: #05060c;
  --bg-tertiary: #080a12;
  --bg-glass: rgba(8, 10, 18, 0.8);
  --bg-glass-light: rgba(12, 15, 25, 0.7);
  --bg-glass-hover: rgba(20, 25, 35, 0.9);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-tertiary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #030308;
  
  /* Border Colors */
  --border-primary: rgba(124, 92, 255, 0.4);
  --border-secondary: rgba(255, 255, 255, 0.08);
  --border-tertiary: rgba(255, 255, 255, 0.03);
  
  /* Status Colors - Dark Mode Optimized */
  --status-success: #22c55e;
  --status-success-bg: rgba(34, 197, 94, 0.1);
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.1);
  --status-error: #ef4444;
  --status-error-bg: rgba(239, 68, 68, 0.1);
  --status-info: #3b82f6;
  --status-info-bg: rgba(59, 130, 246, 0.1);
  
  /* Glass Effects */
  --glass-blur: 12px;
  --glass-saturate: 180%;
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
  
  /* Spacing & Sizing */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #030308;
  background-image:
    /* Distant nebula effects */
    radial-gradient(ellipse at 10% 90%, rgba(124, 92, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 90% 10%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(168, 85, 247, 0.04) 0%, transparent 40%),
    /* Deep space gradient */
    linear-gradient(135deg, #030308 0%, #05060c 40%, #080a12 100%);
  min-height: 100vh;
  color: #ffffff;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Animated starfield background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image:
    /* Large distant stars */
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(124, 92, 255, 0.4), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(59, 130, 246, 0.3), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.2), transparent),
    /* Medium stars */
    radial-gradient(1px 1px at 10px 10px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 60px 60px, rgba(168, 85, 247, 0.3), transparent),
    radial-gradient(1px 1px at 110px 10px, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 170px 60px, rgba(124, 92, 255, 0.2), transparent),
    /* Small stars */
    radial-gradient(0.5px 0.5px at 25px 45px, rgba(255,255,255,0.5), transparent),
    radial-gradient(0.5px 0.5px at 75px 25px, rgba(255,255,255,0.4), transparent),
    radial-gradient(0.5px 0.5px at 125px 45px, rgba(255,255,255,0.3), transparent),
    radial-gradient(0.5px 0.5px at 175px 25px, rgba(255,255,255,0.4), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: twinkle 20s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Subtle cosmic dust effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.015) 1px, transparent 0);
  background-size: 30px 30px;
  opacity: 0.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 70%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow:
    0 0 20px rgba(124, 92, 255, 0.6),
    0 0 40px rgba(124, 92, 255, 0.3),
    0 0 60px rgba(124, 92, 255, 0.1);
  position: relative;
}

header h1::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(124, 92, 255, 0.1) 0%, transparent 70%);
  z-index: -1;
  border-radius: 50%;
  filter: blur(20px);
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  opacity: 0.9;
}

/* Glass Sections */
section {
  background: rgba(8, 10, 18, 0.8);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 20px rgba(124, 92, 255, 0.05);
  transition: all 250ms ease;
  position: relative;
}

/* Subtle inner glow effect */
section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(124, 92, 255, 0.2) 0%,
    transparent 30%,
    transparent 70%,
    rgba(124, 92, 255, 0.1) 100%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  pointer-events: none;
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(12px)) {
  section {
    background: rgba(8, 10, 18, 0.95);
  }
}

section:hover {
  background: var(--bg-glass-hover);
  box-shadow:
    var(--glass-shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 30px rgba(124, 92, 255, 0.1);
  transform: translateY(-2px);
}

section:hover::before {
  background: linear-gradient(135deg,
    rgba(124, 92, 255, 0.3) 0%,
    transparent 30%,
    transparent 70%,
    rgba(124, 92, 255, 0.2) 100%);
}

section h3 {
  margin-bottom: 16px;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Prompt Section */
.prompt-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prompt-wrapper {
  position: relative;
}

#promptInput {
  width: 100%;
  padding: 16px;
  padding-bottom: 40px; /* Extra space for task detection */
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #ffffff;
  font-size: 16px;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  transition: all 250ms ease;
}

#promptInput::placeholder {
  color: #94a3b8;
}

#promptInput:focus {
  outline: none;
  border-color: #7c5cff;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
  background: rgba(20, 25, 35, 0.9);
}

.task-detection {
  position: absolute;
  bottom: 8px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
  pointer-events: none;
}

#taskName {
  font-weight: 500;
  transition: color 150ms ease;
}

/* Task type colors for minimal display */
.task-detection.image_simple #taskName {
  color: #fbbf24;
}

.task-detection.video_simple #taskName {
  color: #4ade80;
}

.task-detection.complex_agent #taskName {
  color: #e2e8f0;
}

.task-detection.text_simple #taskName {
  color: #60a5fa;
}

/* Fallback indicator - red color when rule-based classification is used */
.task-detection.fallback #taskName {
  color: var(--status-error);
}

.debug-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  transition: all 150ms ease;
  padding: 4px;
  border-radius: 6px;
  pointer-events: auto !important;
  opacity: 0.6;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  position: relative;
}

.debug-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.debug-btn:hover {
  color: #3b82f6;
  opacity: 1;
  transform: scale(1.1);
}

.debug-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  opacity: 1;
}

.override-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #cbd5e1;
  transition: all 150ms ease;
  padding: 4px;
  border-radius: 6px;
  pointer-events: auto !important;
  opacity: 0.7;
  z-index: 10;
  position: relative;
}

.override-btn:hover {
  color: #7c5cff;
  opacity: 1;
  transform: scale(1.1);
}

.override-btn:focus {
  outline: 2px solid #7c5cff;
  outline-offset: 2px;
  opacity: 1;
}

.task-select {
  padding: 8px 32px 8px 12px;
  background: #05060c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  transition: all 150ms ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

.task-select:focus {
  outline: none;
  border-color: #7c5cff;
  background: #080a12;
}

.task-select:hover {
  background: #080a12;
  border-color: rgba(124, 92, 255, 0.4);
}

/* Configuration Section */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.config-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-item label {
  font-weight: 500;
  color: #e2e8f0;
  font-size: 14px;
}

.config-item input,
.config-item textarea {
  padding: 12px;
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  transition: all 250ms ease;
}

.config-item input::placeholder,
.config-item textarea::placeholder {
  color: #94a3b8;
}

.config-item input:focus,
.config-item textarea:focus {
  outline: none;
  border-color: #7c5cff;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
  background: rgba(20, 25, 35, 0.9);
}

/* Model Selection */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.model-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-item label {
  font-weight: 500;
  color: #e2e8f0;
  font-size: 14px;
}

.model-item select {
  padding: 10px 32px 10px 10px;
  background: #05060c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  transition: all 150ms ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

.model-item select:focus {
  outline: none;
  border-color: #7c5cff;
  background: #080a12;
}

.model-item select:hover {
  background: #080a12;
  border-color: rgba(124, 92, 255, 0.4);
}
/* Tiler Preview Section */
.tiler-section {
  margin-bottom: 24px;
}

.tiler-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tiler-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tiler-input-group label {
  font-weight: 500;
  color: #e2e8f0;
  font-size: 14px;
}

.tiler-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.tiler-input-group input {
  flex: 1;
  padding: 12px;
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  transition: all 250ms ease;
}

.tiler-input-group input::placeholder {
  color: #94a3b8;
}

.tiler-input-group input:focus {
  outline: none;
  border-color: #7c5cff;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
  background: rgba(20, 25, 35, 0.9);
}

.tiler-play-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #7c5cff;
  cursor: pointer;
  transition: all 250ms ease;
}

.tiler-play-btn:hover {
  background: rgba(20, 25, 35, 0.9);
  border-color: rgba(124, 92, 255, 0.4);
  color: #6b4dff;
  transform: scale(1.05);
}

.tiler-play-btn:active {
  transform: scale(0.95);
}

.tiler-play-btn.active {
  background: rgba(124, 92, 255, 0.2);
  border-color: #7c5cff;
  color: #7c5cff;
}

.tiler-play-btn svg {
  width: 20px;
  height: 20px;
}

.tiler-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(12, 15, 25, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  min-height: 200px;
}

.tiler-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform 250ms ease;
}

.tiler-preview img:hover {
  transform: scale(1.02);
}


/* Launch Section */
.capacity-info {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.capacity-item {
  text-align: center;
}

.capacity-item .label {
  display: block;
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 4px;
  font-weight: 500;
}

.capacity-item .value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
}

/* Variant Override Controls */
.variant-override-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.variant-toggle {
  font-size: 11px;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.variant-toggle .toggle-slider {
  width: 48px;
  height: 22px;
  background: rgba(8, 10, 18, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.variant-toggle .toggle-slider::before {
  width: 18px;
  height: 18px;
  top: 2px;
  left: 2px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.2);
}

.variant-toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #7c5cff 0%, #6b4dff 100%);
  border-color: #7c5cff;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.2),
    0 0 15px rgba(124, 92, 255, 0.4);
}

.variant-toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

.variant-input {
  width: 70px;
  padding: 6px 8px;
  background: rgba(8, 10, 18, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all 200ms ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.variant-input:focus {
  outline: none;
  border-color: #7c5cff;
  background: rgba(12, 15, 25, 0.9);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(124, 92, 255, 0.2);
}

.variant-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(8, 10, 18, 0.5);
}

.launch-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.mpi-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
  color: #e2e8f0;
  transition: color 150ms ease;
}

.toggle-label:hover {
  color: #ffffff;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  width: 50px;
  height: 24px;
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  position: relative;
  transition: all 250ms ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 250ms ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-slider {
  background: #7c5cff;
  border-color: #7c5cff;
}

.toggle-label input:checked + .toggle-slider::before {
  transform: translateX(26px);
  background: white;
}

.toggle-label input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
  color: white;
  box-shadow:
    0 4px 12px rgba(124, 92, 255, 0.4),
    0 0 20px rgba(124, 92, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover:not(:disabled)::before {
  left: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-primary-hover) 0%, var(--accent-primary-active) 100%);
  transform: translateY(-2px);
  box-shadow:
    0 8px 20px rgba(124, 92, 255, 0.5),
    0 0 30px rgba(124, 92, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-primary-active) 0%, var(--accent-primary) 100%);
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(124, 92, 255, 0.05) 0%,
    transparent 50%,
    rgba(124, 92, 255, 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(20, 25, 35, 0.9);
  border-color: rgba(124, 92, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.1);
}

.btn-secondary:hover:not(:disabled)::before {
  opacity: 1;
}

/* Tables */
.nodes-table-container,
.status-table-container {
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(8, 10, 18, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nodes-table,
.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.nodes-table th,
.nodes-table td,
.status-table th,
.status-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-tertiary);
}

.nodes-table th,
.status-table th {
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 600;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nodes-table tbody tr,
.status-table tbody tr {
  transition: background-color var(--transition-fast);
}

.nodes-table tbody tr:hover,
.status-table tbody tr:hover {
  background: rgba(12, 15, 25, 0.7);
}

.nodes-table tbody tr:nth-child(even),
.status-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Status indicators */
.status-healthy {
  color: var(--status-success);
  font-weight: 600;
}

.status-unhealthy {
  color: var(--status-error);
  font-weight: 600;
}

.status-pending {
  color: var(--status-warning);
  font-weight: 500;
}

.status-inflight {
  color: var(--status-info);
  font-weight: 500;
}

.status-success {
  color: var(--status-success);
  font-weight: 500;
}

.status-failed {
  color: var(--status-error);
  font-weight: 500;
}

.status-deleted {
  color: var(--text-muted);
  font-style: italic;
}

/* Status Summary */
.status-summary {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.status-summary .status-item {
  text-align: center;
}

.status-summary .label {
  display: block;
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 4px;
  font-weight: 500;
}

.status-summary .value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

/* Delete buttons */
.btn-delete {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 150ms ease;
  color: #ef4444;
  font-weight: 500;
}

.btn-delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--status-error);
  transform: translateY(-1px);
}

.btn-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Message Container */
.message-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.message {
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  background: rgba(8, 10, 18, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.message-info {
  border-left: 4px solid #3b82f6;
  color: #3b82f6;
}

.message-error {
  border-left: 4px solid #ef4444;
  color: #ef4444;
}

.message-success {
  border-left: 4px solid #22c55e;
  color: #22c55e;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-muted {
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .config-grid {
    grid-template-columns: 1fr;
  }
  
  .model-grid {
    grid-template-columns: 1fr;
  }
  
  .capacity-info {
    flex-direction: column;
    gap: 16px;
  }
  
  .launch-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .status-summary {
    flex-direction: column;
    gap: 12px;
  }
  
  section {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  /* Stack variant controls on mobile */
  .variant-controls {
    flex-direction: column;
    align-items: center;
  }
  
  /* Reduce glass effects on mobile for better performance */
  section,
  .nodes-table-container,
  .status-table-container {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-secondary: rgba(255, 255, 255, 0.3);
    --border-tertiary: rgba(255, 255, 255, 0.2);
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e1;
  }
}

/* Focus visible for better keyboard navigation */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Clear Storage Button */
.clear-storage-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 8px 16px;
  background: rgba(12, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 250ms ease;
  z-index: 100;
  opacity: 0.7;
}

.clear-storage-btn:hover {
  background: rgba(20, 25, 35, 0.9);
  border-color: #ef4444;
  color: #ef4444;
  opacity: 1;
  transform: translateY(-1px);
}

.clear-storage-btn:focus {
  outline: 2px solid #7c5cff;
  outline-offset: 2px;
  opacity: 1;
}

/* Force dark theme regardless of system preference */
html {
  color-scheme: dark;
}

/* Ensure all text elements use proper dark theme colors */
* {
  color: inherit;
}

/* Override any browser default styling that might interfere */
input, textarea, select, button {
  color: inherit;
}