@import 'components/variables';

* {
  outline: none !important;
  box-sizing: border-box;

  &:focus {
    outline: none !important;
  }

  &.ik-pull-left {
    float: left;
  }

  &.ik-pull-right {
    float: right;
  }

  &.ik-disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
  }

  &.ik-hidden {
    display: none !important;
  }

  &.ik-visible {
    visibility: visible;
  }

  &.ik-invisible {
    visibility: hidden;
  }

  &.ik-display-block {
    display: block;
  }

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

  &.ik-display-table {
    display: table;
  }

  &.ik-display-table-cell {
    display: table-cell;
  }

  @each $width in 0, 10, 20, 28, 30, 40, 50, 60, 70, 80, 90, 100, 120, 135, 140, 150, 160, 180, 190, 200, 230, 240, 280, 300, 480, 560, 600, 700, 760, 800 {
    &.ik-width-#{$width} {
      width: #{$width}px !important;
    }

    &.ik-min-width-#{$width} {
      min-width: #{$width}px !important;
    }
  }

  @each $height in 20, 40, 50, 100, 200, 300, 400, 540, 600 {
    &.ik-height-#{$height} {
      height: #{$height}px;
    }

    &.ik-min-height-#{$height} {
      min-height: #{$height}px;
    }
  }

  @each $margin in 0, 4, 5, 8, 10, 12, 15, 20, 25, 30, 35, 40, 50, 55, 60, 80, 90, 95, 100, 120, 140, 155, 200, 220 {
    &.ik-margin-top-#{$margin} {
      margin-top: #{$margin}px;
    }

    &.ik-margin-right-#{$margin} {
      margin-right: #{$margin}px;
    }

    &.ik-margin-bottom-#{$margin} {
      margin-bottom: #{$margin}px;
    }

    &.ik-margin-left-#{$margin} {
      margin-left: #{$margin}px;
    }

    &.ik-margin-#{$margin} {
      margin: #{$margin}px;
    }

    &.ik-margin-vertical-#{$margin} {
      @extend .ik-margin-top-#{$margin};

      @extend .ik-margin-bottom-#{$margin};
    }

    &.ik-margin-horizontal-#{$margin} {
      @extend .ik-margin-right-#{$margin};

      @extend .ik-margin-left-#{$margin};
    }
  }

  @each $padding in 0, 4, 5, 10, 15, 20, 25, 30, 40, 45, 50, 60, 80, 100, 160 {
    &.ik-padding-top-#{$padding} {
      padding-top: #{$padding}px !important;
    }

    &.ik-padding-right-#{$padding} {
      padding-right: #{$padding}px !important;
    }

    &.ik-padding-bottom-#{$padding} {
      padding-bottom: #{$padding}px !important;
    }

    &.ik-padding-left-#{$padding} {
      padding-left: #{$padding}px !important;
    }

    &.ik-padding-#{$padding} {
      padding: #{$padding}px !important;
    }

    &.ik-padding-vertical-#{$padding} {
      @extend .ik-padding-top-#{$padding};

      @extend .ik-padding-bottom-#{$padding};
    }

    &.ik-padding-horizontal-#{$padding} {
      @extend .ik-padding-right-#{$padding};

      @extend .ik-padding-left-#{$padding};
    }
  }

  @each $percent in 12, 20, 25, 75, 80, 88, 100 {
    &.ik-width-percent-#{$percent} {
      width: percentage($percent / 100) !important;
    }
  }

  &.ik-width-percent-33 {
    width: 33.33333%;
  }

  &.ik-position-right {
    position: absolute;
    right: 30px;
  }

  @each $size in 12, 14, 16, 18, 20, 24, 28, 30, 32, 36 {
    &.ik-font-size-#{$size} {
      font-size: #{$size}px;
    }
  }

  &.ik-height-percent-100 {
    height: 100%;
  }

  &.ik-min-width-1024 {
    min-width: 1024px;
  }

  &.ik-overflow-hidden {
    overflow: hidden;
  }

  &.ik-word-break {
    word-break: break-all;
    word-wrap: break-word;
  }

  &.ik-pre-work-break {
    white-space: pre-wrap;
  }

  @each $justify in left, center, right {
    &.ik-text-#{$justify} {
      text-align: #{$justify} !important;
    }
  }

  &.ik-theme-color {
    color: #459df5;
  }

  &.ik-theme-background-color {
    background-color: #459df5;
  }

  &.ik-background-color-white {
    background-color: white;
  }

  &.ik-red-color {
    color: red;
  }

  &.ik-border-red-color {
    border: 1px solid red !important;
  }

  &.ik-gray-color {
    color: #999;
  }

  &.ik-primary-color {
    color: #459df5;
  }

  &.ik-black-color {
    color: black;
  }

  &.ik-color-danger {
    color: #fb6b5b;
  }

  &.ik-btn-primary {
    color: #fff;

    @extend .ik-theme-background-color;

    border-color: darken(#459df5, 10%);
    border-radius: 2px;
  }

  &.ik-datetime-picker {
    input[type='text'] {
      background-color: #fff;
    }

    span {
      cursor: pointer;
    }
  }

  &.ik-modal-header {
    color: #fff;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
  }

  &.ik-table-layout-fixed {
    table-layout: fixed;
  }

  &.ik-required {
    &::before {
      content: "*";
      margin-right: 3px;
      color: red;
    }
  }

  &.ik-border-none {
    border: none;
  }

  &.ik-text-underline {
    text-decoration: underline;
  }

  @each $cursor in pointer, not-allowed, default {
    &.ik-cursor-#{$cursor} {
      cursor: #{$cursor};
    }
  }

  @each $vertical in top, middle, baseline, bottom {
    &.ik-vertical-align-#{$vertical} {
      vertical-align: #{$vertical};
    }
  }
}

