@import 'tailwindcss';

@plugin 'tailwindcss-animate';

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

@utility container {
  margin-inline: auto;
  padding-inline: 2rem;
  /* Fixed theme() function usage */
  @media (width >= theme(--breakpoint-sm)) {
    max-width: none;
  }
  @media (width >= 1400px) {
    max-width: 1400px;
  }
}

/*
  The default border color has changed to `currentcolor` in Tailwind CSS v4,
  so we've added these compatibility styles to make sure everything still
  looks the same as it did with Tailwind CSS v3.

  If we ever want to remove these styles, we need to add an explicit border
  color utility to any element that depends on these defaults.
*/
@layer base {
  *,
  ::after,
  ::before,
  ::backdrop,
  ::file-selector-button {
    border-color: var(--color-gray-200, currentcolor);
  }
}

@layer base {
  /* Light theme moved under .light class so dark becomes default */
  .light {
    --background: 0 0% 100%;
    --foreground: 222.2 47.4% 11.2%;

    --danger: #ff5555;
    --overlay: rgba(0, 0, 0, 0.8);

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 47.4% 11.2%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 47.4% 11.2%;

    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;

    --destructive: 0 100% 50%;
    --destructive-foreground: 210 40% 98%;

    --ring: 215 20.2% 65.1%;

    --radius: 0.5rem;

    width: 100vw;
    height: 100vh;

    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%;
    /* Added missing vars for parity */
    --accent-primary: #0d8ec0;
    --accent-secondary: #08739c;
    --accent-tertiary: #e6f8fe;
    --http-get: #228c22;
    --http-put: #0066cc;
    --http-post: #7a3ff2;
    --http-delete: #d0345b;
    --http-patch: #d88219;
    --success: #1f874b;
    --error: #c04040;
    --warning: #d9901a;
    --svg-dark-gray: #444444;
    --svg-medium-gray: #777777;
    --svg-gray: #666666;
    --svg-dark-gray-2: #555555;
    --svg-light-gray: #999999;
    --svg-teal: #0f2f38;
    --disabled: #cccccc;
    --tertiary: 195 85% 48%;
    --tertiary-foreground: 0 0% 100%;
    --divider: 214.3 31.8% 91.4%;
    color-scheme: light;
  }

  :root {
    /* Accent */
    --accent-primary: #75d9fb;
    --accent-secondary: #12b1e7;
    --accent-tertiary: #193641;
    --overlay: rgba(0, 0, 0, 0.8);

    /* Background */
    --background-primary: #111111;
    --background-secondary: #1f1f1f;
    --background-tertiary: transparent;

    /* Text */
    --text-primary: #eeeeee;
    --text-secondary: #bbbbbb;

    /* Additional */
    --http-get: #93f176;
    --http-put: #37abff;
    --http-post: #9f72fe;
    --http-delete: #ee5c99;
    --http-patch: #efa349;
    --disabled: #444444;

    /* State */
    --success: #2bb361;
    --error: #bd5151;
    --warning: #f9aa2d;

    /* SVG Colors */
    --svg-dark-gray: #282828;
    --svg-medium-gray: #717070;
    --svg-gray: #565656;
    --svg-dark-gray-2: #474747;
    --svg-light-gray: #828282;
    --svg-teal: #1a3e4c;

    /* Scrollbar */
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.5);

    /* Old */
    --background: 0 0% 6.67%;
    --foreground: 213 31% 91%;

    --muted: 0 0% 20%;
    --muted-foreground: 0 0% 100%;

    --accent: 216 34% 17%;
    --accent-foreground: 210 40% 98%;

    --popover: 224 71% 4%;
    --popover-foreground: 215 20.2% 65.1%;

    --border: 0 0% 20%;
    --input: 216 34% 17%;

    --card: 0 0% 12%;
    --card-foreground: 213 31% 91%;

    --primary: 195 94% 72%;
    --primary-foreground: 0 0% 13%;

    --secondary: 196.5 44.44% 17.65%;
    --secondary-foreground: 195 94% 72%;

    --tertiary: 195.21 85.54% 48.82%;
    --tertiary-foreground: 0 0% 13%;

    --destructive: 0 63% 31%;
    --destructive-foreground: 210 40% 98%;

    --ring: 216 34% 17%;

    --divider: 0 0% 20%;

    --radius: 0.5rem;

    --sidebar-background: 240 5.9% 10%;

    --sidebar-foreground: 240 4.8% 95.9%;

    --sidebar-primary: 224.3 76.3% 48%;

    --sidebar-primary-foreground: 0 0% 100%;

    --sidebar-accent: 240 3.7% 15.9%;

    --sidebar-accent-foreground: 240 4.8% 95.9%;

    --sidebar-border: 240 3.7% 15.9%;

    --sidebar-ring: 217.2 91.2% 59.8%;
    color-scheme: dark;
  }
}

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

  body {
    @apply bg-background text-foreground;
    font-feature-settings:
      'rlig' 1,
      'calt' 1;
  }
}

