@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --background: oklch(1.0000 0 0);
  --foreground: oklch(0.2845 0.1048 3.9068);
  --card: oklch(1.0000 0 0);
  --card-foreground: oklch(0.2845 0.1048 3.9068);
  --popover: oklch(1.0000 0 0);
  --popover-foreground: oklch(0.2845 0.1048 3.9068);
  --primary: oklch(0.7192 0.1690 13.4280);
  --primary-foreground: oklch(1.0000 0 0);
  --secondary: oklch(0.9414 0.0298 12.5805);
  --secondary-foreground: oklch(0.5143 0.1978 16.9350);
  --muted: oklch(0.9694 0.0152 12.4219);
  --muted-foreground: oklch(0.7192 0.1690 13.4280);
  --destructive: oklch(0.6368 0.2078 25.3313);
  --border: oklch(0.9414 0.0298 12.5805);
  --ring: oklch(0.7192 0.1690 13.4280);
  --radius: 1rem;
}

body {
  font-family: 'Inter', sans-serif;
}

/* Background Gradients & Grids */
.dev-grid {
  background-image: linear-gradient(var(--primary) 1px, transparent 1px), linear-gradient(90deg, var(--primary) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.05;
}

.animated-gradient {
  background: linear-gradient(135deg, var(--secondary) 0%, oklch(0.96 0.03 12) 50%, var(--secondary) 100%);
  background-size: 200% 200%;
  animation: gradientFlow 10s ease-in-out infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Selectable Element Wrappers (For Dev Tools) */
.selectable-wrapper {
  position: relative;
  border-radius: calc(var(--radius) - 6px);
  cursor: pointer;
}

.selectable-wrapper::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px dashed transparent;
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
  transition: all 0.2s ease-out;
  opacity: 0;
  z-index: 20;
}

/* Hover effects only active if right canvas is active or dev mode */
.dev-mode-active .selectable-wrapper:hover::after {
  border-color: var(--primary);
  opacity: 0.4;
}

.selectable-wrapper.is-selected::after {
  border-color: var(--primary) !important;
  border-style: solid !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 4px rgba(232, 126, 140, 0.1);
}

/* Base Animations */
@keyframes breathing {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(251, 113, 133, 0.2); }
}
.animate-breathing { animation: breathing 2.5s ease-in-out infinite; }

@keyframes spring-loop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-spring-loop { animation: spring-loop 1s ease-in-out infinite; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}
.animate-wiggle { animation: wiggle 1.5s ease-in-out infinite; }

/* Micro-interaction: Shimmer */
.shimmer-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
  transform: skewX(-20deg);
  transition: none;
}
.shimmer-btn:hover::after {
  animation: shimmer 0.6s ease-in-out forwards;
}
@keyframes shimmer { 100% { left: 200%; } }

/* Range Slider customization for scrubber */
input[type=range] {
  -webkit-appearance: none; 
  appearance: none;
  background: transparent; 
  cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--primary);
  margin-top: -5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.1s;
}
input[type=range]:active::-webkit-slider-thumb {
  transform: scale(1.2);
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
