@import 'tailwindcss' source('./');
@plugin "./lib/tailwind-plugins.js";

/* Configure dark mode to use .dark class instead of prefers-color-scheme */
@variant dark (&:where(.dark, .dark *));

@theme {
  /* Typography */
  --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Monaco', monospace;

  /* Disable all default Tailwind colors */
  --color-*: initial;

  --color-transparent: transparent;
  --color-current: currentColor;
  --color-inherit: inherit;

  --color-neutral-1: hsl(var(--neutral-1));
  --color-neutral-1_01: hsl(var(--neutral-1) / 0.01);
  --color-neutral-2: hsl(var(--neutral-2));
  --color-neutral-3: hsl(var(--neutral-3));
  --color-neutral-4: hsl(var(--neutral-4));
  --color-neutral-5: hsl(var(--neutral-5));
  --color-neutral-6: hsl(var(--neutral-6));
  --color-neutral-7: hsl(var(--neutral-7));
  --color-neutral-8: hsl(var(--neutral-8));
  --color-neutral-9: hsl(var(--neutral-9));
  --color-neutral-10: hsl(var(--neutral-10));
  --color-neutral-11: hsl(var(--neutral-11));
  --color-neutral-12: hsl(var(--neutral-12));

  --color-red-50: #fef5f5;
  --color-red-100: #fdeaeb;
  --color-red-200: #fbcbce;
  --color-red-300: #f8abb0;
  --color-red-400: #f26d74;
  --color-red-500: #ed2e39;
  --color-red-600: #d52933;
  --color-red-700: #b2232b;
  --color-red-800: #8e1c22;
  --color-red-900: #74171c;

  --color-yellow-50: #fffcf2;
  --color-yellow-100: #fffae6;
  --color-yellow-200: #fff2bf;
  --color-yellow-300: #ffeb99;
  --color-yellow-400: #ffdb4d;
  --color-yellow-500: #fc0;
  --color-yellow-600: #e6b800;
  --color-yellow-700: #bf9900;
  --color-yellow-800: #997a00;
  --color-yellow-900: #7d6400;

  --color-green-50: #f2fcf9;
  --color-green-100: #e6f8f3;
  --color-green-200: #bfeee1;
  --color-green-300: #99e3cf;
  --color-green-400: #4dcfac;
  --color-green-500: #00ba88;
  --color-green-600: #00a77a;
  --color-green-700: #008c66;
  --color-green-800: #007052;
  --color-green-900: #005b43;

  --color-orange-50: #fefbf5;
  --color-orange-100: #fef8ec;
  --color-orange-200: #fcedcf;
  --color-orange-300: #fbe2b3;
  --color-orange-400: #f7cd79;
  --color-orange-500: #f4b740;
  --color-orange-600: #dca53a;
  --color-orange-700: #b78930;
  --color-orange-800: #926e26;
  --color-orange-900: #785a1f;

  --color-blue-50: #f0f9ff;
  --color-blue-100: #e0f2fe;
  --color-blue-200: #bae6fd;
  --color-blue-300: #7dd3fc;
  --color-blue-400: #38bdf8;
  --color-blue-500: #0ea5e9;
  --color-blue-600: #0284c7;
  --color-blue-700: #0369a1;
  --color-blue-800: #075985;
  --color-blue-900: #0c4a6e;
  --color-blue-950: #082f49;

  --color-emerald-50: #ecfdf5;
  --color-emerald-100: #d1fae5;
  --color-emerald-200: #a7f3d0;
  --color-emerald-300: #6ee7b7;
  --color-emerald-400: #34d399;
  --color-emerald-500: #10b981;
  --color-emerald-600: #059669;
  --color-emerald-700: #047857;
  --color-emerald-800: #065f46;
  --color-emerald-900: #064e3b;
  --color-emerald-950: #022c22;

  --color-amber-50: #fffbeb;
  --color-amber-100: #fef3c7;
  --color-amber-200: #fde68a;
  --color-amber-300: #fcd34d;
  --color-amber-400: #fbbf24;
  --color-amber-500: #f59e0b;
  --color-amber-600: #d97706;
  --color-amber-700: #b45309;
  --color-amber-800: #92400e;
  --color-amber-900: #78350f;
  --color-amber-950: #451a03;

  --color-zinc-50: #fafafa;
  --color-zinc-100: #f4f4f5;
  --color-zinc-200: #e4e4e7;
  --color-zinc-300: #d4d4d8;
  --color-zinc-400: #a1a1aa;
  --color-zinc-500: #71717a;
  --color-zinc-600: #52525b;
  --color-zinc-700: #3f3f46;
  --color-zinc-800: #27272a;
  --color-zinc-900: #18181b;
  --color-zinc-950: #09090b;

  --color-indigo-50: #eef2ff;
  --color-indigo-100: #e0e7ff;
  --color-indigo-200: #c7d2fe;
  --color-indigo-300: #a5b4fc;
  --color-indigo-400: #818cf8;
  --color-indigo-500: #6366f1;
  --color-indigo-600: #4f46e5;
  --color-indigo-700: #4338ca;
  --color-indigo-800: #3730a3;
  --color-indigo-900: #312e81;
  --color-indigo-950: #1e1b4b;

  --color-lime-50: #f7fee7;
  --color-lime-100: #ecfccb;
  --color-lime-200: #d9f99d;
  --color-lime-300: #bef264;
  --color-lime-400: #a3e635;
  --color-lime-500: #84cc16;
  --color-lime-600: #65a30d;
  --color-lime-700: #4d7c0f;
  --color-lime-800: #3f6212;
  --color-lime-900: #365314;
  --color-lime-950: #1a2e05;

  --color-pink-50: #fdf2f8;
  --color-pink-100: #fce7f3;
  --color-pink-200: #fbcfe8;
  --color-pink-300: #f9a8d4;
  --color-pink-400: #f472b6;
  --color-pink-500: #ec4899;
  --color-pink-600: #db2777;
  --color-pink-700: #be185d;
  --color-pink-800: #9d174d;
  --color-pink-900: #831843;
  --color-pink-950: #500724;

  --color-purple-50: #faf5ff;
  --color-purple-100: #f3e8ff;
  --color-purple-200: #e9d5ff;
  --color-purple-300: #d8b4fe;
  --color-purple-400: #c084fc;
  --color-purple-500: #a855f7;
  --color-purple-600: #9333ea;
  --color-purple-700: #7e22ce;
  --color-purple-800: #6b21a8;
  --color-purple-900: #581c87;
  --color-purple-950: #3b0764;

  --color-rose-50: #fff1f2;
  --color-rose-100: #ffe4e6;
  --color-rose-200: #fecdd3;
  --color-rose-300: #fda4af;
  --color-rose-400: #fb7185;
  --color-rose-500: #f43f5e;
  --color-rose-600: #e11d48;
  --color-rose-700: #be123c;
  --color-rose-800: #9f1239;
  --color-rose-900: #881337;
  --color-rose-950: #4c0519;

  --color-teal-50: #f0fdfa;
  --color-teal-100: #ccfbf1;
  --color-teal-200: #99f6e4;
  --color-teal-300: #5eead4;
  --color-teal-400: #2dd4bf;
  --color-teal-500: #14b8a6;
  --color-teal-600: #0d9488;
  --color-teal-700: #0f766e;
  --color-teal-800: #115e59;
  --color-teal-900: #134e4a;
  --color-teal-950: #042f2e;

  --color-accent: hsl(var(--accent));
  --color-accent_80: hsl(var(--accent) / 0.8);
  --color-accent_30: hsl(var(--accent) / 0.3);
  --color-accent_10: hsl(var(--accent) / 0.1);
  --color-accent_08: hsl(var(--accent) / 0.08);

  --color-ring: hsl(var(--ring));

  /* Border Radius */
  --radius: 0.5rem;
  --radius-lg: var(--radius);
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-xs: calc(var(--radius) - 6px);

  /* Animations */
  --animate-slide-up-fade: slide-up-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --animate-slide-right-fade: slide-right-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --animate-slide-down-fade: slide-down-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --animate-slide-left-fade: slide-left-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --animate-shimmer: shimmer 1.5s linear infinite;
  --animate-shake: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;

  /* Min Height */
  --min-h-content: var(--content-height);
}

