@import "./variables.less";


/* ---------------------------------------- */
/*  Main Setup Form                         */
/* ---------------------------------------- */


#setup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background: url("../ui/anvil-bg.png") 50% 10% no-repeat;

  .app {
    margin: 0;
    background: url("../ui/denim-dark-090.png") repeat;
    border: 2px solid var(--color-text-dark-1);
    box-shadow: 0 0 10px @shadowColorBlack;
    color: @colorBright;
  }

  form {
    box-sizing: content-box;
  }

  h2 {
    font-size: var(--font-size-24);
    border-bottom: 2px solid @borderColorBeige;
    margin: 0 0 8px;
  }

  .notes {
    color: @colorBeige;
  }

  button {
    margin: 2px;
  }

  #world-list.package-list .package .tag.unknown { min-width: unset; }
}

body.background #setup {
  background: none;
}


/* Fatal Error */
#setup #error {
  width: 600px;
  min-height: 100px;
}


/* ----------------------------------------- */
/*  Module Configuration
/* ----------------------------------------- */

#setup-configuration {
  width: 960px;
  height: 700px;
  padding: 0 10px 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid @borderColorOlive;
  border-radius: 2px;
  box-shadow: 0 0 20px @shadowColorBlack;
  outline: 2px solid @borderColorBlack;
  color: @colorFaint;

  /* Config Header */
  header {
    flex: 0 0 36px;
    border-bottom: 1px solid @borderColorOlive;

    h1 {
      margin: 0;
      padding: 10px 0;
      text-align: center;
      border-bottom: 2px solid @borderColorBlack;
    }
  }

  /* Config Tabs */
  nav.tabs {
    flex: 0 0 36px;
    line-height: 36px;
    font-size: var(--font-size-18);
    border-bottom: 2px solid @borderColorBlack;
    a {
      position: relative;
    }
  }

  /* Tab Section */
  section.content {
    border-top: 1px solid @borderColorOlive;
    .package-list:not(.empty) {
      height: 510px;
    }
  }

  button.lock-toggle {
    width: 25px;
    &.unlock {
      color: @colorOlive;
      box-shadow: none;
    }
  }

  /* Configuration Contents */
  .tab {
    margin-bottom: 5px;
    flex-direction: column;
    &[data-tab].active {
      display: flex;
    }
  }
  .sheet-tabs {
    .item {
      padding: 0px 2px 0px 2px;
      &.active {
        border-bottom: 2px solid var(--color-text-light-heading);
        margin-bottom: -2px;
      }
      &.disabled {
        color: var(--color-text-dark-inactive);
        &:hover {
          text-shadow: none;
        }
      }
    }
  }

  .setup-footer {
    flex: 1;
    justify-content: flex-end;
    align-content: flex-end;
    button {
      height: 36px;
    }
  }

  .progress-bar {
    visibility: hidden;
    position: relative;
    flex: 0 0 100%;
    height: 12px;
    margin: 0;
    background: @borderColorBlack;
    border: 1px solid @borderColorOlive;
    border-radius: 3px;
  }

  .bar {
    height: 6px;
    margin: 2px;
    display: block;
    background: @updateBarBackground;
    border: 1px solid @updateBarBorder;
    border-radius: 2px;
    max-width: calc(100% - 4px);
  }

  .pct {
    display: block;
    position: absolute;
    margin-left: -20px;
    color: @colorWhite;
    text-shadow: 1px 1px 4px @shadowColorBlack;
    top: -5px;
    background: rgba(0, 0, 0, 0.5);
    padding: 0 5px;
    border: 1px solid @borderColorBlack;
  }

  #update-channel {
    flex: 0 0 200px;
  }

  .package {
    border-bottom: 1px solid var(--color-border-dark-1);
    .package-title {
      font-size: var(--font-size-16);
      color: @colorFaint;
    }
  }

  .filter-row {
    display: flex;
    justify-content: end;
  }

  .filter {
    margin-top: 5px;
    margin-bottom: 5px;

    label {
      padding-right: 5px;
    }

    input {
      width: 80%;
    }
  }

  a.system-install {
    color: var(--color-text-hyperlink);
    text-decoration: underline;
  }

  .notification {
    flex: none;
    margin: 0 0 0.5em 0;
  }

  .form-group {
    flex: none;
  }

  .message {
    padding: 1em;
    margin: 16px;
    font-size: var(--font-size-20);
    background: rgb(255 255 255 / 5%);
    border: 1px solid var(--color-border-dark);
    border-left: 6px solid var(--color-border-dark-2);
    border-radius: 3px;
    color: var(--color-text-light-heading);
    box-shadow: 0 0 3px var(--color-shadow-dark);

    em {
      color: var(--color-text-dark-inactive);
      display: block;
    }

    p {
      margin: 1em 0;
      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  .no-results {
    color: var(--color-text-dark-inactive);
    margin: 1em;
    font-size: var(--font-size-16);
    text-align: center;
    &.hidden {
      display: none;
    }
  }
}


/**
 * Package installation dialog
 */
#install-package {
  .categories {
    flex: 0 0 220px;
    height: 514px;
    overflow: hidden auto;
    padding-right: 5px;
    margin-right: 5px;
    border-right: 1px solid @borderColorBeige;
    font-size: var(--font-size-12);
    h3 {
      line-height: var(--line-height-30);
      margin: 0;
    }
    .category {
      margin: 0 2px 0 0;
      padding: 4px 0;
      border-bottom: 1px solid @borderColorBeige;
      &.active {
        font-weight: bold;
        border-bottom: 1px solid @underlineCrimson;
      }
    }
    span.count {
      float: right;
    }
  }

  .packages {
    height: 514px;
    .form-group {
      flex: 0;
    }
  }

  .visibilities {
    flex: 0 0 100%;
    height: 22px;
    text-align: right;
    .visibility {
      font-size: var(--font-size-13);
      line-height: 24px;
      border-bottom: 2px solid @underlineTan;
      margin-left: 5px;
      &.active {
        border-bottom: 2px solid @underlineCrimson;
        font-weight: bold;
      }
    }
  }

  .package-list {
    border-top: 1px solid @borderColorBeige;
    .package {
      &.installed, &.locked {
        background: rgba(0, 0, 0, 0.05);
        .package-title {
          color: @colorTan;
          a { text-decoration: none; }
        }
      }
    }
    .package-title {
      flex: 1 0 60%;
      margin: 0;
      color: @colorDark;
      font-weight: bold;
      a { text-decoration: underline; }
      i.fas { font-size: var(--font-size-12); }
      .tag.requires {
        position: relative;
        top: -2px;
      }
    }
    .package-description {
      color: @colorDark;
      font-size: var(--font-size-11);
      word-break: break-word;
      p { margin: 3px 0; }
    }

    .package-tags,
    .package-controls {
      flex: 0 0 100px;
      height: 68px;
      padding: 0;
      .tag {
        width: 100px;
        margin-bottom: 2px;
        background: rgba(0, 0, 0, 0.10);
        color: @colorDark;
        text-align: center;
        overflow: hidden;
        white-space: nowrap;
      }

      button {
        width: 100px;
        height: 24px;
        line-height: 22px;
      }
    }

    .packages-indicator {
      height: 200px;
      line-height: 100px;
      font-size: 2em;
      text-align: center;
      h3, i {
        color: @colorTan;
      }
    }

    .packages-failed {
      height: 200px;
      line-height: 100px;
      font-size: 2em;
      text-align: center;
      h3, i {
        color: @colorTan;
      }
    }
  }

  footer.install {
    flex: 0 0 100%;
    align-items: center;
    padding: 4px 0 0;
    border-top: 1px solid @borderColorBeige;
    label {
      flex: 0 0 200px;
    }
    input {
      height: 32px;
    }
    button {
      height: 32px;
      flex: 0 0 128px;
      margin-left: 5px;
    }
    .packages-loading {
      height: 200px;
      line-height: 100px;
      font-size: var(--font-size-em-3);
      text-align: center;
      h3 {
        color: @colorTan;
      }
    }
  }
}


