/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */

#footer {
  bottom: 0;
  left: 0;
  right: 0;
  position: fixed;
  z-index: 999;
}

#guest-error {
  background-color: @icinga-blue;
  height: 100%;
  overflow: auto;
}

#guest-error #icinga-logo {
  .fadein();
}

#guest-error-message {
  .fadein();
  color: @body-bg-color;
  font-size: 2em;
}

#header,
#login,
#content-wrapper {
  font-size: @font-size;
  line-height: @line-height;
}

#header-logo-container {
  background: @icinga-blue;
  height: 6em;
  padding: 1.25em;
  width: 16em;
}

#header-logo,
#mobile-menu-logo {
  background-image: url('../img/icinga-logo.svg');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  display: block;
  height: 100%;
  width: 100%;

  &:focus {
    opacity: .6;
    outline: none;
  }
}

#mobile-menu-logo {
  width: 50%;
  float: left;
  height: 2em;
  margin-top: .25em;
  background-position: .75em center;
}

#mobile-menu-toggle .icon-cancel {
  display: none;
}

#icinga-logo {
  background-image: url('../img/icinga-logo-big.svg');
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain; // Does not work in IE < 10
  height: 177px;
  margin-bottom: 2em;
  width: 100%;

  &.invert {
    background-image: url('../img/icinga-logo-big-dark.svg');
  }
}

#layout {
  background-color: @body-bg-color;
  color: @text-color;
  font-family: @font-family;
}

#login {
  overflow: auto;
}

@gutter: 1em;

// x-column-layout
#main {
  .clearfix();

  & > .container {
    width: 0;
    overflow: auto;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;

    &:empty {
      display: none;
    }

    & > .content {
      flex: 1 1 auto;
      overflow: auto;
    }

    & > .controls {
      > .tabs {
        // Remove gutter for tabs
        margin-left: -1 * @gutter;
        margin-right: -1 * @gutter;
        height: 2.5em;
      }

      .tabs:first-child:not(:last-child) {
        margin-bottom: .5em;
      }
    }
  }
}

// Not part of the above to relax specificity and to allow modules adjust this
:not(.dashboard) > .container {
  & > .controls {
    padding-left: @gutter;
    padding-right: @gutter;
  }

  & > .content {
    padding: @gutter;
  }
}

// Mobile menu
#layout.minimal-layout #sidebar {
  background-color: @menu-bg-color;
}

#mobile-menu-toggle {
  color: @menu-color;
  text-align: right;

  > button {
    background: none;
    border: none;
    height: 2.5em;

    -webkit-appearance: none;
       -moz-appearance: none;
        -ms-appearance: none;
            appearance: none;
  }
}

.container,
.error-message,
.modal-window {
  // Don't outline containers and error messages when focused because they receive focus for accessibility only
  // programmatically
  outline: none;
}

.controls {
  > .tabs {
    overflow: hidden;
  }
}

// Dashboard grid

.dashboard {
  letter-spacing: -0.417em;

  > .container {
    display: inline-block;
    letter-spacing: normal;
    vertical-align: top;
    // Column width controlled by #layout
    width: 100%;

    &:last-of-type {
      // See reponsive.less for gutters
      padding-right: 0;
    }
  }
}

// Notification styles

#notifications {
  // Reset defaults
  list-style-type: none;
  margin: 0;
  padding: 0;
}

#notifications > li {
  background: no-repeat 1em center;
  border-top: 1px solid @gray-light;
  color: @body-bg-color;
  display: block;
  line-height: 2.5em;
  padding-left: 3em;

  &:hover {
    cursor: pointer;
  }

  &.error {
    background-color: @color-notification-error;
    background-image: url(../img/icons/error_white.png);
  }

  &.info {
    background-color: @color-notification-info;
  }

  &.success {
    background-color: @color-notification-success;
    background-image: url(../img/icons/success.png);
    color: @text-color;
  }

  &.warning {
    background-color: @color-notification-warning;
  }
}

// Collapsed sidebar
#layout:not(.minimal-layout).sidebar-collapsed {
  #header-logo-container {
    height: 3em;
    padding: 0.25em 0.125em;
    width: 4em;
  }

  #header-logo {
    background-image: url('../img/icinga-logo-compact.svg');
  }

  #sidebar {
    width: 4em;
  }

  #open-sidebar {
    display: inline;
  }

  #close-sidebar {
    display: none;
  }

  #menu {
    .nav-level-1 {
      > .badge-nav-item > a {
        position: relative;

        > .badge {
          position: absolute;
          right: .5em;
          bottom: .25em;
          font-size: 75%;
          overflow: hidden;
          text-overflow: ellipsis;
          max-width: 4em;
        }
      }

      > .nav-item.active > a > .badge {
        display: unset;
      }
    }

    img.icon {
      margin: 0 1.25em -.25em 0.25em;
      font-size: 1.5em;
    }

    .nav-item {
      white-space: nowrap;
    }

    .nav-item.no-icon > a {
      padding-left: .75em;
    }

    .nav-level-1 > .nav-item i {
      font-size: 1.5em;
      margin-right: .5em;
    }

    > .search-control {
      height: 3.333em;
    }
  }

  #search {
    padding-left: 3.75em;
  }

  #search:focus {
    background-color: @menu-bg-color;
    border-radius: 0 .25em .25em 0;
    box-shadow: 0 0 .25em 0 rgba(0, 0, 0, .2);
    color: @menu-color;
    width: 20em;
    position: fixed;
    z-index: 1;
  }

  .search-input {
    font-size: 1.25em;
    padding-right: .625em;
  }

  .search-reset {
    display: none;
  }

  .skip-links {
    a, button {
      width: 20em;
    }
  }
}