@layer base {
  * {
    /* Tailwind base utility variables */
    --tw-ring-inset: ;
    --tw-ring-offset-width: 1px;
    --tw-ring-offset-color: var(--color-accent_30);
    --tw-ring-offset-shadow: 0 0 #0000;
    --tw-ring-shadow: 0 0 #0000;
    --tw-shadow: 0 0 #0000;
    --tw-shadow-colored: 0 0 #0000;
  }

  :root {
    color-scheme: light dark;

    @apply font-sans subpixel-antialiased;

    --header-height: 84px;
    --tabs-navbar-height: 47px;
    --content-height: calc(100vh - var(--header-height) - var(--tabs-navbar-height));

    --neutral-1: 0 0% 99%;
    --neutral-2: 180 9% 97%;
    --neutral-3: 210 7% 95%;
    --neutral-4: 200 6% 92%;
    --neutral-5: 210 6% 89%;
    --neutral-6: 204 5% 79%;
    --neutral-7: 197 4% 67%;
    --neutral-8: 196 4% 51%;
    --neutral-9: 193 9% 32%;
    --neutral-10: 188 15% 21%;
    --neutral-11: 188 19% 15%;
    --neutral-12: 175 23% 10%;

    --accent: 206 96% 35%;

    --chart-1: 45 93% 47%;
    --chart-2: 0 86% 60%;
    --chart-3: 160 82% 39%;
    --chart-4: 199 89% 48%;
    --chart-5: 258 90% 66%;
    --chart-6: 330 81% 60%;
    --chart-grid: 0 0% 35%;

    --ring: 216 58% 49%;
  }

  .dark {
    --neutral-1: 210 21% 5%;
    --neutral-2: 210 16% 7%;
    --neutral-3: 214 14% 10%;
    --neutral-4: 210 13% 13%;
    --neutral-5: 210 12% 16%;
    --neutral-6: 210 11% 21%;
    --neutral-7: 210 12% 27%;
    --neutral-8: 210 11% 34%;
    --neutral-9: 210 10% 43%;
    --neutral-10: 213 9% 58%;
    --neutral-11: 210 11% 75%;
    --neutral-12: 204 14% 93%;

    --accent: 48 100% 83%;

    --chart-1: 45 93% 52%;
    --chart-2: 0 86% 65%;
    --chart-3: 160 82% 49%;
    --chart-4: 199 89% 58%;
    --chart-5: 258 90% 72%;
    --chart-6: 330 81% 68%;
    --chart-grid: 0 0% 45%;
  }

  :root {
    --hive-laboratory-radius: var(--radius);
    --hive-laboratory-background: var(--neutral-2);
    --hive-laboratory-foreground: var(--neutral-11);
    --hive-laboratory-card: var(--neutral-1);
    --hive-laboratory-card-foreground: var(--neutral-11);
    --hive-laboratory-popover: var(--neutral-3);
    --hive-laboratory-popover-foreground: var(--neutral-11);
    --hive-laboratory-primary: var(--accent);
    --hive-laboratory-primary-foreground: var(--neutral-1);
    --hive-laboratory-secondary: var(--neutral-3);
    --hive-laboratory-secondary-foreground: var(--neutral-11);
    --hive-laboratory-muted: var(--neutral-3);
    --hive-laboratory-muted-foreground: var(--neutral-11);
    --hive-laboratory-accent: var(--neutral-4);
    --hive-laboratory-accent-foreground: var(--neutral-11);
    --hive-laboratory-destructive: var(--red-500);
    --hive-laboratory-border: var(--neutral-5);
    --hive-laboratory-input: var(--neutral-5);
    --hive-laboratory-ring: var(--ring);
  }

  .dark {
    --hive-laboratory-radius: var(--radius);
    --hive-laboratory-background: var(--neutral-1);
    --hive-laboratory-foreground: var(--neutral-11);
    --hive-laboratory-card: var(--neutral-2);
    --hive-laboratory-card-foreground: var(--neutral-11);
    --hive-laboratory-popover: var(--neutral-3);
    --hive-laboratory-popover-foreground: var(--neutral-11);
    --hive-laboratory-primary: var(--accent);
    --hive-laboratory-primary-foreground: var(--neutral-1);
    --hive-laboratory-secondary: var(--neutral-3);
    --hive-laboratory-secondary-foreground: var(--neutral-11);
    --hive-laboratory-muted: var(--neutral-3);
    --hive-laboratory-muted-foreground: var(--neutral-11);
    --hive-laboratory-accent: var(--neutral-6);
    --hive-laboratory-accent-foreground: var(--neutral-11);
    --hive-laboratory-destructive: var(--red-500);
    --hive-laboratory-border: var(--neutral-5);
    --hive-laboratory-input: var(--neutral-5);
    --hive-laboratory-ring: var(--ring);
  }
}

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

  #root,
  body {
    @apply text-neutral-11 dark:bg-neutral-2 bg-neutral-3;
  }

  button,
  [role='button'] {
    cursor: pointer;
  }

  :disabled {
    cursor: default;
  }

  ::placeholder {
    color: var(--color-neutral-9);
  }
}

