/**
 * Shadcn/UI design system - exact port from food-scout-ui-design
 * Use with Tailwind CDN (theme extended to use these variables)
 */

:root {
  --background: 0 0% 99%;
  --foreground: 215 25% 15%;
  --card: 0 0% 100%;
  --card-foreground: 215 25% 15%;
  --popover: 0 0% 100%;
  --popover-foreground: 215 25% 15%;
  --primary: 25 100% 50%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 15% 96%;
  --secondary-foreground: 215 25% 15%;
  --muted: 210 15% 96%;
  --muted-foreground: 215 10% 45%;
  --accent: 25 100% 96%;
  --accent-foreground: 25 100% 30%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 210 15% 90%;
  --input: 210 15% 90%;
  --ring: 25 100% 50%;
  --radius: 1rem;
  --chart-1: 25 100% 50%;
  --chart-2: 173 58% 39%;
  --chart-3: 197 37% 24%;
  --chart-4: 43 74% 66%;
  --chart-5: 12 76% 61%;
  --sidebar-background: 0 0% 98%;
  --sidebar-foreground: 215 25% 15%;
  --sidebar-primary: 25 100% 50%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 25 100% 96%;
  --sidebar-accent-foreground: 25 100% 30%;
  --sidebar-border: 210 15% 90%;
  --sidebar-ring: 25 100% 50%;
}

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

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* Shadcn Button equivalents (for use without Tailwind arbitrary values) */
.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  height: 2.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: colors 0.2s;
}
.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-outline {
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  height: 2.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* Card */
.shadcn-card {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Legacy compatibility: modals and forms in base template */
.glass-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.form-input {
  width: 100%;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}
.form-input::placeholder {
  color: hsl(var(--muted-foreground));
}
.form-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

/* Input */
.shadcn-input {
  flex: 1 1 0%;
  height: 2.5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}
.shadcn-input::placeholder {
  color: hsl(var(--muted-foreground));
}
.shadcn-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

/* Badge */
.shadcn-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.shadcn-badge-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.shadcn-badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

/* Tabs (Bootstrap-compatible overrides for Shadcn look) */
.shadcn-tabs-list {
  display: inline-flex;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 4px);
  background-color: hsl(var(--muted));
  padding: 0.25rem;
  color: hsl(var(--muted-foreground));
}
.shadcn-tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 2px;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.shadcn-tabs-trigger[data-state="active"],
.shadcn-tabs-trigger.active {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Venue detail menu tabs: active state uses Shadcn colors */
#menuSectionTabs .nav-link.active {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
#menuSectionTabs .nav-link:not(.active) {
  background-color: transparent;
  color: hsl(var(--muted-foreground));
}

/* Progress bar */
.shadcn-progress {
  position: relative;
  height: 1rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
}
.shadcn-progress-indicator {
  height: 100%;
  width: 100%;
  flex: 1 1 0%;
  background-color: hsl(var(--primary));
  transition: transform 0.2s;
}

/* Insights / Shadcn component extensions */
.insights-shell {
  background: linear-gradient(to bottom, color-mix(in srgb, hsl(var(--card)) 65%, transparent), transparent);
  border-radius: 1rem;
}

/* Accordion expanded state */
.accordion-trigger[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

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

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

/* Safe area for mobile */
@supports (padding: env(safe-area-inset-bottom)) {
  .safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }
  .safe-area-top { padding-top: env(safe-area-inset-top); }
}
