/* Design System Variables */
:root {
  /* Color System - HSL Values */
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
  --chart-1: 220 70% 50%;
  --chart-2: 160 60% 45%;
  --chart-3: 30 80% 55%;
  --chart-4: 280 65% 60%;
  --chart-5: 340 75% 55%;

  /* Neon Colors */
  --neon-cyan: 180 100% 50%;
  --neon-purple: 270 100% 50%;
  --neon-pink: 330 100% 50%;

  /* Gradients */
  --gradient-neon: linear-gradient(135deg, hsl(var(--neon-cyan)), hsl(var(--neon-purple)));
  --gradient-cosmic: radial-gradient(ellipse at center, hsl(240 100% 5%) 0%, hsl(240 100% 2%) 50%, hsl(240 100% 1%) 100%);

  /* Shadows */
  --shadow-neon: 0 0 30px hsl(var(--neon-cyan) / 0.5);
  --shadow-glass: 0 8px 32px hsl(0 0% 0% / 0.3);

  /* Animations */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
}

/* Utility Classes */
.cosmic-background {
  background: var(--gradient-cosmic);
  position: relative;
}

.cosmic-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, hsl(var(--neon-cyan) / 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, hsl(var(--neon-purple) / 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, hsl(var(--neon-pink) / 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.glass-panel {
  background: hsl(0 0% 100% / 0.02);
  backdrop-filter: blur(12px);
  border: 1px solid hsl(0 0% 100% / 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow-glass);
}

.bg-gradient-neon {
  background: var(--gradient-neon);
}

.bg-clip-text {
  background-clip: text;
  -webkit-background-clip: text;
}

.text-transparent {
  color: transparent;
}

.text-neon-cyan {
  color: hsl(var(--neon-cyan));
}

.text-foreground {
  color: hsl(var(--foreground));
}

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

.placeholder-muted-foreground::placeholder {
  color: hsl(var(--muted-foreground));
}

.neon-glow {
  box-shadow: var(--shadow-neon);
}

.transition-colors {
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}

.transition-transform {
  transition: transform 0.3s;
}

.transition-opacity {
  transition: opacity 0.3s;
}

/* Layout Classes */
.min-h-screen {
  min-height: 100vh;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.space-y-1 > * + * {
  margin-top: 0.25rem;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-8 > * + * {
  margin-top: 2rem;
}

/* Sizing */
.w-2 {
  width: 0.5rem;
}

.w-4 {
  width: 1rem;
}

.w-5 {
  width: 1.25rem;
}

.w-8 {
  width: 2rem;
}

.w-12 {
  width: 3rem;
}

.w-16 {
  width: 4rem;
}

.w-full {
  width: 100%;
}

.h-2 {
  height: 0.5rem;
}

.h-4 {
  height: 1rem;
}

.h-5 {
  height: 1.25rem;
}

.h-8 {
  height: 2rem;
}

.h-12 {
  height: 3rem;
}

.h-16 {
  height: 4rem;
}

.h-96 {
  height: 24rem;
}

/* Positioning */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.top-4 {
  top: 1rem;
}

.left-4 {
  left: 1rem;
}

.z-10 {
  z-index: 10;
}

/* Spacing */
.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-8 {
  padding-left: 2rem;
  padding-right: 2rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

/* Typography */
.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-4xl {
  font-size: 2.25rem;
}

.text-6xl {
  font-size: 3.75rem;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

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

.tracking-tight {
  letter-spacing: -0.025em;
}

.leading-relaxed {
  line-height: 1.625;
}

/* Layout Constraints */
.max-w-2xl {
  max-width: 42rem;
}

.max-w-4xl {
  max-width: 56rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.flex-wrap {
  flex-wrap: wrap;
}

.overflow-hidden {
  overflow: hidden;
}

/* Border Radius */
.rounded-full {
  border-radius: 50%;
}

.rounded-lg {
  border-radius: 0.5rem;
}

/* Opacity */
.opacity-0 {
  opacity: 0;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-70 {
  opacity: 0.7;
}

/* Transform */
.scale-105:hover {
  transform: scale(1.05);
}

.rotate-45 {
  transform: rotate(45deg);
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes floating {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes spinning {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes exploding {
  0% {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(var(--random-x, 200px)) translateY(var(--random-y, -200px)) scale(0.3);
    opacity: 0;
  }
}

@keyframes raining {
  0% {
    transform: translateY(-20px);
    opacity: 1;
  }
  100% {
    transform: translateY(400px);
    opacity: 0;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Playground Element Animations */
.floating-element {
  animation: floating 3s ease-in-out infinite;
}

.spinning {
  animation: spinning 2s linear infinite;
}

.exploded {
  animation: exploding 2s ease-out forwards;
}

.raining {
  animation: raining 3s linear infinite;
}

/* Physics disabled elements don't animate */
.physics-disabled {
  animation: none !important;
}

/* Form Styles */
input {
  color: #000000;
}

input:focus {
  outline: none;
  border-color: hsl(var(--neon-cyan));
}

button {
  cursor: pointer;
  border: none;
  outline: none;
}

button:disabled {
  cursor: not-allowed;
}

/* Suggested command buttons */
.command-suggestion {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  background: hsl(0 0% 100% / 0.05);
  border: 1px solid hsl(0 0% 100% / 0.1);
  border-radius: 0.5rem;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: var(--transition-smooth);
}

.command-suggestion:hover {
  background: hsl(0 0% 100% / 0.1);
  border-color: hsl(var(--neon-cyan) / 0.5);
}

.command-suggestion:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status Indicators */
.status-indicator {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}

.status-gravity-on {
  background: hsl(0 100% 50% / 0.2);
  color: hsl(0 100% 70%);
}

.status-gravity-off {
  background: hsl(120 100% 50% / 0.2);
  color: hsl(120 100% 70%);
}

.status-spinning {
  background: hsl(270 100% 50% / 0.2);
  color: hsl(270 100% 70%);
}

.status-raining {
  background: hsl(240 100% 50% / 0.2);
  color: hsl(240 100% 70%);
}

/* Playground Elements */
.playground-element {
  position: absolute;
  transition: all 0.5s ease;
}

.element-sm {
  width: 2rem;
  height: 2rem;
}

.element-md {
  width: 3rem;
  height: 3rem;
}

.element-lg {
  width: 4rem;
  height: 4rem;
}

.element-circle {
  border-radius: 50%;
}

.element-square {
  border-radius: 0.5rem;
}

.element-triangle {
  border-radius: 0.5rem;
  transform: rotate(45deg);
}

/* Rain Drops */
.rain-drop {
  position: absolute;
  width: 0.25rem;
  height: 1rem;
  background: hsl(var(--neon-cyan));
  border-radius: 9999px;
  opacity: 0.7;
  top: -20px;
}

/* Responsive Design */
@media (min-width: 768px) {
  .md\\:text-xl {
    font-size: 1.25rem;
  }
  
  .md\\:text-6xl {
    font-size: 3.75rem;
  }
}