/*
 * LMS version 1.11-git
 *
 *  (C) Copyright 2001-2020 LMS Developers
 *
 *  Please, see the doc/AUTHORS for more information about authors!
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License Version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */

label > .lms-ui-customer-select-container {
  margin-left: 0.4em;
}

.lms-ui-customer-select-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  select {
    margin-right: 0.5em;
    max-width: 35em;
  }

  .lms-ui-customer-select {
    display: inline-block;
    white-space: nowrap;

    > span {
      padding-right: 0.5em;
    }

    .lms-ui-customer-select-customerid,
    .lms-ui-customer-select-suggestion-input {
      box-sizing: border-box;
      width: 7em;
      margin-top: 0.2em;
      margin-bottom: 0.2em;
      padding-right: 0;

      &:focus {
        padding-right: 1.4em;
        & + .lms-ui-customer-function-button {
          visibility: visible;
        }
      }
    }

    .lms-ui-customer-function-button {
      display: inline-block;
      margin-left: -2.3em;
      vertical-align: middle;
      cursor: pointer;
      visibility: hidden;
    }

    &:hover {
      & .lms-ui-customer-select-customerid,
      & .lms-ui-customer-select-suggestion-input {
        padding-right: 1.4em;
        & + .lms-ui-customer-function-button,
        & + .lms-ui-customer-function-button {
          visibility: visible;
        }
      }
    }
  }
  .lms-ui-customer-select-name {
    white-space: normal;
    padding-left: 0.8em;
    padding-right: 0.5em;
    flex-grow: 1;
  }

  &[data-version="2"] {
    .lms-ui-customer-select {
      .lms-ui-customer-select-customerid,
      .lms-ui-customer-select-suggestion-container {
        display: none;
      }
      .lms-ui-customer-select-suggestion-input {
        min-width: 10em;
      }
      .lms-ui-customer-select-customerid[required]:invalid + .lms-ui-customer-select-suggestion-input {
        border: @error-outline;
        box-shadow: @error-box-shadow;
        &:focus {
          border: @error-outline-focus;
          box-shadow: @error-box-shadow-focus;
          outline: none;
        }
      }
    }
  }

  &.lms-ui-distinguished {
    select {
      border: @warning-outline;
      box-shadow: @warning-box-shadow;

      &:focus {
        border: @warning-outline-focus;
        box-shadow: @warning-box-shadow-focus;
      }
    }

    .lms-ui-customer-select-name {
      border: @warning-outline;
      box-shadow: @warning-box-shadow;
    }
  }
}
