/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
// Forked Cosmo 3.3.7
// Bootswatch
// -----------------------------------------------------

// Navbar =====================================================================

.navbar {
  border: none;

  li > a:focus {
    outline: 0;
  }

  &-inverse {
    .badge {
      background-color: @lightest;
      color: @brand-primary;
    }
  }

  .caret {
    display: inline-block;
    padding: 0 5px 18px 5px;
  }
}

.navbar-inverse {
  border: none;
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
  background: transparent;
}

.navbar-nav > li > a {
  padding-top: 18px;
}

// Buttons ====================================================================

.btn {
  text-transform: uppercase;
}

.btn:focus,
.btn:active:focus {
  outline: none;
}

.nav-tabs {
  .dropdown-toggle.btn,
  .btn-group.open .dropdown-toggle.btn {
    &,
    &:hover,
    &:active,
    &:focus {
      border-color: transparent;
      background-color: transparent;
      box-shadow: none;
    }
  }
}

.caret {
  border: none;
  color: @gray;

  &:hover {
    color: @gray-darker;
  }

  &:before {
    font-family: 'FontAwesome';
    font-size: @font-size-xs;
    content: '\f078';
  }
}

// Typography =================================================================

body {
  -webkit-font-smoothing: antialiased;
}

.text-primary,
.text-primary:hover {
  color: @brand-primary;
}

.text-success,
.text-success:hover {
  color: @success;
}

.text-danger,
.text-danger:hover {
  color: @brand-danger;
}

.text-warning,
.text-warning:hover {
  color: @brand-warning;
}

.text-info,
.text-info:hover {
  color: @brand-info;
}

// Tables =====================================================================

table,
.table {
  .dropdown-menu a {
    text-decoration: none;
  }

  .success,
  .warning,
  .danger,
  .info {
    color: @lightest;

    a {
      color: @lightest;
    }

    .btn-default {
      color: @gray;
    }
  }
}

// Forms ======================================================================

.form-control {
  box-shadow: none;
}

.has-warning {
  .help-block,
  .control-label,
  .radio,
  .checkbox,
  .radio-inline,
  .checkbox-inline,
  &.radio label,
  &.checkbox label,
  &.radio-inline label,
  &.checkbox-inline label,
  .form-control-feedback {
    color: @brand-warning;
  }

  .form-control,
  .form-control:focus,
  .input-group-addon {
    border: 1px solid @brand-warning;
  }
}

.has-error {
  .help-block,
  .control-label,
  .radio,
  .checkbox,
  .radio-inline,
  .checkbox-inline,
  &.radio label,
  &.checkbox label,
  &.radio-inline label,
  &.checkbox-inline label,
  .form-control-feedback {
    color: @brand-danger;
  }

  .form-control,
  .form-control:focus,
  .input-group-addon {
    border: 1px solid @brand-danger;
  }
}

.has-success {
  .help-block,
  .control-label,
  .radio,
  .checkbox,
  .radio-inline,
  .checkbox-inline,
  &.radio label,
  &.checkbox label,
  &.radio-inline label,
  &.checkbox-inline label,
  .form-control-feedback {
    color: @brand-success;
  }

  .form-control,
  .form-control:focus,
  .input-group-addon {
    border: 1px solid @brand-success;
  }
}

// Navs =======================================================================

.nav-pills {
  & > li > a {
    border-radius: @border-radius-normal;
  }
}

.dropdown-menu {
  & > li > a:hover,
  & > li > a:focus {
    background-image: none;
    text-decoration: none;
  }
}

// Indicators =================================================================

.close {
  text-decoration: none;
  text-shadow: none;
  opacity: 0.4;

  &:hover,
  &:focus {
    opacity: 1;
  }
}

.alert {
  border: none;
}

.alert-link {
  text-decoration: underline;
}

.alert-info .alert-link {
  color: @alert-info-text;
}

.alert-danger .alert-link {
  color: @alert-danger-text;
}

.alert-warning .alert-link {
  color: @alert-warning-text;
}

