@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --radius: 0.75rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.12 0.01 280);
  --foreground: oklch(0.95 0.01 280);
  --card: oklch(0.17 0.015 280);
  --card-foreground: oklch(0.95 0.01 280);
  --popover: oklch(0.17 0.015 280);
  --popover-foreground: oklch(0.95 0.01 280);
  --primary: oklch(0.72 0.19 295);
  --primary-foreground: oklch(0.98 0 0);
  --secondary: oklch(0.22 0.02 280);
  --secondary-foreground: oklch(0.95 0.01 280);
  --muted: oklch(0.22 0.015 280);
  --muted-foreground: oklch(0.65 0.02 280);
  --accent: oklch(0.22 0.03 295);
  --accent-foreground: oklch(0.95 0.01 280);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(0.28 0.02 280);
  --input: oklch(0.25 0.02 280);
  --ring: oklch(0.72 0.19 295);
  --chart-1: oklch(0.72 0.19 295);
  --chart-2: oklch(0.7 0.17 160);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.15 0.015 280);
  --sidebar-foreground: oklch(0.95 0.01 280);
  --sidebar-primary: oklch(0.72 0.19 295);
  --sidebar-primary-foreground: oklch(0.98 0 0);
  --sidebar-accent: oklch(0.22 0.03 295);
  --sidebar-accent-foreground: oklch(0.95 0.01 280);
  --sidebar-border: oklch(0.28 0.02 280);
  --sidebar-ring: oklch(0.72 0.19 295);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: oklch(0.35 0.02 280);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: oklch(0.45 0.03 280);
}

/* Glassmorphism utility */
.glass {
  background: oklch(0.17 0.015 280 / 60%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid oklch(1 0 0 / 8%);
}

/* Glow effect */
.glow-purple {
  box-shadow: 0 0 20px oklch(0.72 0.19 295 / 30%), 0 0 60px oklch(0.72 0.19 295 / 10%);
}

.glow-emerald {
  box-shadow: 0 0 20px oklch(0.7 0.17 160 / 30%), 0 0 60px oklch(0.7 0.17 160 / 10%);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, oklch(0.72 0.19 295), oklch(0.7 0.17 160));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Shimmer loading effect */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, oklch(0.22 0.015 280) 25%, oklch(0.3 0.02 280) 50%, oklch(0.22 0.015 280) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Fade in animation */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out;
}

/* Comparison slider */
.comparison-container {
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.comparison-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.comparison-slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: white;
  cursor: col-resize;
  z-index: 10;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

.comparison-slider-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  cursor: col-resize;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.comparison-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.comparison-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Upload area animation */
@keyframes border-dance {
  0% { background-position: 0 0, 100% 0, 100% 100%, 0 100%; }
  100% { background-position: 100% 0, 100% 100%, 0 100%, 0 0; }
}

.upload-area-active {
  border-color: oklch(0.72 0.19 295) !important;
  background-color: oklch(0.72 0.19 295 / 10%) !important;
}

/* Tool card hover */
.tool-card {
  transition: all 0.2s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px oklch(0.72 0.19 295 / 20%);
}

/* Progress bar animation */
@keyframes progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-indeterminate {
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}