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

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --warning: 27 87% 67%;
    --warning-foreground: 0 0% 98%;
    --success: 173 58% 39%;
    --success-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
    --chart-1: 12 76% 61%;
    --chart-2: 173 58% 39%;
    --chart-3: 197 37% 24%;
    --chart-4: 43 74% 66%;
    --chart-5: 27 87% 67%;
    --radius: 0.5rem;
    --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%;
  }
  .dark {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --warning: 27 87% 67%;
    --warning-foreground: 0 0% 98%;
    --success: 160 60% 45%;
    --success-foreground: 0 0% 98%;
    --border: 0 0% 14.9%;
    --input: 0 0% 14.9%;
    --ring: 0 0% 83.1%;
    --chart-1: 220 70% 50%;
    --chart-2: 160 60% 45%;
    --chart-3: 30 80% 55%;
    --chart-4: 280 65% 60%;
    --chart-5: 340 75% 55%;
    --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%;
  }
  .settlemint-light {
    --button-hover-accent: 221 83% 95%;
    --background: 222.86 87.5% 96.86%;
    --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: 221 84.5% 56.9%;
    --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: 220 77% 57%;
    --accent-foreground: 240 4.8% 95.9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --warning: 27 87% 67%;
    --warning-foreground: 0 0% 98%;
    --success: 173 58% 39%;
    --success-foreground: 0 0% 98%;
    --border: 240 5.9% 90%;
    --input: 0 0% 80%;
    --ring: 221.2 83.2% 53.3%;
    --radius: 0.5rem;
    --chart-1: 12 76% 61%;
    --chart-2: 173 58% 39%;
    --chart-3: 197 37% 24%;
    --chart-4: 43 74% 66%;
    --chart-5: 27 87% 67%;
    --sidebar-background: 220.71 87.5% 93.73%;
    --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%;
    --theme-accent-background: 221 83% 95%;
    --theme-accent-foreground: 221 85% 57%;
  }
  .settlemint-dark {
    --background: 0 0% 16%;
    --foreground: 0 0% 98%;
    --card: 0 0% 22%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 22%;
    --popover-foreground: 0 0% 98%;
    --primary: 219 71% 41%;
    --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: 221 84.5% 56.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --warning: 30 80% 55%;
    --warning-foreground: 0 0% 98%;
    --success: 160 60% 45%;
    --success-foreground: 0 0% 98%;
    --border: 240 3.7% 25.9%;
    --input: 0 0% 30%;
    --ring: 224.3 76.3% 48%;
    --chart-1: 220 70% 50%;
    --chart-2: 160 60% 45%;
    --chart-3: 30 80% 55%;
    --chart-4: 280 65% 60%;
    --chart-5: 340 75% 55%;
    --sidebar-background: 0 0% 11%;
    --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%;
    --theme-accent-background: 240 3.7% 15.9%;
    --theme-accent-foreground: 221 85% 57%;
    --theme-sidebar-accent: 0 0% 16%;
  }

  /* Add transition for all CSS variables */
  :root,
  .settlemint-light,
  .settlemint-dark {
    transition: all 0.3s ease;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
}

@layer components {
  .dropdown-menu-item {
    @apply cursor-pointer px-4 py-4 transition-none text-foreground !important;
    @apply hover:bg-lm-gradient-menu focus:bg-lm-gradient-menu data-[highlighted]:bg-lm-gradient-menu !important;
    @apply dark:hover:bg-dm-gradient-menu-hover dark:focus:bg-dm-gradient-menu-hover dark:data-[highlighted]:bg-dm-gradient-menu-hover !important;
  }

  [data-sidebar="menu-item"] {
    @apply mt-2 p-1;
  }

  [data-sidebar="menu-item"].active {
    @apply bg-[rgba(255,255,255,0.5)] dark:bg-[hsla(0,0%,100%,.06)] dark:text-[#4d80f0] text-primary rounded-xl;
  }

  [data-sidebar="menu-item"] svg {
    @apply size-5 !important;
  }

  [data-sidebar="menu-button"] svg {
    @apply -ml-0 !important;
  }

  [data-variant="sidebar"][data-state="collapsed"] [data-sidebar="menu-item"] {
    @apply w-10 h-10 !important;
  }

  [data-variant="sidebar"][data-state="collapsed"] [data-sidebar="menu-button"] svg {
    @apply -translate-x-[2px] !important;
  }

  [data-sidebar="menu-item"].active:hover > [data-sidebar="menu-button"] {
    @apply text-primary dark:text-[#4d80f0] !important;
  }

  [data-sidebar="menu-item"]:hover {
    @apply bg-[rgba(255,255,255,0.5)] dark:bg-[hsla(0,0%,100%,.06)] rounded-xl;
  }

  [data-sidebar="menu-button"]:hover {
    @apply bg-[rgba(255,255,255,0.5)] rounded-xl;
  }

  [data-sidebar="content"] {
    @apply ml-2 !important;
  }

  .settlemint-light .dropdown-menu-item:is(:hover, :focus, [data-highlighted]) {
    @apply bg-lm-gradient-menu !important;
  }

  .settlemint-dark .dropdown-menu-item:is(:hover, :focus, [data-highlighted]) {
    @apply bg-dm-gradient-menu-hover !important;
  }

  code[data-line-numbers] {
    counter-reset: line;
  }

  code[data-line-numbers] > [data-line]::before {
    counter-increment: line;
    content: counter(line);

    /* Other styling */
    display: inline-block;
    width: 0.75rem;
    margin-right: 2rem;
    text-align: right;
    color: gray;
  }

  code[data-line-numbers-max-digits="2"] > [data-line]::before {
    width: 1.25rem;
  }

  code[data-line-numbers-max-digits="3"] > [data-line]::before {
    width: 1.75rem;
  }

  code[data-line-numbers-max-digits="4"] > [data-line]::before {
    width: 2.25rem;
  }

  code[data-theme*=" "],
  code[data-theme*=" "] span {
    color: var(--shiki-light);
    background-color: var(--shiki-light-bg);
  }

  @media (prefers-color-scheme: dark) {
    code[data-theme*=" "],
    code[data-theme*=" "] span {
      color: var(--shiki-dark);
      background-color: var(--shiki-dark-bg);
    }
  }
}

@layer utilities {
  .shadow-dropdown {
    @apply shadow-[0_0_0_1px_rgba(0,0,0,0.05),0_4px_12px_-4px_rgba(0,0,0,0.2)] dark:shadow-[0_0_0_1px_rgba(255,255,255,0.05),0_4px_12px_-4px_rgba(0,0,0,0.9)];
  }
}