.alert-success .alert-link {
  color: @alert-success-text;
}

.label {
  border-radius: 21px;
  padding: 0.35em 0.8em 0.35em;
  font-weight: @font-weight-normal;
  font-size: @font-size-s;
}
.label-default:hover {
  background-color: darken(@label-default-bg, 5%);
}
.label-warning:hover {
  background-color: darken(@label-warning-bg, 5%);
}
.label-danger:hover {
  background-color: darken(@label-danger-bg, 5%);
}
.label-primary:hover {
  background-color: darken(@label-primary-bg, 5%);
}

label {
  font-weight: @font-weight-normal;
  font-size: @font-size-s;
}

// Progress bars ==============================================================

.progress {
  height: 14px;
  .box-shadow(none);

  .progress-bar {
    font-size: @font-size-s;
    line-height: @line-height-tight;
    padding-top: 2px;
  }
}

// Containers =================================================================

.panel {
  border: none;

  &-heading,
  &-footer {
    border-top-right-radius: 0;
    border-top-left-radius: 0;
  }

  &-default {
    .panel-heading {
      padding: 15px 15px 0 15px;
      background-color: transparent;
    }

    .panel-title {
      color: @text-color;
      padding-bottom: 5px;
      border-bottom: 1px solid @gray-light;

      h1,
      h2,
      h3,
      h4,
      h5,
      h6 {
        margin: 10px 0 0 0;
        font-weight: @font-weight-bold;
      }
    }

    .close {
      color: @text-color;
    }
  }

  &-primary {
    .panel-heading {
      padding: 15px 15px 0 15px;
      background-color: transparent;
    }

    .panel-title {
      color: @text-color;
      padding-bottom: 5px;
      border-bottom: 1px solid @gray-light;

      h1,
      h2,
      h3,
      h4,
      h5,
      h6 {
        margin: 10px 0 0 0;
        font-weight: @font-weight-bold;
      }
    }

    .close {
      color: @text-color;
    }
  }

  .accordion-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;

    &:hover {
      text-decoration: none;
    }

    .caret {
      display: flex;
      width: auto;
      height: auto;
      margin-left: 5px;

      &:hover {
        color: @gray;
      }
    }
  }
}

.panel-title-large {
  font-size: 24px;
}

.list-group-item {
  padding-top: 5px;
  padding-bottom: 5px;
}

a.list-group-item {
  &-success {
    &.active {
      background-color: @state-success-bg;
    }

    &.active:hover,
    &.active:focus {
      background-color: darken(@state-success-bg, 5%);
    }
  }

  &-warning {
    &.active {
      background-color: @state-warning-bg;
    }

    &.active:hover,
    &.active:focus {
      background-color: darken(@state-warning-bg, 5%);
    }
  }

  &-danger {
    &.active {
      background-color: @state-danger-bg;
    }

    &.active:hover,
    &.active:focus {
      background-color: darken(@state-danger-bg, 5%);
    }
  }
}

.modal {
  .close {
    color: @text-color;
  }
}

.popover {
  color: @text-color;
}

// Tabs ==============================================================

.nav-tabs > li > a {
  border-top: 3px solid transparent;
  color: @text-color;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  background-color: @lightest;
  font-weight: @font-weight-bold;
  border-top: 3px solid @brand-primary;
}

// Tables ==============================================================

.table {
  .info {
    color: @state-info-text;
  }

  .danger {
    color: @state-danger-text;
  }

  .warning {
    color: @state-warning-text;
  }

  .success {
    color: @state-success-text;
  }
}

// Utils ==============================================================
hr {
  margin: 10px 0;
}

// generate space-n classes for vertical spacing
.space-loop(@counter) when (@counter > 0) {
  .space-loop((@counter - 1)); // next iteration
  .space-@{counter} {
    margin-bottom: (10px * @counter); // code for each iteration
  }
}
.space-loop(6);

a {
  cursor: pointer;
}

.control-label {
  text-transform: uppercase;
  color: @gray;
  font-size: @font-size-s;
}
