@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  html {
    scroll-behavior: smooth;
  }

  :root {
    /* Legacy Colors mapped to Shadcn variables */
    --background: 0 0% 100%;
    /* #ffffff */
    --foreground: 215 28% 17%;
    /* #1e293b (text-dark) */

    --card: 0 0% 100%;
    --card-foreground: 215 28% 17%;

    --popover: 0 0% 100%;
    --popover-foreground: 215 28% 17%;

    /* Primary: #006A4E (HSL approx 164 100% 21%) */
    --primary: 164 100% 21%;
    --primary-foreground: 0 0% 100%;

    /* Secondary: #F42A41 (HSL approx 353 90% 56%) */
    --secondary: 353 90% 56%;
    --secondary-foreground: 0 0% 100%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215 16% 47%;
    /* #64748b (text-light) */

    --accent: 210 40% 96.1%;
    --accent-foreground: 215 28% 17%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 164 100% 21%;

    --radius: 0.5rem;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    /* Dark mode adjustments if needed, keeping similar hue */
    --primary: 164 100% 21%;
    --primary-foreground: 0 0% 100%;
    --secondary: 353 90% 56%;
    --secondary-foreground: 0 0% 100%;
    /* ... other vars */
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
    /* Railway track pattern with sleepers */
    background-image:
      /* Vertical sleepers */
      repeating-linear-gradient(90deg,
        transparent,
        transparent 48px,
        hsl(var(--primary) / 0.03) 48px,
        hsl(var(--primary) / 0.03) 50px),
      /* Horizontal rails */
      repeating-linear-gradient(0deg,
        transparent,
        transparent 98px,
        hsl(var(--primary) / 0.05) 98px,
        hsl(var(--primary) / 0.05) 100px,
        transparent 100px,
        transparent 104px,
        hsl(var(--primary) / 0.05) 104px,
        hsl(var(--primary) / 0.05) 106px);
    background-size: 50px 100%, 100% 200px;
    background-attachment: fixed;
  }

  /* Ensure section headers are centered as per legacy */
  h2 {
    @apply text-center;
  }
}
