/* ---- Dialog Boxes ---- */

.modal-open .modal {
  // Bootstrap default is to hide, overriding with JS.
  // But we use React; we only _render_ if it's not hidden. Undo the
  // Bootstrap-ism.
  display: block;
}

@mixin modal-backdrop {
  background: black;
  opacity: 0;
}

.modal-backdrop {
  @include modal-backdrop;
}

$modal-inner-hpadding: badrem(2.5);
$modal-inner-vpadding: badrem(2);

@mixin modal-header {
  border-radius: 0.5rem 0.5rem 0 0;
  height: 6rem;
  padding: $modal-inner-vpadding $modal-inner-hpadding;
  background-color: $modal-color;
  border-bottom: 0px;
  display: flex;
  justify-content: space-between; // h5 on left, close button on right
  align-items: center;
  cursor: default;

  h5,
  .modal-title {
    @include title-2;
    font-weight: bold;
    color: white;
    opacity: 1;
    padding: 0;
    margin: 0;
  }

  .close {
    cursor: pointer;
    font-size: 2.5rem;
    color: white;
    opacity: 0.6; // TODO why white+opacity? Let's pick the color we want.
    &:hover {
      opacity: 1;
    }
  }
}

.modal-dialog {
  top: 10vh;
  box-shadow: $modal-shadow;
  border-radius: 1rem;

  .modal-content {
    border: 0;
    border-radius: 0.5rem;
    overflow: hidden; // for box shadow in footer
  }

  .modal-header {
    @include modal-header;
  }

  .modal-body {
    background-color: white;
    padding: $modal-inner-vpadding $modal-inner-hpadding;
    overflow: auto; // scroll vertically if needed
    max-height: 70vh;

    .info {
      @include info-2;
      color: $brand-text--dark;
    }

    .code-snippet {
      margin-top: 0.5rem;
      background-color: $dark-accent--soft;
      border-radius: 3px;
      padding: 1.5rem;

      .chart-embed {
        color: $brand-text--dark;
        @include content-1;
        margin-bottom: 0;
        border-radius: 3px;
        word-wrap: break-word;
      }
    }
  }

  /* imported modal settings */
  .modal-footer {
    border-radius: 0 0 0.5rem 0.5rem;
    border-top: 0;
    padding: 1.5rem $modal-inner-hpadding;
    display: flex;
    justify-content: flex-end;
    background-color: $modal-footer;
    position: relative;
    box-shadow: 0px -16px 20px white;

    button {
      margin-left: 1.5rem;
    }

    .action-button {
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }

  .input-dropdown {
    height: 4rem !important;
    color: #686768;
    background-color: #ffffff;
    font-size: 1.4rem;
    font-weight: normal;
    line-height: 1.4rem;
    border-radius: 0px;
    border: 1px solid $Vlight-gray;
  }

  // Share workflow modal

  .dl-file {
    @include content-1;
    color: $labels;
  }

  .clipboard {
    @include content-1;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    cursor: pointer;
    color: $brand-workspace;
    &.copied {
      color: $brand-orange;
    }
  }

  .share-links {
    margin-top: 2rem;

    a {
      margin-right: 1.6rem;
      text-decoration: none;
      background-color: black; // override me in actual share links
      color: white;
      align-items: center;
      border-radius: 3px;
      @include font-sans-regular;
      font-size: 1.3rem;
      padding: 0.5rem 1rem;

      i {
        margin-right: 0.8rem;
      }

      &.facebook-share {
        background-color: #4267b2;

        &:hover {
          background-color: #365899;
        }
      }

      &.twitter-share {
        background-color: #1b95e0;

        &:hover {
          background-color: #0c7abf;
        }
      }
    }
  }
}
