@import 'mixins';

* {
  @include userSelect(none);
}

body {
  margin: 0;
  font-size: 13px;
}

a {
  text-decoration: none;
  outline: none;
}

#guideguide {
  font-family: $sansSerif;
  overflow: hidden;

  &.has-update .update-indicator { display: inline-block; }

  &.hideUI { display: none; }
}

.panel-forms {
  width: 100%;
  padding-bottom: $actionBarHeight;
}

.pages {
  margin: $tabsHeight 10px $actionBarHeight;
}

.height-stretch {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.scrollbar {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 12px;
  z-index: 10;
  opacity: 0;

  .scrollbar-is-visible & {
    opacity: 1;
  }

  .track {
    position: absolute;
    top: 0;
    bottom: 0;
    overflow: hidden;
  }

  .handle {
    width: 8px;
    height: 50px;
    background-color: rgba(#000, .7);
    margin: 2px;
    cursor: pointer;
  }
}

.scroll-content {
  overflow: auto;
  width: 100%;
  padding-right: 50px;
}

.button {
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

// Horizontal text nav used to switch tabs.
.nav {
  margin: 0;
  height: 0;
  display: block;
  width: 100%;
  position: relative;
  z-index: 2;

  a {
    &.is-selected { cursor: default; }
  }

  .left {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 35px 8px 10px;
    white-space: nowrap;
    line-height: 15px;

    a { margin-right: 5px; }

    .overflow {
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .right {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    text-align: right;
    padding: 8px 10px 8px 0;

    a { margin-left: 5px; }
  }

  .icon { vertical-align: top; }
}

.header-actions {
  position: relative;
  float: right;
  list-style-type: none;
  margin: 0;
  padding: 8px;
  z-index: 1;

  li {
    display: inline-block;
    margin-left: 3px;
  }
}

.update-indicator { display: none; }

.button-group {
  display: table;
  list-style-type: none;
  padding: 0;
  width: 100%;
  margin: 0;

  li {
    display: table-cell;
    width: 1%;
  }

  li:first-child { padding-right: 1px; }
  li:last-child { padding-left: 1px; }
  li:first-child:last-child { padding: 0px; }

  .button {
    display: block;
    padding: 3px 10px 5px;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
  }
}

// Content of a tab.
.tabbed-page {
  display: none;
  vertical-align: top;

  &.is-selected {
    display: block;
  }

  td {
    vertical-align: top;
    padding: 0;
  }
}

// Hidden markup. Contents are templates.
.hidden-template { display: none }

.dropdown {
  position: relative;

  &.is-active .dropdown-list { display: block; }
}

.dropdown-button {
  display: block;
  padding: 3px 26px 5px 5px;
  position: relative;
  text-align: right;

  &:before {
    position: absolute;
    top: 11px;
    right: 9px;
    display: block;
    width: 0;
    height: 0;
    content: "";
    border: 4px solid #fff;
    z-index: 1;
  }

  .title {
    margin: 0;
    font-size: 12px;
    font-weight: normal;
    position: absolute;
    z-index: 5;
    top: 4px;
    left: 5px;
  }
}

.dropdown-list {
  position: absolute;
  left: 0;
  top: 26px;
  display: none;
  margin: 0;
  padding: 0;
  width: 100%;
  z-index: 21;
}

.dropdown-item {
  display: block;
  padding: 3px 26px 5px 5px;
  text-align: right;
}

.loader {
  display: none;
  z-index: 21;

  .loader-spinner {
    background-color: transparent;
    background-position: center center;
    background-repeat: no-repeat;
  }

  .loader-background { opacity: .7; }

  .is-loading & { display: block; }
}

.dark-theme .loader-spinner { background-image: url('../img/spinner-dark.gif'); }
.light-theme .loader-spinner { background-image: url('../img/spinner-light.gif'); }

@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-resolution: 240dppx) {
  .dark-theme .loader-spinner { background-image: url('../img/spinner-dark@2x.gif'); }
  .light-theme .loader-spinner { background-image: url('../img/spinner-light@2x.gif'); }
  .loader-spinner { background-size: 37px 37px; }
}

.alert {
  display: none;
  z-index: 21;

  .alert-body {
    font-size: 13px;
    line-height: 21px;
    position: absolute;
    bottom: 0;
    top: 0;
    left: 0;
    right: 0;
  }

  .alert-content {
    margin: 20px;
    overflow: hidden;
  }

  .alert-title {
    margin-top: 0;
    font-weight: normal;
  }

  .button-group {
    position: absolute;
    bottom: 0;
  }

  .scroll-outer {
    margin-bottom: 41px;
    overflow: hidden;
    overflow-y: scroll;
  }

  .scrollbar {
    margin-bottom: 41px;
  }

  #guideguide.has-alert & { display: block; }
}

.help-text {
  display: none;
  padding: 0 3px;
  margin: 0 0 10px;

  .is-helping & { display: block; }
}

.help-target {
  font-size: 9px;
  font-weight: bold;
  vertical-align: top;
}

.checkbox {
  font-size: 10px;
  position: relative;
  cursor: pointer;
  display: inline-block;
  line-height: 18px;
  width: 100%;

  &.checked .icon { display: block; }

  .square {
    position: absolute;
    top: 2px;
    left: 4px;
    display: inline-block;
    height: 12px;
    width: 12px;
    border: 1px solid;
  }

  .icon {
    display: none;
    position: absolute;
    top: 1px;
    left: 3px;
  }

  .label {
    white-space: nowrap;
    padding-left: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.export-button {
  display: inline-block;
  padding: 5px 10px;
  margin-top: 10px;
}

.tipsy {
  font-family: $sansSerif;
  font-size: 12px;
}

.tipsy-inner {
  padding-bottom: 6px;
}
