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

@layer base {
  html,
  body,
  #root {
    @apply w-full h-full overflow-hidden text-text bg-surface;
  }

  /* Never show ligatures */
  :root {
    font-variant-ligatures: none;
  }

  /* The following fixes weird font rendering issues on Linux */
  html[data-platform="linux"] {
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
  }

  ::selection {
    @apply bg-selection;
  }

  /* Disable user selection to make it more "app-like" */
  :not(a),
  :not(input):not(textarea),
  :not(input):not(textarea)::after,
  :not(input):not(textarea)::before {
    @apply select-none cursor-default;
  }

  input,
  textarea {
    &::placeholder {
      @apply text-placeholder;
    }
  }

  .select-all * {
    /*@apply select-all;*/
  }

  a,
  a[href] * {
    @apply cursor-pointer !important;
  }

  table th {
    @apply text-left;
  }

  .hide-scrollbars {
    &::-webkit-scrollbar-corner,
    &::-webkit-scrollbar {
      display: NONE !important;
    }
  }

  /* Style the scrollbars */
  * {
    ::-webkit-scrollbar-corner,
    ::-webkit-scrollbar {
      @apply w-1.5 h-1.5;
    }

    .scrollbar-track,
    ::-webkit-scrollbar-corner,
    ::-webkit-scrollbar {
      @apply bg-transparent;
    }

    &:hover {
      &.scrollbar-thumb,
      &::-webkit-scrollbar-thumb {
        @apply bg-surface-highlight hover:bg-surface-highlight rounded-full;
      }
    }
  }

  .rtl {
    direction: rtl;
  }

  iframe {
    &::-webkit-scrollbar-corner,
    &::-webkit-scrollbar {
      @apply bg-surface-highlight !important;
    }
  }

  :root {
    color-scheme: light dark;
    --transition-duration: 100ms ease-in-out;
    --color-white: 255 100% 100%;
    --color-black: 255 0% 0%;
  }
}
