@import (reference) "../variables/legacy-variables.less";
@import (reference) "./mixins/_logical-properties.less";
@import (reference) "./core/_typography.less";

.droppable {
  position: relative;
  .np-text-body-large;

  text-align: center;
  border: 1px solid var(--color-interactive-secondary);
  border-radius: @border-radius-base;
  overflow: auto;
  transition: border-color 0.15s linear;

  &:hover {
    border-color: var(--color-interactive-secondary-hover);
  }

  &:active {
    border-color: var(--color-interactive-secondary-active);
  }

  .np-theme-personal & {
    border-radius: unset;
  }

  @media (--screen-md) {
    border-style: dashed;
  }

  .np-theme-personal &-area {
    border-radius: var(--radius-medium);
    background-color: var(--color-background-neutral);
    padding: var(--padding-medium);
    &,
    &.droppable-dropping .droppable-dropping-card {
      border-color: transparent !important;
    }
    &.tw-droppable-md {
      min-height: 242px;
    }
    &.droppable-dropping {
      .droppable-default-card {
        opacity: 0;
      }
      .tw-icon-plus svg {
        width: var(--size-24);
        height: var(--size-24);
      }
      h4 {
        margin-top: var(--padding-small) !important;
      }
    }
    &.droppable-negative {
      border: 2px solid var(--color-sentiment-negative) !important;
      background-color: var(--color-background-screen);
      min-height: 315px;
    }
    &.droppable-complete {
      .thumbnail {
        margin-bottom: var(--padding-x-small) !important;
      }
    }
    .droppable {
      &-default-card .m-b-3 {
        margin-bottom: var(--padding-small) !important;
      }
      &-dropping-card {
        background-color: var(--color-background-neutral-hover);
      }
      &-card-content .circle {
        padding-top: 0 !important;
      }
    }
    .circle {
      background-color: var(--color-contrast);
      color: var(--color-content-primary)!important;
    }
  }
}

.droppable-card {
  background-color: var(--color-background-screen);
  position: absolute;
  top: 0;
  .left(0);
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: inherit;
  transition: transform 0.3s ease;
}

.droppable-card-content {
  max-width: 100%;
  opacity: 1;
}

.droppable-dropping {
  border-color: var(--color-interactive-secondary-active) !important;
  .np-theme-personal & {
    border-color: var(--color-background-neutral-hover) !important;
    border-style: solid;
  }
}

.droppable-processing,
.droppable-complete {
  border-style: solid;
}

.droppable .thumbnail {
  width: auto;
  max-height: 96px;
  max-width: 96px;
  margin: 0 auto;

  @media (--screen-md) {
    max-height: 128px;
    max-width: 128px;
  }
}

/***** Card variants *****/

.droppable-dropping-card {
  display: none;
  animation: droppable-fade-in 0.15s 0s linear forwards;
  color: var(--color-content-accent);
  // TODO fix with some non-semitransparent color
  background-color: #d8f1fa;
  border-color: var(--color-interactive-accent);
  z-index: 1;

  .np-theme-personal & {
    // is a hex code because can't have transparency
    background-color: #E1E4DF;
    color: var(--color-content-primary);
  }

  .np-theme-personal--dark & {
    // is a hex code because can't have transparency
    background-color: #404440;
  }

  .np-theme-personal--forest-green & {
    // is a hex code because can't have transparency
    background-color: #455C35;
  }
}

.droppable-dropping .droppable-dropping-card {
  display: flex;
}

.droppable-processing .droppable-processing-card {
  display: flex;
  align-items: baseline;
}

.droppable-complete {
  .droppable-processing-card {
    display: flex;
  }
}

.droppable-complete-card {
  display: flex;
}

/***** End card variants *****/

.droppable-active {
  border-style: solid;

  &.droppable-dropping {
    border-style: dashed;
  }
}

.droppable-size(@size, @padding-mobile, @padding-tablet, @padding-desktop) {
  .droppable-@{size} {
    padding: @padding-mobile @padding-mobile;
  }

  @media (--screen-sm) {
    .droppable-@{size} {
      padding: @padding-tablet @padding-mobile;
    }
  }

  @media (--screen-lg) {
    .droppable-@{size} {
      padding: @padding-desktop @padding-tablet;
    }
  }
}

.droppable-size(sm, @spacing-1-mobile, @spacing-1-tablet, @spacing-1-desktop);
.droppable-size(md, @spacing-2-mobile, @spacing-2-tablet, @spacing-2-desktop);
.droppable-size(lg, @spacing-3-mobile, @spacing-3-tablet, @spacing-3-desktop);

@keyframes droppable-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
