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

.drops-container {
  --padding: 0px;
  position: absolute !important;
  z-index: 3;
  top: var(--padding);
  right: var(--padding);
  bottom: var(--padding);
  left: var(--padding);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  user-select: none;
  width: auto !important;

  &:not(.is-visible) {
    display: none;
  }

  &.is-visible {
    animation: fade-in-opacity .2s linear forwards;

    &.backwards {
      animation: fade-in-backwards-opacity .2s linear forwards;
    }
  }
}

.drop {
  --wrapper-padding: -4px;
  background-color: var(--surface-color);
  position: relative;
  //height: 100%;
  border-radius: $border-radius-big;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #a2acb4;
  transition: color .2s ease-in-out;
  pointer-events: all;
  flex: 1 1 auto;

  &-outline {
    &-wrapper {
      position: absolute;
      top: var(--wrapper-padding);
      right: var(--wrapper-padding);
      bottom: var(--wrapper-padding);
      left: var(--wrapper-padding);
      pointer-events: none;
    }

    &-path {
      fill: none;
      stroke-dasharray: 13.5, 11;
      stroke: #a2acb4;
      stroke-width: 2;
      stroke-linecap: round;
      transition: stroke .2s ease-in-out;
      stroke-dashoffset: 0;

      .drop.is-dragover & {
        animation: drop-outline-move .5s linear infinite;
        stroke: var(--primary-color);
      }

      /* .drop.is-dragover.backwards & {
        //animation: drop-outline-backwards-move .5s linear forwards;
        animation-direction: reverse;
        animation-fill-mode: forwards;
      } */
    }
  }

  &-icon {
    font-size: 6rem;
  }

  &-header {
    font-weight: var(--font-weight-bold);
    font-size: 1.25rem;
    
    &:not(:last-child) {
      margin-top: -10px;
    }
  }

  @media only screen and (max-height: 670px) {
    &-icon {
      font-size: 0;
    }
    &-header {
      margin-top: 0px;
    }
  }

  &.is-dragover {
    color: var(--primary-color);
  }

  & + & {
    margin-top: 10px;
  }
}

@keyframes drop-outline-move {
  0% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: -24.5;
  }
}

body.is-dragging {
  .page-chats {
    pointer-events: none;
  }
}