/* ----------------------------------------- */
/*  World Configuration                      */
/* ----------------------------------------- */

#world-config {
  label {
    font-weight: bold;
  }

  label.world-desc {
    margin: 5px 0;
  }

  .editor-content {
    height: 300px;
  }

  input[name="name"] {
    flex: 2;
    margin-left: 3px;
  }
}

/* ----------------------------------------- */
/*  Join Session
/* ----------------------------------------- */

#join-game {
  position: relative;
  height: auto;
  width: 960px;
  top: calc(50% - 300px);
  margin: 0 auto;

  #world-title {
    flex: 0 0 100%;
    height: 64px;
    margin: 0 0 8px 0;
    padding: 0 10px;
    h1 {
      margin: 0;
      font-size: 2.25rem;
      line-height: 64px;
      border-bottom: none;
    }
  }

  .left {
    justify-content: space-between;
  }

  .right {
    margin-left: 8px;
  }

  .app {
    flex: 0;
    margin-bottom: 8px;
    h1 {
      font-size: var(--font-size-24);
      margin-bottom: 10px;
    }
  }

  form {
    .form-group,
    .form-group-stacked {
      margin-bottom: 5px;
    }

    select {
      height: 28px;
    }

    button {
      margin: 5px 0;
    }
  }

  #session-schedule {
    .current-players {
      span {
        font-size: var(--font-size-24);
        flex: 0 0 32px;
        text-align: center;
      }
      input[type="text"] {
        flex: 1.25;
      }
    }
  }

  #world-description {
    flex: 1;
    max-height: 450px;
    overflow-y: auto;
    padding: 0.5em;
  }

  .join-footer {
    p {
      padding: 0.5em 0;
    }
  }
}


