@import "./variables.less";

@actorNameHeight: 60px;

.sw5e.sheet.actor {

  /* ----------------------------------------- */
  /*  Sheet Header                             */
  /* ----------------------------------------- */
  .sheet-header {

    // Portrait Artwork
    img.profile {
      flex: 0 0 160px;
      max-width: 160px;
      height: 160px;
    }

    // Character Name
    h1.charname {
      flex: 1;
      height: @actorNameHeight;
      padding: 0;
      input {
        height: @actorNameHeight - 20px;
        margin: 10px 0;
      }
    }

    // Character Level
    .header-exp {
      flex: 0 0 150px;
      margin-right: 3px;
      height: @actorNameHeight;
      justify-content: flex-end;
      text-align: right;
    }

    // Character Summary
    .summary {
      height: 30px;
      border-bottom: @borderGroove;
      font-size: 18px;
      input, span {
        display: block;
        height: 24px;
        line-height: 24px;
      }
    }

    // Primary Attributes
    .attributes {
      flex: 0 0 100%;
      margin: 0;

      .attribute {
        height: 70px;
        margin: 0;
        border: none;
        border-right: @borderGroove;
        border-radius: 0;

        &:last-child {
          border-right: none;
        }

        .attribute-value {
          height: 30px;
          line-height: 30px;
        }
      }

      // Movement Configuration
      .movement {
        h4.attribute-name {
          position: relative;
        }
        .config-button {
          position: absolute;
          display: none;
          right: 0;
          top: 1px;
          font-size: 12px;
          font-weight: normal;
        }
        &:hover .config-button {
          display: block;
        }
      }

      // Temporary HP
      input.temphp {
        width: 48%;
      }
    }
  }

  /* ----------------------------------------- */
  /*  General Styles                           */
  /* ----------------------------------------- */

  // Box Headers
  h4.box-title {
    height: 18px;
    line-height: 16px;
    margin: 4px 8px 2px;
    .russoOne(14px);
    color: @colorOlive;
    border-bottom: 1px solid @colorFaint;
    white-space: nowrap;
  }

  /* ----------------------------------------- */
  /*  Attributes                               */
  /* ----------------------------------------- */

  .tab.attributes {
    overflow: hidden;
  }

  ul.attributes {
    flex: 0 0 60px;
    list-style: none;
    margin: 0;
    padding: 0;

    li.attribute {
      height: 60px;
      margin: 0 5px 0 0;
      border: @borderGroove;
      border-radius: 4px;
      text-align: center;

      &:last-child {
        margin: 0;
      }

      .attribute-value {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 28px;
        line-height: 28px;
        .russoOne();

        > * {
          font-weight: 400;
          font-size: 24px;
        }

        &.multiple input {
          flex: 0 0 33%;
        }
      }

      .attribute-footer {
        flex: 0 0 18px;
        margin-top: -1px;
        line-height: 18px;
        font-family: "Signika", sans-serif;
        font-size: 12px;
        font-weight: 400;
        white-space: nowrap;
      }
    }
  }

  /* ----------------------------------------- */
  /*  Ability Scores                           */
  /* ----------------------------------------- */

  .ability-scores {
    flex: 0 0 100px;
    height: 440px;
    list-style: none;
    margin: 0;
    padding: 0;
    .russoOne();
    border: @borderGroove;
    border-radius: 3px;

    .ability {
      height: 70px;
      text-align: center;
      border-bottom: @borderGroove;

      &:last-child {
        border-bottom: none;
        margin-bottom: -3px;
      }

      input.ability-score {
        height: 30px;
        width: 36px;
        margin: 0 auto;
        line-height: 32px;
        font-size: 24px;
      }

      .ability-modifiers {
        height: 24px;
        margin: -8px 0 0;

        span.ability-mod,
        span.ability-save {
          flex: 0 0 24px;
          height: 22px;
          line-height: 22px;
          font-size: 16px;
          border-top: @borderGroove;
        }

        span.ability-mod {
          border-right: @borderGroove;
        }

        .ability-proficiency {
          line-height: 30px;
        }

        span.ability-save {
          border-left: @borderGroove;
        }
      }
    }
  }

  // Proficiency Toggle Buttons
  .proficiency-toggle {
    color: @colorBeige;
    font-size: 12px;
  }
  .proficient .proficiency-toggle {
    color: @colorOlive;
  }

  .locked .proficiency-toggle {
    color: @colorBeige;
    text-shadow: none;
    cursor: default;
  }

  /* ----------------------------------------- */
  /*  Skills                                   */
  /* ----------------------------------------- */

  ul.skills-list {
    flex: 0 0 180px;
    height: 440px;
    list-style: none;
    margin: 0 5px 0;
    padding: 3px 0 2px;
    border: @borderGroove;
    border-radius: 3px;

    li.skill {
      height: 24px;
      width: 225px;
      padding: 3px 2px;

      &:nth-child(even) {
        background: rgba(0, 0, 0, 0.05);
      }

      h4 {
        flex: 1px;
        margin: 0;
        font-size: 11px;
        line-height: 18px;
      }

      .skill-proficiency {
        flex: 0 0 16px;
        line-height: 18px;
      }

      .skill-ability {
        flex: 0 0 26px;
        text-transform: capitalize;
      }

      .skill-mod {
        flex: 0 0 20px;
      }

      .skill-passive {
        flex: 0 0 26px;
        text-align: center;
        color: @colorTan;
      }
    }
  }

  /* ----------------------------------------- */
  /*  Statuses                                 */
  /* ----------------------------------------- */

  .counters {
    flex: none;
    padding: 5px 0;
    margin: 0;
    border-bottom: @borderGroove;

    .counter {
      height: 20px;
      line-height: 20px;

      h4 {
        flex: auto;
        margin: 0;
        font-size: 13px;
        font-weight: bold;
        color: @colorOlive;
      }

      .counter-value {
        flex: none;
        text-align: right;
        > * {
          display: inline;
        }
      }

      input[type="text"],
      input[type="number"] {
        height: 20px;
        max-width: 20px;
        margin: 0;
        padding: 0;
        text-align: center;
      }
      input[type="checkbox"] {
        position: relative;
        width: 16px;
        height: 16px;
        margin: 0;
        top: 4px;
      }
      span.sep {
        font-size: 12px;
      }
    }
  }

  /* ----------------------------------------- */
  /*  Traits                                   */
  /* ----------------------------------------- */

  .center-pane {
    height: 100%;
    padding: 0 5px 0 3px;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .traits {
    .form-group, .form-group-stacked {
      margin: 0 0 3px 0;
      justify-content: space-between;
    }
    .config-button {
      flex: 1;
    }

    label {
      flex: none;
      line-height: 20px;
      font-weight: bold;
      margin: 0 10px 0 0;
    }

    select {
      max-width: 200px;
    }

    input {
      text-align: right;
    }

    i.fas {
      float: right;
      margin-right: 3px;
      text-align: right;
      color: #999;

      &:hover {
        color: #111;
        text-shadow: 0 0 10px red;
      }
    }

    .inactive {
      color: @colorTan;
    }
  }

  /* ----------------------------------------- */
  /*  Inventory Lists                          */
  /* ----------------------------------------- */

  .tab.features,
  .tab.inventory,
  .tab.powerbook {
    overflow-y: hidden;
  }

  /* Inventory List Filters */
  .inventory-filters {
    margin: 0 8px;
    flex: 0 0 20px;
    justify-content: flex-end;

    .currency {
      flex: 0 0 100%;
      list-style: none;
      margin: 4px 0 8px;
      padding: 0;
      font-size: 12px;

      label {
        flex: 0;
        margin-left: 8px;
        text-align: right;
        line-height: 20px;
        color: @colorTan;
      }
      input[type="text"] {
        flex: 0 0 48px;
        text-align: center;
        margin-left: 8px;
        border-bottom: @borderGroove;
      }
    }
  }

  // Inventory item lists
  .inventory-list {
    padding: 0 5px;
    .item {
      .item-name {
        cursor: pointer;
        &.rollable:hover .item-image {
          background-image: url("../../icons/svg/d20-grey.svg") !important;
        }
        &.rollable .item-image:hover {
          background-image: url("../../icons/svg/d20-black.svg") !important;
        }
        i.attuned { color: @colorTan; }
        i.not-attuned { color: @colorCrimson; }
      }

      // Item uses
      .item-uses input {
        width: 24px;
        text-align: center;
      }

      // Item Dropdown Properties
      .item-properties {
        margin-top: 3px;
      }

      // Charged
      .item-recharge {
        flex: 0 0 80px;
        text-align: right;
        font-size: 11px;
        white-space: nowrap;
      }
    }

    // Inventory Header
    .inventory-header {
      .item-controls a.item-create {
        flex: 0 0 100%;
      }
    }

    // Item Detail Sections
    .item-detail {
      flex: 0 0 70px;
      font-size: 12px;
      text-align: center;
      border-right: 1px solid @colorFaint;
      word-break: break-word;
      white-space: nowrap;
      overflow: hidden;
      &:last-child { border-right: none; }
      &.item-action {flex: 0 0 100px}
      &.attunement {flex: 0 0 24px}
    }
    .item-weight {
      flex: 0 0 60px;
      border-left: 1px solid @colorFaint;
      border-right: 1px solid @colorFaint;
    }

    // Item Control Buttons
    .item-controls {
      flex: 0 0 44px;
    }

    // Item Dropdown Summary
    .item-summary {
      flex: 0 0 100%;
      font-size: 12px;
      line-height: 16px;
      padding: 0.25em 0.5em;
      color: @colorDark;
      border-top: 1px solid @colorFaint;
		  h2 {
		    font-family: 'Russo One';
		    font-size: 20px;
		    font-weight: 400;
		    text-transform: uppercase;
		    letter-spacing: 0.5px;
		    border-bottom: 2px solid rgb(13, 153, 204);
		    color: #c40f0f;
		  }      
    }
  }

  /* Encumbrance Bar */
  .encumbrance {
    flex: 0 0 12px;
    background: @colorTan;
    margin: 1px 15px 0 1px;
    border: 1px solid @colorDark;
    border-radius: 3px;
    position: relative;

    .encumbrance-bar {
      position: absolute;
      top: 1px;
      left: 1px;
      background: #6c8aa5;
      height: 8px;
      border: 1px solid #cde4ff;
      border-radius: 2px;
    }

    .encumbrance-label {
      height: 10px;
      padding: 0 5px;
      position: absolute;
      top: 0;
      right: 0;
      font-size: 13px;
      line-height: 12px;
      text-align: right;
      color: #EEE;
      text-shadow: 0 0 5px #000;
    }

    .encumbrance-breakpoint {
      display: block;
      position: absolute;
      &.encumbrance-33 { left: 33% }
      &.encumbrance-66 { left: 66% }
    }

    .arrow-up {
      bottom: 0;
      width: 0;
      height: 0;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      border-bottom: 4px solid #666;
    }

    .arrow-down {
      top: 0;
      width: 0;
      height: 0;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      border-top: 4px solid #666;
    }

    &.encumbered {
      .arrow-up { border-bottom: 4px solid #000; }
      .arrow-down { border-top: 4px solid #000; }
    }
  }

  /* ----------------------------------------- */
  /*  Powerbook                                */
  /* ----------------------------------------- */

  .powercasting-ability {
    flex: 0 0 240px;
    margin: 0;
    label, span {
      flex: none;
    }
    input {
      flex: 0 0 28px;
      text-align: center;
    }
    select {
      margin: 0 5px;
      flex: 0 0 120px;
    }
  }

  .power-slots,
  .power-comps {
    flex: none;
    padding: 0 5px;
    font-size: 12px;
    color: @colorTan;
    border-right: 1px solid @colorFaint;
  }

  .power-slots {
    input {
      display: inline;
      max-width: 20px;
    }
    .sep {
      font-size: 13px;
      font-weight: normal;
    }
  }

  .powerbook .power-uses {
    padding-right: 5px;
    text-align: right;
    color: @colorTan;
  }

  .power-school, .power-action, .power-target {
    flex: 0 0 100px;
    font-size: 12px;
    color: @colorTan;
    text-align: center;
    border-right: 1px solid @colorFaint;
  }

  .power-component {
    line-height: 14px;
    &.C, &.R {
      display: inline-block;
      text-align: center;
      padding-top: 1px;
      width: 16px;
      color: @colorFaint;
      background: rgba(0, 0, 0, 0.4);
      border: 1px solid transparent;
      border-radius: 8px;
    }
  }

  // Empty powerbook controls
  .powerbook-empty .item-controls { flex: 1; }

  /* ----------------------------------------- */
  /*  TinyMCE                                  */
  /* ----------------------------------------- */

  .editor {
    padding: 0 8px;
  }
}

#actor-flags {
  .window-content {
    overflow-y: hidden;
  }
  form {
    height: 100%;
  }
  .form-body {
    height: calc(100% - 40px);
    padding-right: 8px;
    margin-bottom: 4px;
    overflow-y: auto;
    scrollbar-width: thin;
  }
}