@import "variables.less";

#logo {
  z-index: var(--z-index-ui);
  border: none;
  box-sizing: border-box;
  pointer-events: all;
  width: 100px;
  margin: 12px 0 0 10px;
}

#navigation {
  width: 100%;
  margin: 12px 0 0 0;
  padding: 0;
  background: none;
  box-shadow: none;
  border: none;
  pointer-events: none;

  .nav-item {
    line-height: 32px;
    padding: 0 8px;
    margin: 0 8px 8px 0;
    border: 1px solid @borderColorBlack;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    pointer-events: all;
  }

  #nav-toggle {
    flex: 0 0 32px;
    height: 34px;
    background: rgba(0, 0, 0, 0.5);
    text-align: center;
    &:hover {
      text-shadow: 0 0 10px @shadowColorOrange;
    }
  }

  #scene-list {
    list-style: none;
    margin: 0;
    padding: 0;

    .scene {
      float: left;
      background: rgba(39, 39, 39, 0.95);

      &:last-child {
        margin-right: 0;
      }

      &.gm {
        background: #130027;
        border: 1px solid #3a00ae;
      }

      &.view,
      &.context {
        cursor: default;
        color: @colorWhite;
        border: 1px solid @borderColorRed;
        background: rgba(52, 52, 52, 0.95);
        border-bottom: 1px solid @borderColorOrange;
        border-bottom: 1px solid @borderColorOrange;
        box-shadow: 0 0 10px @shadowColorOrange;
      }

      ul.scene-players {
        list-style: none;
        margin: 0;
        padding: 0;
        position: absolute;
        top: 24px;
        left: 0;
      }

      li.scene-player {
        float: left;
        height: 14px;
        width: 14px;
        margin: 0 2px 0 0;
        line-height: var(--line-height-12);
        font-size: .625rem; // 10px
        text-align: center;
        color: #000;
        font-weight: 700;
        background: #97dff4;
        border: 1px solid @borderColorBlack;
        border-radius: 8px;
      }
    }
  }

  &.collapsed {
    pointer-events: none;
    #nav-toggle {
      pointer-events: all;
    }
    #scene-list {
      display: none;
    }
  };
}


#loading {
  display: none;
  width: 100%;
  height: 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid @borderColorBlack;
  box-shadow: 0 0 4px @updateBarBorder;
  border-radius: 4px;
  z-index: calc(var(--z-index-canvas) + 1);

  label {
    line-height: 16px;
    position: absolute;
    top: -4px;
    padding: 0 5px;
    font-size: var(--font-size-18);
    color: @colorWhite;
    background: rgba(0, 0, 0, 0.6);
    text-shadow: 1px 1px 6px @colorWhite;
  }

  #loading-bar {
    position: relative;
    margin: 1px;
    height: 10px;
    background: @updateBarBackground;
    border: 1px solid @updateBarBorder;
    border-radius: 2px;
  }

  #context {
    left: 5px;
  }

  #progress {
    top: -4px;
    right: 0;
    padding: 0 8px;
  }
}


/* ----------------------------------------- */
/*  Main Menu
/* ----------------------------------------- */

#menu {
  position: fixed;
  z-index: calc(var(--z-index-window) + 1);
  top: 45%;
  left: calc(50% - 180px);
  width: 360px;
  color: @colorWhite;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  box-shadow: 0 0 30px @shadowColorBlack;

  #menu-items {
    list-style: none;
    margin: 5px;
    padding: 0;

    li {
      .flexrow();
      text-align: center;
      cursor: pointer;

      > i {
        flex: 0 0 36px;
        font-size: var(--font-size-24);
        line-height: 48px;
      }

      h4 {
        font-size: 2rem;
        line-height: 48px;
        margin: 0;
      }

      &:hover {
        text-shadow: 0 0 10px @shadowColorOrange;
      }
    }
  }
}



/* ----------------------------------------- */
/*  Scene Controls
/* ----------------------------------------- */

#controls {
  flex: 1;
  display: flex;
  height: 0;
  max-width: 100%;
  padding-top: 10px;

  ol {
    padding: 10px;
    list-style: none;
    background: none;
    box-shadow: none;
    border: none;

    > li {
      pointer-events: all;
    }

    &.disabled {
      opacity: 0.4;
      pointer-events: none;
    }

    &.control-tools {
      list-style: none;
      margin: 0;
      padding: 0;
      pointer-events: none;

      .control-tool {
        pointer-events: all;
      }
    }

    .scene-control,
    .control-tool {
      width: 36px;
      height: 36px;
      box-sizing: content-box;
      font-size: 24px;
      line-height: 36px;
      background: rgba(0, 0, 0, 0.5);
      box-shadow: 0 0 10px @shadowColorBlack;
      margin: 0 0 8px 0;
      color: var(--color-text-light-4);
      text-align: center;
      border: 1px solid @borderColorBlack;
      border-radius: 5px;
      cursor: pointer;
      display: inline-block;

      &.active,
      &:hover {
        color: @colorWhite;
        border: 1px solid @borderColorRed;
        border-bottom: 1px solid @borderColorOrange;
        border-bottom: 1px solid @borderColorOrange;
        box-shadow: 0 0 10px @shadowColorOrange;
      }

      i.fas {
        margin: 0;
      }
    }

    &.main-controls {
      width: 66px;
      overflow: hidden;
      padding-left: 20px;
    }

    &.sub-controls {
      display: none;
      flex-direction: column;
      flex-wrap: wrap;

      &.active {
        display: flex;
      }

      .control-tool {
        margin-right: 8px;
      }
    }

    /* Toggle Type Tools */

    .control-tool.toggle {
      background: rgba(30, 0, 60, 0.5);
      border: 1px solid #3b1893;

      &.active, &:hover {
        background: rgba(60, 0, 120, 0.5);
        box-shadow: 0 0 10px #9b8dff;
      }
    }
  }
}