@theme {
  --radius-lg: var(--radius);
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 4px);

  --color-background: hsl(var(--background));
  --color-background-primary: var(--background-primary);
  --color-background-secondary: var(--background-secondary);
  --color-background-tertiary: var(--background-tertiary);

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

  --color-card: hsl(var(--card));
  --color-card-foreground: hsl(var(--card-foreground));

  --color-popover: hsl(var(--popover));
  --color-popover-foreground: hsl(var(--popover-foreground));

  --color-primary: hsl(var(--primary));
  --color-primary-foreground: hsl(var(--primary-foreground));

  --color-secondary: hsl(var(--secondary));
  --color-secondary-foreground: hsl(var(--secondary-foreground));

  --color-tertiary: hsl(var(--tertiary));
  --color-tertiary-foreground: hsl(var(--tertiary-foreground));

  --color-muted: hsl(var(--muted));
  --color-muted-foreground: hsl(var(--muted-foreground));

  --color-accent: hsl(var(--accent));
  --color-accent-foreground: hsl(var(--accent-foreground));
  --color-accent-primary: var(--accent-primary);
  --color-accent-secondary: var(--accent-secondary);
  --color-accent-tertiary: var(--accent-tertiary);

  --color-destructive: hsl(var(--destructive));
  --color-destructive-foreground: hsl(var(--destructive-foreground));

  --color-border: hsl(var(--border));
  --color-input: hsl(var(--input));
  --color-ring: hsl(var(--ring));
  --color-divider: hsl(var(--divider));

  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);

  --color-http-get: var(--http-get);
  --color-http-put: var(--http-put);
  --color-http-post: var(--http-post);
  --color-http-delete: var(--http-delete);
  --color-http-patch: var(--http-patch);

  --color-state-success: var(--success);
  --color-state-error: var(--error);
  --color-state-warning: var(--warning);

  --color-svg-dark-gray: var(--svg-dark-gray);
  --color-svg-medium-gray: var(--svg-medium-gray);
  --color-svg-gray: var(--svg-gray);
  --color-svg-dark-gray-2: var(--svg-dark-gray-2);
  --color-svg-light-gray: var(--svg-light-gray);
  --color-svg-teal: var(--svg-teal);

  --color-danger: var(--danger);
  --color-disabled: var(--disabled);
  --color-overlay: var(--overlay);

  --color-sidebar: hsl(var(--sidebar-background));
  --color-sidebar-foreground: hsl(var(--sidebar-foreground));
  --color-sidebar-primary: hsl(var(--sidebar-primary));
  --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
  --color-sidebar-accent: hsl(var(--sidebar-accent));
  --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
  --color-sidebar-border: hsl(var(--sidebar-border));
  --color-sidebar-ring: hsl(var(--sidebar-ring));
}