/* 隐藏chrome滚动条 */
//*::-webkit-scrollbar
//  display: none

/* HTML 元素 */
html, body {
  height: 100%;
}

textarea {
  resize: none !important;
}

*[readonly='readonly'], *[disabled='disabled'] {
  background-color: #efefef !important;
}

.ik-datetime-picker input {
  background-color: white !important;
}

svg {
  &.file-color {
    display: block;
    width: 80px;
    height: 100px;
    margin: 0 auto;
    fill: #dedee5;
  }
}

/* 产品下拉框 */
#ik-product-dropdown-list {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  width: 620px;
  height: 222px;
  display: none;
  border: 1px solid $ikd-color-h1;
  background-color: white;

  .table-head, .table-item {
    height: 30px;
    overflow: hidden;
    background-color: $ikd-color-o16;
    border-bottom: 1px solid $ikd-color-h1;

    > div {
      float: left;
      min-height: 30px;
      padding: 0 10px;
      line-height: 30px;
      border-right: 1px solid $ikd-color-h1;
      border-bottom: 1px solid $ikd-color-h1;

      &:nth-child(1) {
        width: 150px;
      }

      &:nth-child(2) {
        width: 200px;
      }

      &:nth-child(3) {
        width: 150px;
      }

      &:nth-child(4) {
        width: 100px;
        border-right: none;
      }
    }
  }

  .table-body {
    height: 150px;
    overflow-y: auto;

    .table-item {
      cursor: pointer;
      background-color: white;

      &:hover, &.active {
        background-color: $ikd-color-l4;
      }

      > div {
        overflow-x: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }

    p.table-no-result {
      padding: 15px;
      text-align: center;
    }
  }

  .table-foot {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    font-size: $ikd-font-size-t3;
    line-height: 40px;
    text-align: center;
    background-color: $ikd-color-o16;

    a {
      text-decoration: none;
    }
  }
}

/* 定制Class */
.no-content-svg {
  display: block;
  fill: #ededf1;
  margin: 0 auto;
}

.container-fluid {
  height: inherit;
}

.ik-layout-height {
  height: calc(100% - 50px);
}

.bootstrap-dialog.type-ik .modal-header {
  background-color: #444a63;
}

.ik-datetime-picker input {
  cursor: pointer;
}

.fa-width-18px {
  width: 18px;
}

.search-loading {
  display: block;
  margin: 50px auto 0;
  font-size: 50px;
}

.ik-block-center {
  display: block;
  margin-right: auto;
  margin-left: auto;
}

.ik-scan-logo {
  position: absolute;
  height: 30px;
  top: 10px;
  left: 140px;
}

.ui-pnotify-container {
  span {
    float: right;
  }
}

//body
//  font-family: Helvetica, Tahoma, Arial, 'Hiragino Sans GB', "Microsoft YaHei", "微软雅黑", STXihei, "华文细黑",  Heiti, "黑体", SimSun, "宋体",  sans-serif

.bootstrap-datetimepicker-widget {
  z-index: 2046;
  background-color: white;
}

// 全局修改 select2 样式
select.select2-hidden-accessible {
  & + span.select2-container {
    margin-right: 10px;
  }
}

span.select2-selection {
  padding-left: 5px !important;
}

span.select2-selection__rendered {
  font-size: $ikd-font-size-t4;
  color: $ikd-color-b2;
}

span.select2-dropdown {
  border-color: $ikd-theme-color;
}

// container 样式
body > .container {
  width: 100%;
  min-width: 1200px;
  height: 100%;
}

// 列表全选 单选样式
i.list-select-all, i.list-select-tr {
  cursor: pointer;
}

i.list-select-tr {
  color: $ikd-theme-color;
}
