@import '../../core/src/style/variables';
@import '../../core/src/style/mixins'; 

$no-mobile-view-after-pixels: 1276px;
$mobile-view-before-pixels: 1275px;

// Mapping Form Styles Start Here
.mapping-wrapper {
  width: 100%;
  text-align: left;
  display: flex;

  @media screen and (min-width: $no-mobile-view-after-pixels) {
    flex-direction: row;
  }
  @media screen and (max-width: $mobile-view-before-pixels) {
    flex-direction: column;
    padding-left: 5px;
  }

  font-size: 12px;

  &-col {
    padding-right: 30px;

    &.first {
      max-width: 400px;
      display: grid;
    }

    &.second {
      max-width: 340px;
    }
    
    &.third {
      display: flex;
      * div {
        padding-bottom: 0.7em;
      }
    }
    
    &.fourth {
      min-width: 200px;
    }

    &-item {
      float: left;
      margin-right: $gutter;
      padding-bottom: 0.7em;

      &.push-right {
        @media screen and (min-width: $no-mobile-view-after-pixels) {
          float: right !important;
        }        
      }

      .bom-region {
        * .wpt-checkbox-label {
          line-height: 0;
        }
        * label, * span {
          color: $black;
          margin: 0;
          padding: 0;
        }
      }
    }
  }

  * .cursor-labels {
    * label {
      cursor: pointer;
    }
  }

  * wpt-checkbox {
    margin-right: 5px;  
    
    > label {
      cursor: pointer;
    }
  }

  * .large {
    width: 647px;
  }

  * .small {
    width: 65px;
  }

  * label {
    text-transform: uppercase;
    font-weight: bold;
    margin: 5px 10px 5px 0px;
    color: $middarkgrey;
    display: inline-block;
    padding: 8px 0;
  }

  * input {
    padding: 3px 10px;

    &.disabled {
      opacity: 0.7;
    }
  }

  * span,
  * input {
    font-size: 18px;
  }  
  
  // Number Input Fields
  .bom-mapping-data-number {
    position: relative;
    overflow: hidden;
    //float: right;
    padding: 3px;
    padding-bottom: 0.7em;

    input {
      width: 100%;
      height: 35px;
    }

    .arrow {
      width: 0;
      height: 0;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      position: absolute;
      right: 10px;
      cursor: pointer;

      &--up {
        border-bottom: 4px solid $black;
        top: 10px;
      }

      &--down {
        border-top: 4px solid $black;
        bottom: 15px;
      }
    }

    &.disabled {
      input {
        color: $grey;
      }

      .arrow {
        cursor: default;

        &--up,
        &--down {
          border-bottom-color: $grey;
          border-top-color: $grey;
        }
      }
    }
  }

  // "Select Worksheet" Fields
  .bom-mapping-sheet-selection {
    position: relative;
    width: 100%;
    display: flex;

    select {
      color: $black;
      display: block;
      width: 160px;
      border-radius: 0;
      padding: 8px 25px 8px 10px;
      background-color: $white;
      -webkit-appearance: none;
      -moz-appearance: none;
      cursor: pointer;

      &.touched {
        color: $black;
      }
    }

    .arrow {
      width: 0;
      height: 0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      position: absolute;
      right: 10px;
      pointer-events: none;

      &--down {
        border-top: 6px solid $black;
        bottom: 15px;
      }
    }
  }
}

// Mapping Table Styles Start Here

.bom-mapping-preview-wrapper
{    
  &:focus-visible {
    outline: solid $focus-outline-sickness $focus-outline-color;
    border: 0;
    margin-left: 3px;
    margin-right: 3px;
  }
}

thead, tr
{    
  &:focus-visible {
    outline: solid $focus-outline-sickness  $focus-outline-color;
    border: 0;
  }
}

.bom-mapping {
  table {
    margin: 0; // This fixes myarrow table styles appplied to BOM
  }
  h1 {
    color: $black;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 250%;
    margin: 0.5em 0 0.25em;
  }

  h2 {
    margin: 0.5em 0 1em;
    font-size: 22px;
  }

  .cpn-confirm {
    text-align: right;
  }

  &-preview-wrapper {
    @media screen and (min-width: $no-mobile-view-after-pixels) {
      margin: 1em 0 1.5em;
    }
    @media screen and (max-width: $mobile-view-before-pixels) {
      margin: 1em 0.5em 1.5em;
    }
    overflow-x: scroll;
    max-height: 366px;
    min-height: 200px;
    border: 1px solid $midlightgrey;
  }

  &-required {
    color: $red;
    font-size: $font-size-s;
    @media screen and (min-width: $no-mobile-view-after-pixels) {
      margin: 1.5em 0 0.5em;
    }
    @media screen and (max-width: $mobile-view-before-pixels) {
      margin: 1.5em 0.5em 0.5em;
    }
  }

  &-preview {
    width: 100%;

    tr.headerRow {
      background-color: $lightergrey;
    }

    tr.dataHeaderRow {
      background-color: #b3e2f5;
    }

    tr.dataRow {
      background-color: $grey;
    }

    &-cell {
      max-width: 275px;
      min-width: 275px;
      text-align: left;
      padding: 6px 10px;
      font-size: $font-size-m;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      border-right: 1px solid $midlightgrey;
      border-bottom: 1px solid $midlightgrey;

      &:first-child {
        width: 40px;
        min-width: 40px;
        text-align: center;
      }
    }

    .custom-header {
      padding: 1px; // 3px makes focus clearly visible in Arrow.com but leaves too wide padding in MyArrow. 1px is a compromise.
    }

  }

  &-error {
    font-size: $font-size-m;
    float: right;
    clear: both;
  }

  .modal-action-buttons {
    button {
      width: auto;
      min-width: 232px;
      height: 3.5em;    
      @media screen and (min-width: 901px) {
        float: right;
      }
      @media screen and (max-width: 900px) {
        margin-right: 15px;
      } 
  
      &:nth-child(2) {
        margin-right: 15px;
      }
    }
  }

  .skip-table-content {
    position: absolute;
    left: -1000px;
  }
  .skip-table-content:focus {
    line-height: 27px;
    padding: 0 12px;
    border: 1px solid $blue;
    background-color: #ffff;
    color: $blue;
    outline: solid $focus-outline-sickness $focus-outline-color;
    text-decoration: none;
    left: auto;
    border-radius: 1px;
    font-size: 12px;
  }
}

.errorCell {
  border: $red solid 1px;
  display: flex;
  color: $red;
}
