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

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

/* Handex brand fonts — Inter (primary) with Cyrillic + Latin support */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap");
}

@theme inline {
  --font-sans: "Inter", "Nunito", system-ui, -apple-system, sans-serif;

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  /* shadcn-vue semantic tokens */
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);

  /* Handex brand tokens */
  --color-brand-primary: var(--brand-primary);
  --color-brand-accent: var(--brand-accent);
  --color-brand-orange: var(--brand-orange);
  --color-brand-cream: var(--brand-cream);
  --color-brand-dark: var(--brand-dark);
  --color-brand-gray: var(--brand-gray);
  --color-brand-success: var(--brand-success);
  --color-brand-success-bg: var(--brand-success-bg);
  --color-brand-error: var(--brand-error);
  --color-brand-error-bg: var(--brand-error-bg);
  --color-brand-video-bg: var(--brand-video-bg);
  --color-brand-progress-track: var(--brand-progress-track);
  --color-brand-amber-light: var(--brand-amber-light);
  --color-brand-amber-bubble: var(--brand-amber-bubble);
}

:root {
  --radius: 0.625rem;

  /* shadcn-vue base — mapped to Handex brand */
  --background: #F8FAFF;
  --foreground: #1E293B;
  --card: #FFFFFF;
  --card-foreground: #1E293B;
  --popover: #FFFFFF;
  --popover-foreground: #1E293B;
  --primary: #1A56DB;
  --primary-foreground: #FFFFFF;
  --secondary: #F1F5F9;
  --secondary-foreground: #1E293B;
  --muted: #F1F5F9;
  --muted-foreground: #64748B;
  --accent: #F59E0B;
  --accent-foreground: #FFFFFF;
  --destructive: #991B1B;
  --destructive-foreground: #FFFFFF;
  --border: #E2E8F0;
  --input: #F59E0B;
  --ring: #1A56DB;
  --chart-1: #1A56DB;
  --chart-2: #F59E0B;
  --chart-3: #166534;
  --chart-4: #E8612A;
  --chart-5: #991B1B;

  /* Sidebar — not used in v1, keep defaults */
  --sidebar: #F8FAFF;
  --sidebar-foreground: #1E293B;
  --sidebar-primary: #1A56DB;
  --sidebar-primary-foreground: #FFFFFF;
  --sidebar-accent: #F59E0B;
  --sidebar-accent-foreground: #FFFFFF;
  --sidebar-border: #E2E8F0;
  --sidebar-ring: #1A56DB;

  /* Handex brand palette — primary-blue theme */
  --brand-primary: #1A56DB;
  --brand-accent: #3B82F6;      /* blue-500 */
  --brand-orange: #1A56DB;      /* remapped: CTA accent now matches primary */
  --brand-cream: #F8FAFF;       /* cool off-white tinted toward primary */
  --brand-dark: #1E293B;
  --brand-gray: #64748B;
  --brand-success: #166534;
  --brand-success-bg: #DCFCE7;
  --brand-error: #991B1B;
  --brand-error-bg: #FEE2E2;
  --brand-video-bg: #F0F0F0;
  --brand-progress-track: #E0E7FF;  /* indigo-100 */
  --brand-amber-light: #DBEAFE;     /* blue-100 — soft primary backgrounds */
  --brand-amber-bubble: #EFF6FF;    /* blue-50  — speech bubbles */
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  html {
    scroll-behavior: smooth;
    overflow-y: scroll;
  }
  body {
    @apply bg-background text-foreground font-sans antialiased;
    min-width: 320px;
  }
  /* Tailwind Preflight sets cursor: default on buttons — restore pointer */
  button:not(:disabled),
  [role='button']:not(:disabled) {
    cursor: pointer;
  }
}

/* Gentle vertical bounce for the CONTINUE tooltip */
@keyframes tooltip-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
.animate-tooltip-bounce {
  animation: tooltip-bounce 1.6s ease-in-out infinite;
}

/* Desktop: centered app container (max 480px) over a darker page bg */
@media (min-width: 768px) {
  html,
  body {
    background: #E2E8F0; /* slate-200 — darker offset area */
  }
  .app-shell {
    max-width: 480px;
    margin-inline: auto;
    position: relative;
    background: var(--brand-cream);
    box-shadow: 0 0 40px rgba(15, 23, 42, 0.08);
    min-height: 100dvh;
  }
}
