@charset "utf-8";
@use "../util";
@use "../base/choose";
@use "../base/colors";
@use "../base/lengths";

/**
 * Rules for the Kalamar hint helper.
 */

ul.menu.hint {
  display:     inline-block;
  white-space: normal;
  text-align:  left;
  max-width:   23em !important;
  top:         0;

  > li:first-of-type {
    border-top: {
      width:        1px;
      left-radius:  0;
      right-radius: 0;
    }
  }
}

// Alert bubble
div.alert.hint {
  position:         absolute;
  background-color: colors.$alert-red;
  color:            colors.$nearly-white;
  padding:          lengths.$item-padding;
  margin-top:       8px;
  box-shadow:       choose.$choose-box-shadow;
  width:            auto;
  min-width:        20em;
  max-width:        23em !important;
  transition:       opacity 0.2s ease 0s;

  border: {
    radius:          lengths.$standard-border-radius;
    top-left-radius: 0;
  }

  &::before {
    position:    absolute;
    content:     "";
    display:     block;
    top:         -12px;
    left:        0;
    width:       0;
    white-space: normal; 
    border: {
      width: 0 8px 12px 0;
      style: solid;
      color: colors.$alert-red transparent;
    }
  }
}

// Mirror element for the hint helper
.hint.mirror {
  position:    absolute;
  display:     block;
  left:        0;
  top:         0;
  z-index:     90;
  white-space: pre-wrap;
  height:      0;

  > span {
    opacity:     0;
    white-space: pre-wrap;
    overflow:    hidden;
    display:     inline-block;
    height:      0;
  }

  // TODO: Only in focus
  > div {
    position:   absolute;
    display:    block;
    cursor:     pointer;
    transition: left 0.2s ease 0s;
    top:        0;
    left:       0;
    text-align: left;
    padding:    0;
    border-top: 5px solid colors.$dark-orange;
    height:     10px;
    width:      1.2em;

    &:hover:not(.active) {
      border-top: 10px solid colors.$dark-orange;
    }

    &.active {
      border-top-width: 0;
      height:           0;
      width:            23em;
    }
  }
}
