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

@plugin "@tailwindcss/typography";

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

@theme inline {
  --color-background: var(--background);
  --color-background-surface: var(--background-surface);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-inter);
  --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-foreground: var(--destructive-foreground);
  --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);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --shadow-base: 0px 0px 1px 0.5px rgba(0, 0, 0, 0.1);
  --animate-accordion-down: accordion-down 0.2s ease-out;
  --animate-accordion-up: accordion-up 0.2s ease-out;
  --animate-accordion-down-spring: accordion-down 0.2s
    cubic-bezier(0.4, 0, 0.2, 1);
  --animate-accordion-up-spring: accordion-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --animate-caret-blink: caret-blink 1.25s ease-out infinite;

  /* overrides */
  --text-table: 0.8125rem;
  --text-table--line-height: 1.2rem;

  @keyframes accordion-down {
    from {
      height: 0;
    }
    to {
      height: var(--radix-accordion-content-height);
    }
  }

  @keyframes accordion-up {
    from {
      height: var(--radix-accordion-content-height);
    }
    to {
      height: 0;
    }
  }

  @keyframes caret-blink {
    0%,
    70%,
    100% {
      opacity: 1;
    }
    20%,
    50% {
      opacity: 0;
    }
  }

  --animate-orbit: orbit calc(var(--duration) * 1s) linear infinite;

  @keyframes orbit {
    0% {
      transform: rotate(calc(var(--angle) * 1deg))
        translateY(calc(var(--radius) * 1px)) rotate(calc(var(--angle) * -1deg));
    }
    100% {
      transform: rotate(calc(var(--angle) * 1deg + 360deg))
        translateY(calc(var(--radius) * 1px))
        rotate(calc((var(--angle) * -1deg) - 360deg));
    }
  }
}

:root {
  --radius: 0.65rem;
  /* IMPROVED: Softer warm white background instead of pure white */
  --background: oklch(1 0 0); /* white */
  /* IMPROVED: Deeper, more readable foreground with better contrast */
  --foreground: oklch(0.15 0.008 260);
  /* IMPROVED: Subtle blue-tinted card with soft elevation */
  --card: oklch(0.995 0.003 260);
  --card-foreground: oklch(0.15 0.008 260);
  /* IMPROVED: Enhanced popover with better definition */
  --popover: oklch(0.995 0.002 260);
  --popover-foreground: oklch(0.12 0.01 260);
  /* ENHANCED: More vibrant primary blue with better saturation */
  --primary: oklch(0.52 0.22 260);
  --primary-foreground: oklch(0.99 0.002 260);
  /* IMPROVED: Better secondary colors with more presence */
  --secondary: oklch(0.94 0.015 260);
  --secondary-foreground: oklch(0.25 0.03 260);
  /* ENHANCED: Refined muted colors for better hierarchy */
  --muted: oklch(0.96 0.008 260);
  --muted-foreground: oklch(0.45 0.025 260);
  /* IMPROVED: More defined accent colors */
  --accent: oklch(0.92 0.015 260);
  --accent-foreground: oklch(0.18 0.01 260);
  /* ENHANCED: Warmer destructive color that fits the theme */
  --destructive: oklch(0.62 0.22 20);
  --destructive-foreground: oklch(0.99 0.002 260);
  /* IMPROVED: Subtle borders with more definition */
  --border: oklch(0.92 0.005 260);
  --input: oklch(0.92 0.005 260);
  --ring: oklch(0.55 0.19 260);
  /* ENHANCED: More dynamic chart colors with better contrast */
  --chart-1: oklch(0.52 0.22 260); /* Primary blue - enhanced */
  --chart-2: oklch(0.58 0.18 200); /* Cyan blue */
  --chart-3: oklch(0.62 0.15 230); /* Sky blue */
  --chart-4: oklch(0.46 0.2 280); /* Purple blue */
  --chart-5: oklch(0.4 0.18 300); /* Deep purple */
  /* IMPROVED: Better sidebar definition */
  --sidebar: oklch(0.96 0.008 260);
  --sidebar-foreground: oklch(0.25 0.015 260);
  --sidebar-primary: oklch(0.52 0.22 260);
  --sidebar-primary-foreground: oklch(0.99 0.002 260);
  --sidebar-accent: oklch(0.88 0.025 260);
  --sidebar-accent-foreground: oklch(0.25 0.015 260);
  --sidebar-border: oklch(0.85 0.012 260);
  --sidebar-ring: oklch(0.52 0.22 260);
}

