$pill-radius: 3px;
$pill-height: 20px;
$pill-min-width: 150px;
$text-color: #212121;
$link-color: #38425D;
$link-hover-color: #72757B;
$background-color: #E2E9F3;

html {
  height: 100%;
}

body{
  width:100%;
  height:100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background-color: #E2E9F3;
  font-size: 12px;
  line-height: 18px;
}

a:hover, a:focus {
  color: $link-hover-color;
}
a:hover {
  cursor: pointer;
}

#logo {
  height: 34px;
  flex-shrink: 0;
}

.top-card a {
  color: #38425D;
}

.top-card a:hover {
  color: #72757B;
}

.controls {
  margin-left: 33px;
  margin-top: 7px;
  & > a.command {
    font-size: 14px;
    margin-right: 40px;
  }
}

.idl-logo {
  background: url("../assets/images/idl-h56.png") center no-repeat;
  display: block;
  background-size: 40px 28px;
  width: 40px;
  height: 28px;
}

.clickable, .clickable.draggable {
  cursor: pointer;
}

.draggable {
  cursor: move;
}

.invisible {
  visibility: hidden;
}

a:active, a:hover {
  outline: 0;
}
a {
  color: $link-color;
  text-decoration: none;
  line-height: inherit;
}

.italic {
  font-style: italic;
}


a.command, div.command {
  margin-left: 10px;

  &.debug, .debug {
    color: #72a386;
  }

  &.disabled, &.disabled:hover, &[disabled=disabled], [disabled=disabled]:hover {
    cursor: not-allowed;
    color: #ccc;
  }
}

textarea {
  width: 100%;
}

.right {
  float:right;
}

.card {
  margin: 3px 3px 0 0;
  padding: 8px;
  background: white;
  border-style: none;
  &.margin-bottom {
    margin-bottom: 3px
  }
}

.top-card {
  background-color: #FCFDFE;
}

.no-right-margin {
  margin-right: 0 !important;
}

.no-top-margin {
  margin-top: 0 !important;
}

.no-left-margin {
  margin-left: 0 !important;
}

.no-bottom-margin {
  margin-bottom: 0 !important;
}

/* prevent element from being selected http://stackoverflow.com/questions/826782 */
.noselect {
  user-select: none;
  cursor: default;
}

h1 {
  @extend .noselect;
  font-size: 24px;
  line-height:36px;
  font-weight: 700;
  margin: 0;
}

h2 {
  @extend .noselect;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  margin: 0 0 10px;
}

h3 {
  @extend .noselect;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
}

h4 {
  @extend .noselect;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0;
}

.flex-root{
  overflow: auto;
}

.popup-menu {
  padding: 5px;
  background-color: #eee;
  border: 1px solid #eee;
  border-radius: 3px;

  &.popup-command {
    .command {
      display: block;
    }
  }
}

/* PANES */

.pane {
  padding: 0px;
  position: relative;
}

.pane .subpane {
  margin-bottom: 20px;
}

.pane .subpane:last-child {
  margin-bottom: 0px;
}

.main-panel {
  min-height: 250px;
  height: 450px;
  flex-grow: 1.5;
}

.dev-panel {
  min-height: 150px;
  height: 300px;
  flex-grow: 0.5;
  background-color: #EEE;
}

.alert-box {
  z-index: 1;
  position: absolute;
  top: 5px;
  margin-left: auto;
  margin-right: auto;
  left: 0;
  right: 0;
  width: 500px;
}

.alert-item {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
  padding: 5px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  overflow-wrap: break-word;

  a.close {
    float: right;
    color: #a94442;
    font-weight: bold;
  }
}



/* UTILITIES */

.mb5{
  margin-bottom: 5px;
}

.relative{
  position: relative;
}

.full-width {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  max-width: initial;
}

.full-height {
  height: 100%;
}

.inline-label {
  display: inline-block;
  min-width: 100px;
  font-weight: bold;
}

.inline-block {
  display: inline-block;
}

.block {
  display: block;
}

.grow-1{
  flex-grow:1;
}

.hflex {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  position: relative;
}

.vflex {
  display: flex;
  flex-direction: column;
  position: relative;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-grow-1 {
  flex-grow: 1;
}

.no-shrink {
  flex-shrink: 0;
}

.abs-w100 {
  position: absolute;
  left: 0;
  right: 0;
}

.abs-h100 {
  position: absolute;
  top: 0;
  bottom: 0;
}

.abs-100 {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

// FIXME remove this!
.absolute-top-right {
  position: absolute;
  top: 3px;
  right: 0;
}

.persist-scroll{
  /*
    Prevent scroll bars from being hidden for OS X.
    http://stackoverflow.com/questions/7855590/how-can-i-prevent-scroll-bars-from-being-hidden-for-os-x-trackpad-users-in-webkit
  */
  &::-webkit-scrollbar {
    -webkit-appearance: none;
  }

  &::-webkit-scrollbar:vertical {
    width: 11px;
  }

  &::-webkit-scrollbar:horizontal {
    height: 11px;
  }

  &::-webkit-scrollbar-thumb {
    border-radius: 8px;
    border: 2px solid white; /* should match background, can't be transparent */
    background-color: rgba(0, 0, 0, .5);
  }

  &::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 8px;
  }
}

.scroll-y{
  @extend .persist-scroll;
  overflow-y: scroll;
}

.no-scroll-y{
  overflow-y: hidden;
}

.scroll-x{
  @extend .persist-scroll;
  overflow-x: scroll;
}

.no-scroll-x{
  overflow-x: hidden;
}

.scroll-xy{
  @extend .persist-scroll;
  overflow-y: scroll;
  overflow-x: scroll;
}


.small {
  font-size: 10px;
}

/**** Components ****/

.drop-container {
  display:none;
}

.drop{
  display: none;
  &.drop-open {
    display: block;
    z-index: 100; /** so it's show above modal */
  }
}


.data-card {
  h2, h3 {
    color: white;
  }
  .current-dataset {
    color: white;
  }
  background-color: #38425D;

  #footer {
    a {
      color: white;
    }

    a:hover, a:focus {
      color: #ddd;
    }
  }

  .sidebar-header {
    padding-bottom: 5px;
    margin-bottom: 5px;
  }

  .current-dataset {
    display: inline-block;
    white-space: nowrap;
    width: 65%; // FIXME this is a bad hack
    overflow: hidden;
    text-overflow: ellipsis;

    .fa-database {
      margin-left: 2px;
      margin-right: 5px;
    }
  }
  button {
    margin-top: -3px;
  }
}

.data-load {
  background-color: #30374A;
  padding:0;
  margin:0;
}

.pane.data-pane {
  width: 250px;
  flex-shrink: 0;
}

#footer {
  position:absolute;
  bottom: 5px;
  left: 10px;

  ul.menu {
    list-style-type:none;
    margin:0;
    padding:0;
    li {
      margin-bottom: 4px;
      padding: 0;
      display: inline-block;

      // Separate items with a dot
      &:after {
        color: #eee;
        content: '\000b7';
        padding: 0 3px;
      }
      &:last-of-type {
        &:after {
          content: none;
          padding-right: 0;
        }
      }
    }
  }
}


// Workaround for https://github.com/720kb/angular-tooltips/issues/95
._720kb-tooltip:not(._720kb-tooltip-open) {
  visibility: hidden !important;
}
