@import "nprogress/nprogress.css";

@import "docsearch";

body {
  -webkit-font-smoothing: antialiased;

  @apply bg-white;
  .dark & {
    @apply bg-dark-gray-900;
  }
}

#nprogress {
  .bar {
    @apply bg-blue-600;

    .dark & {
      @apply bg-blue-500;
    }

    & {
      height: 3px;
    }
  }

  .peg {
    box-shadow: 0 0 10px theme("colors.blue.600"),
      0 0 5px theme("colors.blue.600");

    .dark & {
      box-shadow: 0 0 10px theme("colors.blue.500"),
        0 0 5px theme("colors.blue.500");
    }
  }
}

hr {
  border-width: 1px;
}

h1,
h2,
h3,
h4 {
  text-transform: none;
  @apply font-bold;
}

.link {
  @apply text-blue-600;
  @apply transition;
  @apply duration-75;
  @apply ease-in-out;

  .dark & {
    @apply text-blue-500;
  }

  &:hover {
    @apply text-blue-500;

    .dark & {
      @apply text-blue-400;
    }
  }
}

.bottom-safe-area-inset {
  @supports (padding: max(0px)) {
    &.inset-3 {
      padding-bottom: max(0.75rem, env(safe-area-inset-bottom)) !important;
    }
    &.inset-2 {
      padding-bottom: max(0.5rem, env(safe-area-inset-bottom)) !important;
    }
  }
}

.home-container {
  // the width is constant on larger devices
  @screen md {
    width: 448px;
  }

  // on smaller screens make the width be auto to fit better
  @screen md-max {
    width: auto;
    max-width: 448px;
  }
}

/* header */
.no-double-tap-zoom {
  touch-action: manipulation;
}

/* navbar */
.navbar {
  z-index: 10;
}

/* sidebar */
@import "./sidebar.scss";

/* docs */
.docs-alert a {
  @extend .link;
  @apply underline;
}

/* docs container */
@import "./docs-container.scss";

/* scroll to top */

.scroll-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
}

/* scrollbars */

body {
  ::-webkit-scrollbar,
  &::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track,
  &::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0;

    .dark & {
      background: rgba(255, 255, 255, 0.1);
    }
  }

  ::-webkit-scrollbar-thumb,
  &::-webkit-scrollbar-thumb {
    cursor: pointer;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.25);
    -webkit-transition: color 0.2s ease;
    transition: color 0.2s ease;

    .dark & {
      background: rgba(255, 255, 255, 0.25);
    }
  }

  ::-webkit-scrollbar-thumb:window-inactive,
  &::-webkit-scrollbar-thumb:window-inactive {
    background: rgba(0, 0, 0, 0.15);

    .dark & {
      background: rgba(255, 255, 255, 0.15);
    }
  }

  ::-webkit-scrollbar-thumb:hover,
  &::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);

    .dark & {
      background: rgba(255, 255, 255, 0.35);
    }
  }
}