.dark {
  --radius: 0.65rem;
  /* ENHANCED: Richer dark background with subtle blue undertone */
  --background: oklch(0.11 0.015 260);
  --foreground: oklch(0.95 0.005 260);
  /* IMPROVED: Better card contrast in dark mode */
  --card: oklch(0.16 0.02 260);
  --card-foreground: oklch(0.95 0.005 260);
  --popover: oklch(0.16 0.02 260);
  --popover-foreground: oklch(0.95 0.005 260);
  /* ENHANCED: Brighter primary for better visibility in dark mode */
  --primary: oklch(0.58 0.2 260);
  --primary-foreground: oklch(0.99 0.002 260);
  /* IMPROVED: Better secondary contrast */
  --secondary: oklch(0.22 0.025 260);
  --secondary-foreground: oklch(0.88 0.015 260);
  --muted: oklch(0.22 0.025 260);
  --muted-foreground: oklch(0.68 0.02 260);
  /* ENHANCED: More defined accent in dark mode */
  --accent: oklch(0.2 0.03 260);
  --accent-foreground: oklch(0.95 0.005 260);
  --destructive: oklch(0.68 0.22 25);
  /* IMPROVED: Better borders for dark mode */
  --border: oklch(0.24 0.025 260);
  --input: oklch(0.22 0.025 260);
  --ring: oklch(0.58 0.2 260);
  /* ENHANCED: More vibrant chart colors for dark mode */
  --chart-1: oklch(0.58 0.2 260);
  --chart-2: oklch(0.62 0.18 200);
  --chart-3: oklch(0.66 0.16 230);
  --chart-4: oklch(0.5 0.22 280);
  --chart-5: oklch(0.48 0.2 300);
  /* IMPROVED: Better sidebar in dark mode */
  --sidebar: oklch(0.16 0.025 260);
  --sidebar-foreground: oklch(0.9 0.01 260);
  --sidebar-primary: oklch(0.58 0.2 260);
  --sidebar-primary-foreground: oklch(0.11 0.015 260);
  --sidebar-accent: oklch(0.2 0.03 260);
  --sidebar-accent-foreground: oklch(0.9 0.01 260);
  --sidebar-border: oklch(0.2 0.02 260);
  --sidebar-ring: oklch(0.58 0.2 260);
}

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

  input[type="number"] {
    -moz-appearance: textfield;
  }

  input[type="number"]::-webkit-outer-spin-button,
  input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
}

/* Spinner */
.spinner {
  font-size: 40px;
  position: relative;
  display: inline-block;
  width: 1em;
  height: 1em;
}

.spinner.center {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
}

.spinner-blade {
  position: absolute;
  left: 0.4629em;
  bottom: 0;
  width: 0.074em;
  height: 0.2777em;
  border-radius: 0.5em;
  background-color: transparent;
  transform-origin: center -0.2222em;
  -webkit-animation: spinner-fade 0.8s infinite linear;
  animation: spinner-fade 0.8s infinite linear;
}
.spinner-blade:nth-child(1) {
  -webkit-animation-delay: 0s;
  animation-delay: 0s;
  transform: rotate(0deg);
}
.spinner-blade:nth-child(2) {
  -webkit-animation-delay: 0.083s;
  animation-delay: 0.083s;
  transform: rotate(30deg);
}
.spinner-blade:nth-child(3) {
  -webkit-animation-delay: 0.166s;
  animation-delay: 0.166s;
  transform: rotate(60deg);
}
.spinner-blade:nth-child(4) {
  -webkit-animation-delay: 0.249s;
  animation-delay: 0.249s;
  transform: rotate(90deg);
}
.spinner-blade:nth-child(5) {
  -webkit-animation-delay: 0.332s;
  animation-delay: 0.332s;
  transform: rotate(120deg);
}
.spinner-blade:nth-child(6) {
  -webkit-animation-delay: 0.415s;
  animation-delay: 0.415s;
  transform: rotate(150deg);
}
.spinner-blade:nth-child(7) {
  -webkit-animation-delay: 0.498s;
  animation-delay: 0.498s;
  transform: rotate(180deg);
}
.spinner-blade:nth-child(8) {
  -webkit-animation-delay: 0.581s;
  animation-delay: 0.581s;
  transform: rotate(210deg);
}
.spinner-blade:nth-child(9) {
  -webkit-animation-delay: 0.664s;
  animation-delay: 0.664s;
  transform: rotate(240deg);
}
.spinner-blade:nth-child(10) {
  -webkit-animation-delay: 0.747s;
  animation-delay: 0.747s;
  transform: rotate(270deg);
}
.spinner-blade:nth-child(11) {
  -webkit-animation-delay: 0.83s;
  animation-delay: 0.83s;
  transform: rotate(300deg);
}
.spinner-blade:nth-child(12) {
  -webkit-animation-delay: 0.913s;
  animation-delay: 0.913s;
  transform: rotate(330deg);
}

@-webkit-keyframes spinner-fade {
  0% {
    background-color: currentColor;
  }
  100% {
    background-color: transparent;
  }
}

@keyframes spinner-fade {
  0% {
    background-color: currentColor;
  }
  100% {
    background-color: transparent;
  }
}