@layer components {
  *:active,
  *:focus {
    outline: none !important;
  }

  #root {
    @apply flex h-full flex-col text-sm antialiased;
  }

  /* Remove autocomplete color in Chrome */
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus,
  input:-webkit-autofill:active {
    -webkit-transition:
      color 9999s ease-out,
      background-color 9999s ease-out;
    -webkit-transition-delay: 9999s;
  }

  select {
    /* remove default arrow down icon in right side */
    appearance: none;
  }

  .monaco-editor,
  .monaco-editor-background,
  [role='presentation'] {
    background: transparent !important;
    --vscode-focusBorder: transparent !important;
  }

  .hive-markdown a {
    @apply text-orange-500 hover:no-underline;
  }

  .hive-markdown code {
    @apply bg-neutral-2 rounded-sm px-2 py-1 text-orange-500;
  }

  .hive-loading-indicator {
    background: linear-gradient(
      to right,
      transparent 0%,
      var(--color-accent) 50%,
      transparent 100%
    );
    animation: 1s ease 0s infinite normal none running loading-indicator;
  }

  @keyframes loading-indicator {
    0% {
      left: -40%;
    }
    100% {
      left: 100%;
    }
  }

  .hive-modal {
    transform: translate(-50%, -50%);
    box-shadow:
      hsl(206 22% 7% / 35%) 0 10px 38px -10px,
      hsl(206 22% 7% / 20%) 0 10px 20px -15px;
  }

  @media (prefers-reduced-motion: no-preference) {
    .hive-modal {
      animation: content-show 300ms cubic-bezier(0.16, 1, 0.3, 1);
    }
  }

  @keyframes content-show {
    0% {
      opacity: 0;
      transform: translate(-50%, -48%) scale(0.96);
    }
    100% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .hive-modal-overlay {
      animation: overlay-show 300ms cubic-bezier(0.16, 1, 0.3, 1);
    }
  }

  @keyframes overlay-show {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  /* hide arrows for <input type="number" /> */
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
  }

  .schema-doc-row-old::before {
    content: counter(olddoc);
  }
  .schema-doc-row-new::before {
    content: counter(newdoc);
  }
}

