@import 'scss/variables';
@import 'modules/sidebar';
@import 'modules/navbar';
@import 'modules/modalTabContent';
@import 'modules/links';
@import 'modules/scrollbars';
@import 'settings/main';
@import 'marketplace/main';

.Overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
}

.Modal {
  @include themed {
    color: t($color);
  }

  box-shadow: 0 0 20px rgb(0 0 0 / 30%);
  opacity: 1;
  z-index: -2;
  transition-timing-function: ease-in;
  border-radius: map-get($modal, 'border-radius');
  user-select: none;
  overflow-y: auto;
  transform: scale(0);
  transition: all 0.3s cubic-bezier(0.47, 1.64, 0.41, 0.8);

  &:focus {
    outline: 0;
  }
}

.closePositioning {
  position: absolute;
  top: 3rem;
  right: 3rem;
}

.closeModal {
  display: grid;
  place-items: center;
  padding: 0.5em;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.5s;

  svg {
    font-size: 2em;
  }

  &:hover {
    @include themed {
      background: t($modal-sidebarActive);
    }
  }
}

.ReactModal__Html--open,
.ReactModal__Body--open {
  overflow: hidden;
}

/* modal transition */
.ReactModal__Content--after-open {
  opacity: 1;
  transform: scale(1);
}

.ReactModal__Content--before-close {
  opacity: 0;
  transform: scale(0);
}

#modal {
  height: 80vh;
  width: clamp(60vw, 1200px, 90vw);

  @include themed {
    background-color: t($modal-background);
  }
}

/* fixes for font size on extension */
label,
p,
span.modalLink {
  font-size: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0;
}

h3 {
  font-size: 1.17rem;
}

h5 {
  font-size: 0.8rem;
}

.loaderHolder {
  display: flex;
  gap: 15px;
  flex-flow: column;
  align-items: center;
}

#loader {
  display: inline-block;
  width: 50px;
  height: 50px;

  @include themed {
    border: 3px solid t($modal-sidebar);
    border-radius: 50%;
    border-top-color: t($modal-sidebarActive);
  }

  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.headerExtras {
  display: flex;
  flex-flow: column;
  gap: -1px;
  padding: 10px 0;

  div:nth-child(1) {
    display: flex;
    flex-flow: column;
    gap: 10px;
  }

  form {
    margin-top: 10px;
  }

  .link {
    display: flex;
    flex-flow: row;
    gap: 15px;
    align-items: center;
  }
}

.headerActions {
  display: flex;
  flex-flow: row;
  gap: 20px;
  justify-content: center;
  align-items: center;

  .link {
    display: flex;
    flex-flow: row;
    gap: 15px;
    align-items: center;
  }
}

.marketplaceCondition {
  display: flex;
  flex-flow: row !important;
  gap: -1px;
  justify-content: space-between;
  align-items: center;
}

.languageSettings {
  margin-bottom: 15px;

  .MuiFormGroup-root {
    gap: 5px;
  }

  .MuiFormControl-root {
    width: 100% !important;
    gap: 15px;

    .MuiFormControlLabel-root {
      display: flex;
      flex-direction: row-reverse;
      justify-content: space-between;
      padding: 5px 5px 5px 20px;
      transition: 0.3s;

      @include themed {
        background: t($modal-sidebar);
        border-radius: t($borderRadius);

        &:hover {
          background: t($modal-sidebarActive);
        }
      }
    }
  }
}

.sliderTitle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 15px 0;

  .link {
    display: flex;
    flex-flow: row;
    gap: 15px;
    align-items: center;
  }
}

.moreSettings {
  cursor: pointer;
  display: flex;
  flex-flow: row;
  justify-content: space-between;
  padding: 25px;
  margin-top: 20px;
  transition: 0.5s;

  @include themed {
    background: t($modal-sidebar);
    border-radius: t($borderRadius);
    box-shadow: 0 0 0 1px t($modal-sidebarActive);

    &:hover {
      background: t($modal-sidebarActive);
    }
  }

  svg {
    font-size: 20px;
  }

  .left {
    display: flex;
    flex-flow: row;
    align-items: center;
    gap: 25px;

    svg {
      @include themed {
        background-image: t($slightGradient);
        box-shadow: t($boxShadow);
      }

      padding: 15px;
      border-radius: 100%;
    }
  }

  .content {
    display: flex;
    flex-flow: column;
  }

  .action {
    display: flex;
    flex-flow: row;
    gap: 20px;
    align-items: center;
  }
}

.reminder-info {
  display: flex;
  flex-flow: column;
  position: absolute;
  bottom: 0;
  padding: 15px;
  gap: 15px;

  @include themed {
    background-color: t($modal-secondaryColour);
    border-radius: t($borderRadius);
    border: 1px solid t($modal-sidebarActive);
  }

  button {
    @include basicIconButton(5px, 5px, modal);

    display: flex;
    justify-content: center;
    gap: 15px;

    svg {
      margin: 0 !important;
    }
  }

  svg {
    margin: 0 !important;
  }

  @extend %tabText;
}

.quoteSkeleton {
  margin-top: 5px;
  display: flex;
  flex-flow: column;
  gap: 5px;
  align-items: center;

  div {
    display: flex;
    flex-flow: row;
  }

  .text {
    display: flex;
    flex-flow: column;
    padding: 5px;
  }

  .skeletonAuthor {
    font-size: smaller;
    display: flex;
    flex-flow: row;
    align-items: center;
    gap: 25px;
    padding: 0 20px 0 5px;

    svg {
      @include themed {
        background-color: t($modal-sidebar);
        padding: 10px;
        border-radius: t($borderRadius);
        place-items: center;
      }
    }

    @include themed {
      background-color: t($modal-sidebarActive);
      border-radius: t($borderRadius);
    }

    .title {
      font-size: medium !important;
    }

    .subtitle {
      font-size: smaller !important;
    }
  }
}

.quickLinksSkeleton {
  .circles {
    display: flex;
    flex-flow: row;
    gap: 5px;

    div {
      margin-top: 10px;
      padding: 3px;
      height: 20px;
      width: 20px;
      border-radius: 100%;
      display: grid;
      place-items: center;

      @include themed {
        background-color: t($modal-sidebarActive);
      }
    }
  }
}

.clockSkeleton {
  font-size: 30px !important;
  font-weight: bold;
}
