/*
 * 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$
 */

button {
  font-size: @font-size-high;
  @media screen and (max-width: @font-size-normal-max-width) {
    font-size: @font-size-normal;
  }
  @media screen and (max-width: @font-size-mobile-max-width) {
    font-size: @font-size-mobile;
  }
}

button.lms-ui-button {
  display: inline-flex;
  align-items: center;
}

button.lms-ui-link-button {
  display: inline-block;
}

a.lms-ui-link-button {
  vertical-align: top;
  display: inline-flex;
  align-items: center;
}

button.lms-ui-button,
a.lms-ui-link-button {
  box-sizing: border-box;
  padding: 0.33em;
  padding-top: 0.15em;
  padding-bottom: 0.15em;
  margin-top: 0.25em;
  margin-bottom: 0.25em;
  min-height: 2.5em;
  border: 1px solid @darkbrown;
  color: black !important;
  text-decoration: none;
  background-color: @light;
  background-repeat: no-repeat;
  background-position: 3px 3px;
  outline: none;
  &.lms-ui-button-icon {
    padding-left: 25px;
  }
  &:hover {
    text-decoration: none;
  }
  &:not([disabled]) {
    &:active {
      background-color: @dark;
      box-shadow: inset 1px 1px 4px 0px rgba(0, 0, 0, 0.4);
    }
    &:focus {
      box-shadow: 0px 0px 1px 1px black;
    }
    &:hover {
      box-shadow: 0px 0px 3px 1px black;
      &.alert,
      &.lms-ui-error {
        box-shadow: @error-box-shadow;
      }
      &.lms-ui-warning {
        box-shadow: @warning-box-shadow;
      }
    }
  }
  &[disabled] {
    color: @blend !important;
    cursor: no-drop;
    &:before {
      color: @blend !important;
    }
  }
  &.alert,
  &.lms-ui-error {
    box-shadow: @error-box-shadow;
    &:focus {
      border: @error-outline-focus;
      box-shadow: @error-box-shadow-focus;
    }
  }
  &.lms-ui-warning {
    box-shadow: @warning-box-shadow;
    &:focus {
      border: @warning-outline-focus;
      box-shadow: @warning-box-shadow-focus;
    }
  }
  .lms-ui-label {
    font-weight: 700;
    vertical-align: middle;
  }
  i + .lms-ui-label {
    padding-left: 0.5em;
  }
}

a.lms-ui-button {
  i + .lms-ui-label {
    padding-left: 0.5em;
  }
}

a.lms-ui-button:not(.lms-ui-link-button) {
  > i:before {
    color: black;
  }
  &.lms-ui-error > i:before {
    color: @error-text;
  }
  > i {
    text-align: center;
    padding: 0 0.1em;
  }
  border: 1px solid transparent;
  display: inline-block;
  &:hover {
    cursor: pointer;
    border: 1px solid @darkbrown;
    border-radius: 3px;
    display: inline-block;
    text-decoration: none;
  }
  &[disabled] {
    color: @blend !important;
    cursor: no-drop;
    &:before {
      color: @blend !important;
    }
    > i:before {
      color: @blend !important;
    }
  }
}

a.lms-ui-link-button + button.lms-ui-button {
  margin-left: 0.33em;
}

.lms-ui-responsive-buttons {
  display: inline-block;
  > * {
    padding-left: 0.1em;
    padding-right: 0.1em;
  }
  .lms-ui-dropdown-toggle {
    display: none !important;
    cursor: pointer;
    &.secondary {
      display: inline !important;
    }
    @media screen and (max-width: @mobile-max-width) {
      font-size: @fa-icon-size-mobile;
      line-height: normal;
    }
  }
  .lms-ui-dropdown-buttons {
    display: inline;
    .lms-ui-button.secondary {
      display: none;
    }
  }
  @media screen and (max-width: 1200px) {
    .lms-ui-dropdown-toggle {
      display: inline-flex !important;
      &.secondary {
        display: none !important;
      }
    }
    .lms-ui-dropdown-buttons {
      display: none;
      padding: 0.2em;
      position: absolute;
      background-color: @light;
      //min-width: 15em;
      border: @frame;
      box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
      z-index: 1;
      &.show {
        display: flex;
      }
      .lms-ui-button {
        display: none;
      }
    }
  }
}

td > button:last-child {
  margin-right: 0.5em;
}

i.lms-ui-button-clipboard:hover {
  cursor: pointer;
  &:not(.lms-ui-static) {
    .lms-ui-icon-copy();
  }
}

a.lms-ui-button:not(.lms-ui-link-button).lms-ui-button-speech-recognition.active {
  .fa-beat();
  > i:before {
    color: red;
  }
}

.lms-ui-util-buttons {
  display: flex;
  flex-direction: column;
}