.hive-badge-is-changed:after {
  @apply border-b-accent bg-accent_80 absolute right-2 size-1.5 rounded-full border content-[''];
}

/* Custom container - matches v3 config: full-width until 2xl, then 1800px max */
@utility container {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding-inline: 2rem;
  @media (width >= 96rem) {
    max-width: 1800px;
  }
}

/* Keyframes (must be outside @theme) */
@keyframes slide-up-fade {
  0% {
    opacity: 0;
    transform: translateY(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-right-fade {
  0% {
    opacity: 0;
    transform: translateX(-2px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-down-fade {
  0% {
    opacity: 0;
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-left-fade {
  0% {
    opacity: 0;
    transform: translateX(2px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

/* Animation keyframes for shadcn/ui components */
@keyframes enter {
  from {
    opacity: var(--tw-enter-opacity, 1);
    transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0)
      scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1));
  }
}

@keyframes exit {
  to {
    opacity: var(--tw-exit-opacity, 1);
    transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0)
      scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1));
  }
}

@layer utilities {
  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }
  .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  /* Animation utilities (replaces tailwindcss-animate) */
  .animate-in {
    animation-name: enter;
    animation-duration: 150ms;
    --tw-enter-opacity: initial;
    --tw-enter-scale: initial;
    --tw-enter-translate-x: initial;
    --tw-enter-translate-y: initial;
  }

  .animate-out {
    animation-name: exit;
    animation-duration: 150ms;
    --tw-exit-opacity: initial;
    --tw-exit-scale: initial;
    --tw-exit-translate-x: initial;
    --tw-exit-translate-y: initial;
  }

  /* Fade utilities */
  .fade-in-0 {
    --tw-enter-opacity: 0;
  }
  .fade-in-50 {
    --tw-enter-opacity: 0.5;
  }
  .fade-in-80 {
    --tw-enter-opacity: 0.8;
  }
  .fade-out-0 {
    --tw-exit-opacity: 0;
  }
  .fade-out-80 {
    --tw-exit-opacity: 0.8;
  }

  /* Zoom utilities */
  .zoom-in-95 {
    --tw-enter-scale: 0.95;
  }
  .zoom-out-95 {
    --tw-exit-scale: 0.95;
  }

  /* Slide in utilities */
  .slide-in-from-top {
    --tw-enter-translate-y: -100%;
  }
  .slide-in-from-top-1 {
    --tw-enter-translate-y: -0.25rem;
  }
  .slide-in-from-top-2 {
    --tw-enter-translate-y: -0.5rem;
  }
  .slide-in-from-bottom {
    --tw-enter-translate-y: 100%;
  }
  .slide-in-from-bottom-1 {
    --tw-enter-translate-y: 0.25rem;
  }
  .slide-in-from-bottom-2 {
    --tw-enter-translate-y: 0.5rem;
  }
  .slide-in-from-bottom-full {
    --tw-enter-translate-y: 100%;
  }
  .slide-in-from-left {
    --tw-enter-translate-x: -100%;
  }
  .slide-in-from-left-1 {
    --tw-enter-translate-x: -0.25rem;
  }
  .slide-in-from-left-2 {
    --tw-enter-translate-x: -0.5rem;
  }
  .slide-in-from-left-1\/2 {
    --tw-enter-translate-x: -50%;
  }
  .slide-in-from-right {
    --tw-enter-translate-x: 100%;
  }
  .slide-in-from-right-1 {
    --tw-enter-translate-x: 0.25rem;
  }
  .slide-in-from-right-2 {
    --tw-enter-translate-x: 0.5rem;
  }

  /* Slide out utilities */
  .slide-out-to-top {
    --tw-exit-translate-y: -100%;
  }
  .slide-out-to-bottom {
    --tw-exit-translate-y: 100%;
  }
  .slide-out-to-left {
    --tw-exit-translate-x: -100%;
  }
  .slide-out-to-left-1\/2 {
    --tw-exit-translate-x: -50%;
  }
  .slide-out-to-right {
    --tw-exit-translate-x: 100%;
  }
  .slide-out-to-right-full {
    --tw-exit-translate-x: 100%;
  }
}
