//-----------------------------
// Modals
//-----------------------------

@import '../../scss/vars';
@import '../../scss/theme';
@import '../../scss/helper-mixins';
@import '../../scss/colors';
@import '../../scss/spacing';
@import '../../scss/layout';
@import '../../scss/layer';
@import '../../scss/typography';
@import '../../scss/import-once';
@import '../../scss/css--reset';
@import '../../scss/css--typography';
@import 'mixins';

@import '../button/button';

@include exports('modal') {
  .#{$prefix}--modal {
    @include reset;
    @include font-family;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: z('hidden');
    display: flex;
    align-items: center;
    justify-content: center;
    content: '';
    opacity: 0;
    background-color: $white;
    border-radius: 5px;
    transition: opacity 200ms, z-index 0s 200ms, visibility 0s 200ms;
    visibility: hidden;

    &.is-visible {
      z-index: z('modal');
      opacity: 1;
      transition: opacity 200ms;
      visibility: visible;
    }
  }

  .#{$prefix}--modal--danger {
    @include modal--color($atta-red);
  }

  .#{$prefix}--modal-container {
    @include reset;
    @include layer('pop-out');
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: $white;
    border-radius: 5px;
    min-width: 100%;
    max-height: 100%;
    height: 100%;

    @media (min-width: 600px) {
      height: auto;
      min-width: 500px;
      max-width: 90%;
      max-height: 90%;
    }

    @media (min-width: 1024px) {
      max-width: 70%;
      max-height: 80%;
    }
  }

  .#{$prefix}--modal-header {
    border-radius: 5px 5px 0 0;
    background-color: $blue-01;
    padding: $spacing-md 3% $spacing-md 3%;
  }

  .#{$prefix}--modal-header__label {
    display: none;
  }

  .#{$prefix}--modal-header__heading {
    @include reset;
    @include typescale('delta');
    font-weight: 400;
    color: $white;
  }

  .#{$prefix}--modal-content {
    color: $ui-6;
    padding: $spacing-xl 6% $spacing-xl 6%;
    overflow-y: scroll;
    &__text {
      @include typescale('zeta');
    }
  }

  .#{$prefix}--modal-footer {
    min-height: 70px;
    margin-top: auto;
    display: flex;
    justify-content: center;
    background-color: $modal-footer-background-color;
    padding: $spacing-md $spacing-md;
  }

  .#{$prefix}--modal-close {
    position: absolute;
    top: rem(16px);
    right: rem(16px);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    background-color: transparent;
    border: none;
    padding: 0.25rem 0.25rem 0.125rem;

    &:focus {
      @include focus-outline('border');
    }
  }

  .#{$prefix}--modal-close__icon {
    fill: $white;
  }
}