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

.popup {
  --transition-time: .15s;
  position: fixed!important;
  left: 0;
  top: 0;
  height: 100%;
  max-width: none;
  width: 100%;
  z-index: 3;
  background-color: rgba(0, 0, 0, .3);
  margin: 0;
  padding: 0;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-time) ease-in-out, visibility 0s var(--transition-time) ease-in-out;
  overflow: auto;
  display: flex;

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

  &.active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--transition-time) ease-in-out, visibility 0s 0s ease-in-out;
    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(--transition-time) ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
    
    body.animation-level-0 & {
      transition: none;
    }
  }

  &-centerer {
    margin: auto;
  }

  &-close {
    cursor: pointer;
    color: var(--secondary-text-color);
    z-index: 3;
    text-align: center;
    justify-self: center;
    line-height: 1;
    //transition: color .2s;

    body.animation-level-0 & {
      transition: none;
    }
    
    /* @include hover() {
      color: #000;
    } */
  }

  &-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;
			}
		}
  }
}
