@import "./variables";

.f-dialog-main {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: $zIndex * 100;
  overflow: hidden;
  outline: 0;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
  &:before {
    content: "";
    width: 100%;
    height: 100vh;
    // padding-right: 17px;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(black, 0.5);
  }
  .f-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
    z-index: $zIndex * 1000000;
    display: flex;
    transform: translate(0, -25%);
    transition: all 0.3s ease-out;

    &.f-dialog-small {
      max-width: 375px;
    }
    &.f-dialog-medium {
      max-width: 500px;
    }
    &.f-dialog-large {
      max-width: 700px;
    }
    .f-dialog-content {
      position: relative;
      display: flex;
      flex-direction: column;
      width: 100%;
      pointer-events: auto;
      background-clip: padding-box;
      outline: 0;
      border-radius: $borderRadiusBase * 4;
      transition: $transition;
      .close-dialog {
        cursor: pointer;
        svg {
          width: 15px;
        }
      }
      .f-dialog-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem $spacer;
        h3 {
          font-size: 1.5rem;
          margin: 0.5rem 0;
        }
        &:not(.close-dialog) {
          width: 100%;
          text-align: center;
        }
      }
      .f-dialog-body {
        padding: 2rem $spacer;
      }
      &.bg-dark {
        background: #212b36;
        color: white;
      }
      &.bg-light {
        background: white;
        color: #212b36;
        .close-dialog {
          img,
          rect {
            filter: invert(0%) sepia(5%) saturate(7500%) hue-rotate(228deg) brightness(0%) contrast(106%);
          }
        }
      }
      &.bg-futuristic-primary {
        position: relative;
        border-radius: 0;
        padding: 1rem 0;
        .close-dialog {
          top: -0.25rem;
          right: 1rem;
          position: relative;
        }
        &:before {
          content: "";
          height: 70%;
          width: 100%;
          position: absolute;
          top: 50%;
          // left: -10px;
          transform: translateY(-50%);
          // width: calc(100% - 10px);
          background: $cardColor;
          border-width: 0 2px 0 2px !important;
          border-style: solid !important;
          border-color: #efcd8f !important;
          z-index: -1;
        }

        .img-futuristic {
          // position: absolute;
          z-index: -1;
          img {
            position: absolute;
          }
          &.top {
            img {
              top: 0;
              // width: 100%;
              &:first-child {
                left: 0;
              }
              &:last-child {
                right: 0;
                transform: scaleX(-1);
              }
            }
          }
          &.bottom {
            img {
              bottom: 0;
              &:first-child {
                left: 0;
                transform: rotate(-180deg) scaleX(-1);
              }
              &:last-child {
                right: 0;
                transform: rotate(-180deg);
              }
            }
          }
        }
        // background: url("../images/dialog-futuristic-primary-fbg.svg") left top no-repeat;
        // background-size: cover;
        // .f-dialog-header {
        //   &:before,
        //   &:after {
        //     width: 100%;
        //     height: 100%;
        //     position: absolute;
        //     top: 0;
        //     z-index: 0;
        //   }
        //   &:before {
        //     content: "";
        //     background: url("../images/dialog-futuristic-primary.svg") left top no-repeat;
        //     // background-size: contain;
        //     left: 0;
        //   }
        //   &:after {
        //     content: "";
        //     background: url("../images/dialog-futuristic-primary.svg") right top no-repeat;
        //     // background-size: 50% 50%;
        //     transform: scaleX(-1);
        //     right: 0;
        //   }
        // }
        // .f-dialog-body {
        //   margin: 1.75rem auto;
        //   padding: 0rem 1.75rem;
        //   background: rgba(36, 43, 53, 1);
        //   // border-width: 0 1px 0 1px !important;
        //   // border-style: solid !important;
        //   // border-color: #efcd8f !important;
        //   &:before,
        //   &:after {
        //     width: 100%;
        //     height: 100%;
        //     position: absolute;
        //     bottom: 0;
        //     z-index: 0;
        //   }
        //   &:before {
        //     content: "";
        //     background: url("../images/dialog-futuristic-primary.svg") left bottom no-repeat;
        //     // background-size: contain;
        //     transform: rotate(-180deg);
        //     left: 0;
        //   }
        //   &:after {
        //     content: "";
        //     background: url("../images/dialog-futuristic-primary.svg") right bottom no-repeat;
        //     // background-size: contain;
        //     transform: rotate(-180deg) scaleX(-1);
        //     right: 0;
        //   }
        // }
      }
    }
  }
  &.show {
    opacity: 1;
    overflow-x: hidden;
    overflow-y: auto;
    .f-dialog {
      top: 0;
      transform: translate(0, 0);
      &.f-dialog-center {
        align-items: center;
        min-height: calc(100% - (1.75rem * 2));
      }
    }
  }
  @media screen and (max-width: 680px) {
    .f-dialog {
      margin: 0 !important;
      height: 100vh !important;
      max-width: 100% !important;
      align-items: flex-end !important;
      .f-dialog-content {
        height: 80vh;
        max-height: 80vh !important;
        width: 100%;
        overflow-y: auto;
        .f-dialog-body {
          overflow-y: auto;
        }
      }
    }
    &.show {
      .f-dialog {
        bottom: 0 !important;
        .f-dialog-content {
        }
      }
    }
  }
}
