/* drop.st.css */
@namespace "Drop";

/* = Project info and vars */
:import {
  -st-from: "./project.st.css";
  -st-default: Base;
  -st-named:
    tablet,
    --color-body,
    --color-shadow,
    --color-border-light,
    --color-selected,
    --color-background-main,
    --spacing-unit;
}

:import {
  -st-from: "../../components/Drop/drop.st.css";
  -st-default: Drop;
}

@st-scope Base {
  Drop {
    margin-bottom: var(--spacing-unit);
  }

  Drop::title {
    padding: calc(1em + var(--spacing-unit)) 0 0;
    margin-bottom: 1em;
  }

  Drop::dropModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 85;
  }

  Drop::dropContent {
    border: 1px solid var(--color-border-light);
    background-color: var(--color-background-main);
    display: flex;
    flex-direction: column;
  }

  /* Height is set dynamically if isMobileModal true */
  Drop:isMobileModal::dropContent {
    height: 100vh;
  }

  Drop::mainContent {
    padding: calc(var(--spacing-unit) * 2);
    overflow-x: auto;
    flex: 1;
  }

  Drop::dropHeader {
    padding: 12px;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--color-body);
  }

  Drop::modalTitle {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  Drop::closeIcon svg {
    width: 16px;
    height: 16px;
    color: var(--color-selected);
  }

  Drop::dropFooter {
    border-top: 1px solid var(--color-border-light);
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
  }

  Drop::actionBtn,
  Drop::clearBtn {
    margin-right: var(--spacing-unit);
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
  }
}

/* Drop modal behaves differently on desktop */
@media value(tablet) {
  @st-scope Base {
    Drop::dropModal {
      position: relative;
    }

    Drop::dropContent {
      box-shadow: 0px 4px 16px var(--color-shadow);
      border-radius: 16px;
      position: absolute;
      left: 0;
      top: 5px;
      color: var(--color-body);
    }

    Drop::mainContent {
      max-height: 250px;
    }

    /* Drop arrow pointing towards the trigger button or chip. */
    Drop::dropArrow {
      width: 12px;
      height: 12px;
      display: block;
      position: absolute;
      left: 24px;
      top: -7px;
      -webkit-transform: rotate(-45deg);
      transform: rotate(-45deg);
      background-color: var(--color-background-main);
      border-top: 1px solid var(--color-border-light);
      border-right: 1px solid var(--color-border-light);
    }
  }
}
