@import 'tailwindcss';
/* Restrict Tailwind v4 source scan to project files to avoid Windows EPERM scandir */
@source "./src/**/*.{ts,tsx,js,jsx,mdx,html}";

:root {
  --background: #ffffff;
  --foreground: #171717;
  --primary: #1f2937;
  --primary-foreground: #ffffff;
  --secondary: #f3f4f6;
  --secondary-foreground: #374151;
  --accent: #f59e0b;
  --accent-foreground: #ffffff;
  --muted: #f9fafb;
  --muted-foreground: #6b7280;
  --border: #e5e7eb;
  --input: #ffffff;
  --ring: #1f2937;
  --radius: 0.5rem;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --card: #ffffff;
  --card-foreground: #171717;
}

@theme {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-error: var(--error);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --foreground: #ededed;
    --primary: #ffffff;
    --primary-foreground: #0a0a0a;
    --secondary: #1f2937;
    --secondary-foreground: #f9fafb;
    --accent: #f59e0b;
    --accent-foreground: #ffffff;
    --muted: #1f2937;
    --muted-foreground: #9ca3af;
    --border: #374151;
    --input: #1f2937;
    --ring: #ffffff;
    --card: #1f2937;
    --card-foreground: #ededed;
  }
}

* {
  border-color: var(--border);
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans), Arial, Helvetica, sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--muted);
}

::-webkit-scrollbar-thumb {
  background: var(--muted-foreground);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--foreground);
}

/* Focus styles */
.focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Animation utilities */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}
.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}
.animate-scale-in {
  animation: scaleIn 0.2s ease-out;
}

/* Loading spinner */
.spinner {
  border: 2px solid var(--muted);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Product card hover effects */
.product-card {
  transition: all 0.3s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button styles */
@layer components {
  .btn {
    @apply inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 px-4 py-2 border border-transparent shadow-sm;
  }
  /* Make primary buttons use brand accent by default */
  .btn-primary {
    @apply bg-accent text-accent-foreground hover:bg-accent/90;
  }
  .btn-secondary {
    @apply bg-secondary text-secondary-foreground hover:bg-secondary/80;
  }
  .btn-outline {
    @apply bg-white text-gray-800 border border-gray-300 hover:bg-gray-50;
  }
  .btn-ghost {
    @apply text-gray-700 hover:bg-gray-100;
  }
  .btn-sm {
    @apply h-9 px-3 py-1.5 text-xs;
  }
  .btn-md {
    @apply h-10 px-4 py-2;
  }
  .btn-lg {
    @apply h-11 px-5 py-2.5 text-base;
  }
}

/* Input styles */
@layer components {
  .input {
    @apply flex h-10 w-full rounded-md border border-gray-300 bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50;
  }
}

/* Admin input styles */
.admin-input {
  @apply w-full px-3 py-2 border-2 border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-accent focus:border-accent transition-colors;
}
.admin-textarea {
  @apply w-full px-3 py-2 border-2 border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-accent focus:border-accent transition-colors;
}
.admin-select {
  @apply w-full px-3 py-2 border-2 border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-accent focus:border-accent transition-colors bg-white;
}
.admin-checkbox {
  @apply w-4 h-4 border-2 border-gray-300 rounded focus:ring-2 focus:ring-accent focus:ring-offset-2;
}
.admin-radio {
  @apply w-4 h-4 border-2 border-gray-300 focus:ring-2 focus:ring-accent focus:ring-offset-2;
}

/* Card styles */
.card {
  @apply rounded-lg border bg-card text-card-foreground shadow-sm;
}
.card-header {
  @apply flex flex-col space-y-1.5 p-6;
}
.card-title {
  @apply text-2xl font-semibold leading-none tracking-tight;
}
.card-description {
  @apply text-sm text-muted-foreground;
}
.card-content {
  @apply p-6 pt-0;
}
.card-footer {
  @apply flex items-center p-6 pt-0;
}
