@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";

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

/* ============================================================
   VehCall Design System
   Palette matched to the VehCall app — blue→purple gradient,
   WhatsApp green, deep navy. Premium dark / glassmorphism.
   ============================================================ */

@theme {
  /* Brand */
  --color-brand: #5c7cfa; /* periwinkle blue (primary) */
  --color-electric: #9b6bff; /* violet (gradient end) */

  /* Status */
  --color-success: #25d366; /* WhatsApp green */
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  /* Surfaces (navy, matched to app) */
  --color-bg: #0a0e1a;
  --color-surface: #12172a;
  --color-panel: #161b2e;

  /* Fonts */
  --font-sans: var(--font-inter);
  --font-display: var(--font-jakarta);

  /* Animations */
  --animate-float: float 6s ease-in-out infinite;
  --animate-float-slow: float 9s ease-in-out infinite;
  --animate-glow: glow 3.5s ease-in-out infinite;
  --animate-spin-slow: spin 18s linear infinite;
  --animate-pulse-glow: pulse-glow 2.8s ease-in-out infinite;
  --animate-marquee: marquee 32s linear infinite;
  --animate-toast-in: toast-in 0.28s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(var(--tw-rotate, 0deg));
  }
  50% {
    transform: translateY(-14px) rotate(var(--tw-rotate, 0deg));
  }
}

@keyframes glow {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(92, 124, 250, 0.45);
  }
  50% {
    box-shadow: 0 0 36px 6px rgba(92, 124, 250, 0.35);
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ------------------------------------------------------------ */

:root {
  color-scheme: dark;
  --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.87 0 0);
  --chart-2: oklch(0.556 0 0);
  --chart-3: oklch(0.439 0 0);
  --chart-4: oklch(0.371 0 0);
  --chart-5: oklch(0.269 0 0);
  --radius: 0.625rem;
  --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);
}

@layer base {
  html {
    scroll-behavior: smooth;
    /* offset for the sticky 80px nav when jumping to anchors */
    scroll-padding-top: 96px;
  }

  body {
    background-color: var(--color-bg);
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-sans), system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-display), var(--font-sans), sans-serif;
    color: #fff;
    letter-spacing: -0.02em;
  }

  ::selection {
    background: rgba(92, 124, 250, 0.3);
    color: #fff;
  }

  /* Slim themed scrollbar */
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: var(--color-bg);
  }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #232a44, #161b2e);
    border-radius: 999px;
    border: 2px solid var(--color-bg);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #2f3760;
  }
  * {
    @apply border-border outline-ring/50;
  }
}

@layer components {
  /* Glassmorphism card */
  .glass {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.02)
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  /* Gradient brand text */
  .text-gradient {
    background: linear-gradient(110deg, #5c7cfa 0%, #7c6cfd 50%, #9b6bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* Primary CTA button */
  .btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(110deg, #5c7cfa, #9b6bff);
    box-shadow: 0 8px 30px -8px rgba(92, 124, 250, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  }
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px -8px rgba(123, 108, 253, 0.7);
    filter: brightness(1.07);
  }

  /* Secondary / ghost button */
  .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s ease, background 0.2s ease,
      transform 0.2s ease;
  }
  .btn-ghost:hover {
    border-color: rgba(92, 124, 250, 0.55);
    background: rgba(92, 124, 250, 0.08);
    transform: translateY(-2px);
  }

  /* Eyebrow pill above section titles */
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(92, 124, 250, 0.3);
    background: rgba(92, 124, 250, 0.08);
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a5b4fc;
  }

  /* Card with glow border on hover */
  .card-hover {
    transition: transform 0.3s ease, border-color 0.3s ease,
      box-shadow 0.3s ease;
  }
  .card-hover:hover {
    transform: translateY(-6px);
    border-color: rgba(92, 124, 250, 0.45);
    box-shadow: 0 24px 50px -24px rgba(123, 108, 253, 0.45);
  }
}

@layer utilities {
  /* Radial / grid background helpers */
  .bg-grid {
    background-image: linear-gradient(
        rgba(255, 255, 255, 0.04) 1px,
        transparent 1px
      ),
      linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
  }

  .bg-glow-radial {
    background: radial-gradient(
      60% 60% at 50% 0%,
      rgba(92, 124, 250, 0.14) 0%,
      transparent 70%
    );
  }

  /* Scroll-reveal — progressive enhancement.
     Content is fully visible by default (no-JS, crawlers, SSR). The hidden
     start state only applies once the `js` class is set on <html>, so the
     fade-up animation is purely additive and never hides content. */
  .js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

@theme inline {
  --font-heading: var(--font-display);
  --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);
  --color-foreground: var(--foreground);
  --color-background: var(--background);
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.87 0 0);
  --chart-2: oklch(0.556 0 0);
  --chart-3: oklch(0.439 0 0);
  --chart-4: oklch(0.371 0 0);
  --chart-5: oklch(0.269 0 0);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}