@use "../styles/mixins.scss";

.prompt {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1) translateZ(0);
  z-index: 112;
  height: fit-content;
  max-height: 80vh;
  width: 100vw;
  max-width: 320px;
  background-color: rgb(255, 255, 255);
  background-color: var(--popup-background-color);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 16px var(--box-shadow-color);
  border-radius: 2px !important;
  border-radius: var(--popup-border-radius) !important;
  overflow: hidden;

  border: solid 1px transparent;
  border: solid 1px var(--popup-border-color);

  display: flex;
  flex-direction: column;

  &.box {
    z-index: 113;
  }

  &.multi {
    textarea:not(:first-of-type) {
      margin-top: 20px;
    }
  }

  &.confirm,
  &.alert {
    .title {
      text-transform: uppercase;
    }
  }

  &.select {
    min-width: 220px;
    width: fit-content;
    max-width: 320px;

    ul li :nth-child(2) {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tile,
    .title {
      justify-content: center;
    }

    .no-text-transform {
      li {
        text-transform: initial !important;
      }

      .file {
        background-position: center;
      }
    }
  }

  ul {
    overflow-y: auto;
    padding: 10px;
    list-style: none;

    li {
      &.selected span {
        color: rgb(169, 0, 0) !important;
        color: var(--popup-active-color) !important;
      }

      &:not(:last-child) {
        border-bottom: 0.02rem solid rgba(122, 122, 122, 0.227);
        border-bottom: 0.02rem solid var(--border-color);
      }

      &:focus {
        background-color: rgba($color: #000000, $alpha: 0.1);
      }

      height: 40px;
      text-transform: uppercase;

      display: flex;
      align-items: center;
      justify-content: center;
      color: rgb(37, 37, 37);
      color: var(--popup-text-color);
    }
  }

  &+.mask {
    z-index: 111;
    background-color: rgb(0, 0, 0);
    opacity: 0.4;
  }

  &.hide {
    transition: all 200ms ease-out;
    transform: translate(-50%, -50%) scale(0.95) translateZ(0);
    opacity: 0;

    &+.mask {
      opacity: 0;
    }
  }

  .title {
    display: flex;
    align-items: center;
    font-size: 1.25em;
    color: rgb(37, 37, 37);
    color: var(--secondary-text-color);
    word-wrap: break-word;
    overflow: auto;

    &:not(:empty) {
      min-height: 40px;
      margin: 5px 10px 0 10px;
    }
  }

  .message {
    overflow: auto;
    font-size: 0.9em;

    &.color-picker {
      .button-container {
        margin: 0;
      }
    }

    .picker_wrapper {
      background-color: inherit;
      box-shadow: none;
      margin: auto;

      .picker_selector {
        border: solid 1px rgb(37, 37, 37);
        border: solid 1px var(--popup-text-color);
        box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2);
        box-shadow: 0 0 2px 0 var(--box-shadow-color);
      }

      .picker_hue {
        .picker_selector {
          border-radius: 0;
          padding: 10px 2px;
        }
      }

      .picker_alpha {
        .picker_selector {
          border-radius: 0;
          padding: 2px 10px;
        }
      }

      .picker_sample,
      .picker_done {
        display: none;
      }

      .picker_editor {
        width: 100%;

        input {
          text-align: center;
          background-color: rgb(0, 0, 0) !important;
          mix-blend-mode: difference;
          color: inherit;
        }
      }
    }

    img {
      max-width: 100%;
      max-height: 100%;
      margin: auto;
      display: flex;
    }

    &.loader {
      display: flex;
      align-items: center;

      .loader {
        @include mixins.circular-loader(30px);
        margin: 0 10px;
      }

      .message {
        display: flex;
        align-items: center;
        overflow: auto;
        font-size: 0.9em;
      }
    }

    .message,
    &:not(.loader) {
      color: #252525;
      color: var(--popup-text-color);
      padding: 10px;
      min-height: 40px;
      font-size: 1.2em;
    }
  }

  .input-group {
    display: flex;
    min-height: 40px;
    margin: 2.5px auto;
    width: 100%;
    flex-wrap: wrap;
    max-width: 300px;

    .hero {
      display: flex;
      align-items: center;
      height: 40px;
      width: 100%;
      font-size: 1.2em;
    }

    .input-checkbox {
      height: 40px;
      width: 50%;
    }
  }

  .input {
    max-height: calc(100vh - 80px);
    width: 100%;
    max-width: 300px;
    background-color: inherit;
    border: none;
    color: rgb(37, 37, 37);
    color: var(--popup-text-color);
    border-bottom: solid 1px currentColor;
    text-indent: 0;
    font-size: 1em;
    margin: 2.5px auto;

    &::placeholder {
      opacity: 0.4;
    }

    &:focus {
      border-bottom: solid 1px rgb(51, 153, 255);
      border-bottom: solid 1px var(--active-color);
    }
  }

  li {
    .icon {
      font-size: 0.85em;
    }
  }

  .error-msg {
    color: rgb(255, 185, 92) !important;
    color: var(--error-text-color) !important;
    height: fit-content;

    &:not(:empty) {
      margin: 10px auto 0 auto;
    }
  }

  .button-container {
    margin-top: 20px;
  }
}