@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;

    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 240 10% 3.9%;

    --primary: 240 5.9% 10%;
    --primary-foreground: 0 0% 98%;

    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;

    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;

    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;

    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --ring: 240 10% 3.9%;

    --radius: 0.5rem;

    --warning: 38 92% 50%;
    --warning-foreground: 48 96% 89%;

    --topbar-height: 70px;
    --topbar-height-lg: 80px;

    --page-padding-total-y: 2.75rem;
    --page-padding-total-y-md: 4.75rem;

    --page-content-h: calc(100vh - var(--topbar-height) - var(--page-padding-total-y));
    --page-content-h-md: calc(100vh - var(--topbar-height) - var(--page-padding-total-y-md));
    --page-content-h-lg: calc(100vh - var(--topbar-height-lg) - var(--page-padding-total-y-md));
  }

  .dark {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;

    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;

    --popover: 240 10% 3.9%;
    --popover-foreground: 0 0% 98%;

    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;

    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;

    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;

    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;

    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 15.9%;
    --ring: 240 4.9% 83.9%;

    --warning: 48 96% 89%;
    --warning-foreground: 38 92% 50%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply box-border bg-background text-foreground;
  }
}

@layer utilities {
  .min-h-screen {
    min-height: 100vh; /* Fallback */
    min-height: 100dvh;
  }
  .h-screen {
    height: 100vh; /* Fallback */
    height: 100dvh;
  }
  .page-content-h {
    @apply h-[var(--page-content-h)] md:h-[var(--page-content-h-md)] lg:h-[var(--page-content-h-lg)] max-h-[var(--page-content-h)] md:max-h-[var(--page-content-h-md)] lg:max-h-[var(--page-content-h-lg)];
  }
}

*::-webkit-scrollbar {
  width: 6px;
  transform: translateX(-4px);
}

*::-webkit-scrollbar-thumb {
  @apply relative rounded-full bg-border
}

*::-webkit-scrollbar-track {
  @apply flex touch-none select-none transition-colors
}

input:-webkit-autofill,
input:-webkit-autofill:focus {
  transition: background-color 0s 600000s, color 0s 600000s !important;
}

a {
  display: contents;
  text-decoration: none;
}

@layer components {
  .customSpinner {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    }

    @keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
  }
}
