@use '../../assets/styles/variables' as *;
@use '../../assets/styles/mixins' as *;
@use '../../assets/styles/headings' as *;

@mixin customScroll {
  // TODO: temp solution specifically for modal,
  // take a closer look to simplebar-react
  overflow-y: auto;

  // firefox
  @-moz-document url-prefix() {
    scrollbar-width: thin;
    scrollbar-color: #fff rgba(#fff, 0.1);
  }

  // chrome
  &::-webkit-scrollbar {
    width: 19px;
  }

  &::-webkit-scrollbar-track,
  &::-webkit-scrollbar-thumb {
    background-clip: padding-box;
    border-style: solid;
    border-color: transparent;
  }

  &::-webkit-scrollbar-track {
    border-width: 12px 9px;
    background-color: rgba(#fff, 0.1);
  }

  &::-webkit-scrollbar-thumb {
    border-width: 12px 8px;
    background-color: #fff;
    border-radius: 1px;
  }
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 32px;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(7.5px);
  z-index: 10;
}

.modal {
  width: 100%;
  filter: drop-shadow(0px 4px 4px #00000040);

  &.normal {
    max-width: 400px;
  }

  &.large {
    max-width: 560px;
  }
}

.header {
  // border on .header and .body instead of .modal,
  // cuz otherwise .modal should have overflow: hidden
  display: flex;
  justify-content: space-between;
  padding: 17px 32px 22px;
  background-color: #222225;
  border-left: $borderModal;
  border-right: $borderModal;
  border-top: $borderModal;
  border-radius: $borderRadiusMedium $borderRadiusMedium 0 0;
}

.body {
  @include customScroll;
  padding: 32px;
  background-color: #29292b;
  border-left: $borderModal;
  border-right: $borderModal;

  &.withoutFooter {
    border-bottom: $borderModal;
    border-radius: 0 0 $borderRadiusMedium $borderRadiusMedium;
  }
}

.footer {
  padding: 24px 32px;
  background-color: #222225;
  border-left: $borderModal;
  border-right: $borderModal;
  border-bottom: $borderModal;
  border-radius: 0 0 $borderRadiusMedium $borderRadiusMedium;
}

.heading {
  @include heading(24px, 31px, 500);
  margin-right: 16px;
  color: rgba(#fff, 0.8);
  text-align: center;
}