/*
 * https://github.com/morethanwords/tweb
 * Copyright (C) 2019-2021 Eduard Kuzmenko
 * https://github.com/morethanwords/tweb/blob/master/LICENSE
 */

.popup {
  position: fixed!important;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  max-width: none;
  z-index: 3;
  background-color: rgba(0, 0, 0, .3);
  margin: 0;
  padding: 1.875rem;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transition-property: opacity, visibility;
  transition-duration: var(--popup-transition-time), 0s;
  transition-delay: 0s, var(--popup-transition-time);
  transition-timing-function: var(--popup-transition-function);
  overflow: auto;
  display: flex;

  body.animation-level-0 & {
    transition: none;
  }

  &.active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s, 0s;
    z-index: 4;

    .popup-container {
      transform: translate3d(0, 0, 0);
    }
  }

  &.hiding {
    .popup-container {
      transform: translate3d(0, 0, 0);
    }
  }

  &-container {
    position: relative;
    /* max-width: 400px; */
    border-radius: $border-radius-medium;
    background-color: var(--surface-color);
    padding: 1rem;
    transform: translate3d(0, 3rem, 0);
    backface-visibility: hidden;
    transition: transform var(--popup-transition-time) var(--popup-transition-function);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
    
    body.animation-level-0 & {
      transition: none;
    }
  }

  &-centerer {
    margin: auto;
  }

  &-close {
    z-index: 3;
    justify-self: center;
    flex: 0 0 auto;
  }

  &-header {
    display: flex;
    margin-bottom: 2rem;
    align-items: center;
  }

  &-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    .scrollable {
      position: relative;
    }
  }

  &-buttons {
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
    align-items: flex-end;
    
    &-row {
      flex-direction: row-reverse;
      justify-content: flex-start;

      .btn {
        & + .btn {
          margin-top: 0 !important;
          margin-right: 1.125rem;
        }
      }
    }
		
		.btn {
      font-weight: 500;
			padding: .5rem;
			text-transform: uppercase;
			border-radius: $border-radius;
      position: relative;
      overflow: hidden;
      max-width: 100%;
      white-space: nowrap;
      text-overflow: ellipsis;

			& + .btn {
        margin-top: .5rem;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
			}
		}
  }
}