/* ----------------------------------------- */
/*  Game Pause
/* ----------------------------------------- */

#pause {
  width: 100%;
  height: 100px;
  position: fixed;
  bottom: 10%;
  left: 0;
  pointer-events: none;
  z-index: var(--z-index-ui);
  background: url("../ui/pausebg.png") no-repeat 50% 50%;
  display: none;

  &.paused {
    display: block;
  }

  img {
    position: absolute;
    top: -16px;
    left: calc(50% - 64px);
    height: 128px;
    width: 128px;
    opacity: 0.5;
    border: none;
    -webkit-animation: rotation 5s infinite linear;
    @-webkit-keyframes rotation {
      from { -webkit-transform: rotate(0deg); }
      to { -webkit-transform: rotate(359deg); }
    }
  }

  h3 {
    margin: 0;
    font-size: 2em;
    font-weight: normal;
    line-height: 100px;
    text-align: center;
    position: relative;
    z-index: calc(var(--z-index-window) - 1);
    color: var(--color-text-light-1);
    text-shadow: 1px 1px 30px @shadowColorBlack;
  }
}


/* ---------------------------------------- */
/*  Hotbar                                  */
/* ---------------------------------------- */

#hotbar {
  z-index: calc(var(--z-index-ui) + 10);
  width: var(--hotbar-width);
  height: var(--hotbar-height);
  pointer-events: none;
  flex-wrap: nowrap;
  margin-bottom: 10px;

  .bar-controls {
    flex: 0 0 32px;
    height: 100%;
    margin: 0 2px;
    text-align: center;
    color: @colorFaint;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid @borderColorBlack;
    box-shadow: 0 0 3px #444 inset;
    border-radius: 3px;

    a {
      display: block;
    }

    a.page-control {
      font-size: 1.5em;
      line-height: 12px;
    }

    span.page-number {
      display: block;
      font-size: var(--font-size-20);
      line-height: 8px;
    }
  }

  #action-bar {
    flex: 1;
    height: 100%;
    pointer-events: all;
    flex-wrap: nowrap;
    &.collapsed {
      display: none;
      pointer-events: none;
    };
  }

  #macro-list {
    flex-wrap: nowrap;
    height: 100%;
    list-style: none;
    margin: 0 2px;
    padding: 0;
    border: 1px solid @borderColorBlack;
    border-radius: 3px;
    display: grid;
    grid-template-columns: repeat(10, var(--macro-size));
  }

  .macro {
    position: relative;
    width: var(--macro-size);
    height: var(--macro-size);
    border: 1px solid @borderColorBlack;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 5px @shadowColorBlack inset;
    cursor: pointer;

    &.inactive {
      box-shadow: 0 0 5px #444 inset;
    }
    &:hover {
      box-shadow: 0 0 10px @shadowColorOrange inset;
    }
    &.active:hover {
      border: 1px solid @borderColorRed;
    }

    .macro-key {
      position: absolute;
      top: 2px;
      right: 2px;
      padding: 1px 3px;
      background: #111;
      color: @colorBright;
      font-weight: bold;
      pointer-events: none;
    }

    .macro-icon {
      object-fit: cover;
      object-position: 50% 0;
      border: none;
      height: calc(var(--macro-size) - 2px);
      width: calc(var(--macro-size) - 2px);
    }

    .tooltip {
      display: block;
      min-width: 148px;
      height: 26px;
      padding: 2px 4px;
      position: absolute;
      top: -32px;
      left: -50px;
      background: rgba(0, 0, 0, 0.9);
      border: 1px solid @borderColorDark;
      border-radius: 3px;
      color: @colorBright;
      line-height: 22px;
      text-align: center;
      white-space: nowrap;
      word-break: break-all;
    }
  }

  #hotbar-directory-controls, #hotbar-page-controls {
    pointer-events: all;
  }

  #hotbar-directory-controls a {
    line-height: 24px;
  }
}

@media (max-width: 1120px) {
  #hotbar {
    width: calc(var(--hotbar-width) / 2);
    height: calc(var(--hotbar-height) * 2);

    #macro-list {
      grid-template-columns: repeat(5, 50px);
    }

    .bar-controls {
      justify-content: space-between;

      a {
        flex: 0;
      }

      span.page-number {
        line-height: unset;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
      }
    }
  }
}

/* ---------------------------------------- */
/*  Watermark                               */
/* ---------------------------------------- */

.watermark {
  width: 100%;
  z-index: var(--z-index-ui);
  position: fixed;
  bottom: 10px;
  height: 24px;
  font-size: 1.5em;
  pointer-events: none;
  text-align: center;
  color: var(--color-text-light-5);
  text-shadow: 1px 1px 4px @shadowColorBlack;
}
