/**
 *
 * @ai-apps/angular v2.152.0 | _composed-modal.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


@import '../../globals/vars';
@import '../../globals/layout';

.#{$iot-prefix}--composed-modal {
  .#{$prefix}--modal-container {
    @media (min-height: carbon--rem(515px)) {
      overflow-y: auto;
    }
  }

  .#{$prefix}--overflow-menu-options {
    // TODO: Can remove once this issue is fixed: https://github.com/carbon-design-system/carbon/issues/6662
    z-index: 10000;
  }

  .#{$prefix}--tooltip {
    // TODO: Can remove once this issue is fixed: https://github.com/carbon-design-system/carbon/issues/6662
    z-index: 10000;
  }

  /* support large modals for ll the sizes */
  &.#{$iot-prefix}--composed-modal--large {
    .#{$prefix}--modal-header {
      margin-bottom: 0;
    }
    .#{$prefix}--modal-container {
      min-height: carbon--rem(600px);
      min-width: carbon--rem(800px);
      max-height: 80%;
      @media (min-width: carbon--rem(600px)) {
        height: auto;
      }
      @media (min-width: carbon--rem(1024px)) {
        max-width: 80%;
      }
      @media (min-width: carbon--rem(1200px)) {
        max-width: 60%;
      }
    }
  }

  &.#{$iot-prefix}--composed-modal--full-screen {
    & > .#{$prefix}--modal-container {
      $min-width: calc(100% - #{$layout-02});
      min-height: $min-width;
      min-width: $min-width;
      max-height: 80%;
      @media (min-width: carbon--rem(1024px)) {
        min-width: $min-width;
      }
      @media (min-width: carbon--rem(1200px)) {
        min-width: $min-width;
      }

      .#{$prefix}--modal-header {
        margin-bottom: 0;
      }
    }
  }

  /* Needed for buttons when they're next to each other */

  .#{$prefix}--modal-header__heading {
    margin-bottom: $spacing-04;
  }

  .#{$prefix}--modal-content {
    min-height: carbon--rem(200px);
  }
}

.#{$iot-prefix}--composed-modal--inline-notification {
  width: calc(100% - 1rem * 2);
  margin: $spacing-05 auto;
}

.#{$iot-prefix}--composed-modal-footer {
  justify-content: flex-end;

  & > * {
    width: 100%;
  }

  .modal-greedy-spacer {
    flex-grow: 2;
    text-align: left; // needed to override the dialog style
  }
}

.#{$iot-prefix}--composed-modal__body--small-margin-bottom {
  margin-bottom: $spacing-05;
}
