// See COPYRIGHT.md for copyright information

@import url("form-controls.less");

#ixv {
  .menu {
    line-height: var(--top-bar-height);

    .menu-title {
      line-height: var(--top-bar-height);
      padding: 0 2.4rem 0 0.3rem;
      position: relative;
      border: none;
    }

    .menu-title::after {
      .icon-chevron-down();

      cursor: pointer;
      font-size: 1.8rem;
      position: absolute;
      right: 0.2rem;
    }

    .menu-title::before {
      cursor: pointer;
    }

    .content-container {
      // Fixed position so that we can scroll if the menu is taller than the
      // remaining page space, but this means we need to calculate the top
      // position manually.
      position: fixed;
      top: calc(var(--top-bar-height));
      right: 0;
      bottom: 0;
      display: none;
      z-index: 5;

      .content {
        line-height: initial;
        background: var(--colour-bg);
        border: solid 1px var(--colour-border-grey);
        max-height: 100%;
        overflow-y: auto;

        .group {
          margin-bottom: 1rem;
        }

        .item {
          position: relative;
          padding: 10px 25px 10px 30px;
          white-space: nowrap;
          text-align: left;

          &:hover {
            background: var(--colour-row-hover);
          }

          &:focus-within {
            outline: solid 2px var(--colour-foreground);
            outline-offset: -2px;
          }

          &.menu-checkbox {
            cursor: pointer;
            user-select: none;
            position: relative;
            display: block;

            // Hide the standard checkbox
            input {
              position: absolute;
              opacity: 0;
              cursor: pointer;
              height: 0;
              width: 0;
            }

            input:checked ~ .checkmark::before {
              .icon-tick();

              position: absolute;
              top: 1.1rem;
              left: 1rem;
            }
          }
        }

        a.item {
          display: block;
          color: var(--colour-text);

          &:hover {
            text-decoration: none;
          }
        }

        .label {
          text-transform: uppercase;
          font-weight: bold;
          font-size: 1.2rem;
          text-align: left;
          padding-top: 1rem;
          color: var(--colour-border-grey);
          border-bottom: solid 1px var(--colour-border-grey);
          padding-left:1rem;
        }
      }
    }

    // A menu whose content should render inline in its container (e.g. a
    // settings page section) rather than as a fixed-position dropdown.
    &.inline-menu {
      line-height: initial;

      .content-container {
        position: static;
        display: block;

        .content {
          border: none;
        }
      }
    }
  }
}