/* ----------------------------------------- */
/*  Manage Players
/* ----------------------------------------- */
#manage-players {
  flex: 0 0 600px;

  h1 {
    border-bottom: 2px groove @underlineTan;
  }

  #player-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    min-height: 200px;
    max-height: 460px;

    .header {
      font-weight: bold;
    }

    li {
      margin: 3px 0;
      padding: 0 3px;

      > * {
        margin: 0 4px;
      }

      .user-delete {
        flex: 0 0 20px;
        line-height: 28px;
        text-align: center;
      }
    }
  }

  label.show {
    display: none;
    flex: 0 0 20px;
    text-align: center;
    color: @colorTan;
    cursor: pointer;
    &.visible {
      display: block;
      color: inherit;
    }
    input {
      display: none;
    }
    &:hover, &.active {
      text-shadow: 0 0 8px @shadowColorRed;
    }
  }

  footer button {
    margin: 10px 5px 0;
  }
}

/* ----------------------------------------- */
/* EULA and Notes
/* ----------------------------------------- */

#eula {
  height: 90%;
  #eula-content {
    flex: 1;
    overflow-y: auto;
    h3 {
      font-weight: bold;
    }
    #eula-updated {
      text-align: center;
    }
  }
  #eula-sign {
    flex: 0 0 100px;
    label[for="eula-agree"] {
      line-height: var(--line-height-20);
      padding-left: 5px;
      font-weight: bold;
    }
  }
}

#update-notes {
  .update-notes {
    max-height: 80vh;
    overflow-y: auto;
  }
  button#return {
    margin-top: 5px;
  }
}


/* ----------------------------------------- */
/* Updatelog
/* ----------------------------------------- */

.updated-packages-table {
  thead tr {
    display: block;
    :first-child {
      padding-left: 5px;
    }
  }
  tbody {
    overflow:auto;
    width:100%;
    display: block;
    max-height: 400px;
  }
  th, td {
    text-align: left;
    &.package {
      width: 300px;
    }
    &.action {
      width: 100px;
    }
    &.description {
      width: 600px;
    }
    &.Warning {
      color: orange;
    }
    &.Error {
      color: firebrick;
    }
    &.Success {
      color: darkolivegreen;
    }
  }
}
