@import "@/scss/mixins.scss";
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Montserrat:wght@400..600&display=swap');

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

body {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.heading {
  font-family: "Lora", serif;
  font-optical-sizing: auto;
}

.sans {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-style: normal;
}

h1, h2, h3 {
  font-weight: 500;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

svg {
  fill: currentColor;
}

.ui-slide-from-left {
  opacity: 0;
  transform: translateX(calc(-100% - 30px));
  animation: 0.5s uiSlideFromLeft forwards ease-in;
  animation-delay: 0.3s;
  transform-origin: top right;
}

@keyframes uiSlideFromLeft {
  0% {
    opacity: 0;
    transform: translateX(calc(-100% - 30px));
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.ui-slide-from-right {
  opacity: 0;
  transform: translateX(calc(100% + 30px));
  animation: 0.5s uiSlideFromRight forwards ease-in;
  animation-delay: 0.3s;
  transform-origin: top left;
}

@keyframes uiSlideFromRight {
  0% {
    opacity: 0;
    transform: translateX(calc(100% + 30px));
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.ui-slide-from-right-sidebar {
  transform: translateX(calc(100% + 150px));
  opacity: 0;
  animation: 0.5s uiSlideFromRightSidebar forwards ease-in;
  transform-origin: center left;
}

@keyframes uiSlideFromRightSidebar {
  0% {
    opacity: 0;
    transform: translateX(calc(100% + 150px));
  }

  100% {
    opacity: 100%;
    transform: translateX(0);
  }
}

.ui-slide-from-left-sidebar {
  transform: translateX(calc(-100% - 150px));
  opacity: 0;
  animation: 0.5s uiSlideFromLeftSidebar forwards ease-in;
  transform-origin: center left;
}

@keyframes uiSlideFromLeftSidebar {
  0% {
    opacity: 0;
    transform: translateX(calc(-100% - 150px));
  }

  100% {
    opacity: 100%;
    transform: translateX(0);
  }
}

.ui-slide-from-top {
  opacity: 0;
  transform: translateY(calc(-100% - 30px));
  animation: 0.5s uiSlideFromTop forwards ease-in;
  animation-delay: 0.3s;
  transform-origin: top left;
}

@keyframes uiSlideFromTop {
  0% {
    opacity: 0;
    transform: translateY(calc(-100% - 30px));
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ui-slide-from-bottom {
  opacity: 0;
  transform: translateY(calc(100% + 30px));
  animation: 0.5s uiSlideFromBottom forwards ease-in;
  animation-delay: 0.3s;
  transform-origin: top left;
}

@keyframes uiSlideFromBottom {
  0% {
    opacity: 0;
    transform: translateY(calc(100% + 30px));
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

::-moz-selection {
  background: #aa0d0d40;
  text-shadow: none;
}

::selection {
  background: #aa0d0d40;
  text-shadow: none;
}

pre::-moz-selection,
pre span::-moz-selection {
  color: black;
  background: #af9393d9;
  text-shadow: none;
}
  
pre::selection,
pre span::selection  {
  color: black;
  background: #af9393d9;
  text-shadow: none;
}

.ui-tooltip {
  --color: #ffdada;
  --background: #170505;

  position: absolute;
  opacity: 0;
  color: var(--color);
  background-color: var(--background);
  padding: 2px 10px 4px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  font-weight: 500;
  border-radius: 2px;
  pointer-events: none;
  transition: 0.15s ease-in-out;
  text-wrap: nowrap;
}

.ui-tooltip--reverse {
  --color: #170505;
  --background: #ffdada;
}

.ui-tooltip--left {
  top: 50%;
  right: calc(100% - 5px);
  transform: translateY(-50%) scale(0);
  transform-origin: right center;

  &::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border: 5px solid transparent !important;
    border-left-color: var(--background) !important;
  }
}

.ui-tooltip--right {
  top: 50%;
  left: calc(100% - 5px);
  transform: translateY(-50%) scale(0);
  transform-origin: left center;

  &::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 5px solid transparent !important;
    border-right-color: var(--background) !important;
  }
}

.ui-tooltip--bottom,
.ui-tooltip--bottomRight,
.ui-tooltip--bottomLeft {
  top: calc(100% - 5px);
  left: 50%;
  transform: translateX(-50%) scale(0);
  transform-origin: top center;

  &::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    border: 5px solid transparent !important;
    border-bottom-color: var(--background) !important;
  }
}

.ui-tooltip--bottomRight {
  left: 12px;
  transform: scale(0);
  transform-origin: top left;

  &::after {
    left: 0;
    transform: translateX(0);
  }

  .ui-tooltip-wrapper--small & {
    left: 8px;
  }
}

.ui-tooltip--bottomLeft {
  right: 12px;
  left: auto;
  transform: scale(0);
  transform-origin: top right;

  &::after {
    right: 0;
    left: auto;
    transform: translateX(0);
  }

  .ui-tooltip-wrapper--small & {
    right: 8px;
  }
}

.ui-tooltip--top {
  bottom: calc(100% - 5px);
  left: 50%;
  transform: translateX(-50%) scale(0);
  transform-origin: bottom center;

  &::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 5px solid transparent !important;
    border-top-color: var(--background) !important;
  }
}

.ui-tooltip--topRight {
  left: 12px;
  transform: scale(0);
  transform-origin: top left;

  &::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 100%;
    transform: translateX(0);
    border: 5px solid transparent !important;
    border-top-color: var(--background) !important;
  }

  .ui-tooltip-wrapper--small & {
    left: 8px;
  }
}

@mixin tooltipShow {
  z-index: 1;

  .ui-tooltip {
    opacity: 1;
    z-index: 3;
  }

  .ui-tooltip--left {
    right: calc(100% + 20px);
    transform: translateY(-50%) scale(1);
  }

  .ui-tooltip--right {
    left: calc(100% + 20px);
    transform: translateY(-50%) scale(1);
  }

  .ui-tooltip--top {
    bottom: calc(100% + 10px);
    transform: translateX(-50%) scale(1);
  }

  .ui-tooltip--topRight {
    bottom: calc(100% + 10px);
    transform: scale(1);
  }

  .ui-tooltip--bottom {
    top: calc(100% + 10px);
    transform: translateX(-50%) scale(1);
  }

  .ui-tooltip--bottomRight,
  .ui-tooltip--bottomLeft {
    top: calc(100% + 10px);
    transform: scale(1);
  }
}

.ui-tooltip-wrapper {
  @include hoverOnDesktopActiveOnMobile {
    @include tooltipShow();
  }

  &.ui-tooltip-wrapper--active {
    @include tooltipShow();
  }
}

.ui-tooltip-wrapper--small {
  @include hoverOnDesktopActiveOnMobile {
    .ui-tooltip--right {
      left: calc(100% + 10px) !important;
    }

    .ui-tooltip--left {
      right: calc(100% + 10px);
    }
  }
}
