@import './mixins';
@import '../quasar.variables.scss';

.body--dark {
  .in-table-link-button {
    box-shadow: 0 1px 2px 0 rgba($color: #ffffff, $alpha: 0);
  }

  .in-table-delete-button {
    box-shadow: 0 1px 2px 0 rgba($color: #ffffff, $alpha: 0);
  }

  .split-line {
    background: rgba($color: #ffffff, $alpha: 0.4);
  }

  .thin-shadow {
    background: #000000;
  }

  .detail-link-type:hover {
    color: #ffffff;
  }

  .link-type:hover {
    color: #ffffff;
  }

  .q-message-success-style, .q-message-warn-style, .q-message-error-style {
    background-color: #000000;
    box-shadow: rgba(255, 255, 255, 0.1) 0 0 10px 0;
  }
  .text-black000 {
    color: #ffffff !important;
  }
}

.body--light {
  .in-table-link-button {
    box-shadow: 0 1px 2px 0 rgba($color: #000000, $alpha: 0);
  }

  .in-table-delete-button {
    box-shadow: 0 1px 2px 0 rgba($color: #000000, $alpha: 0);
  }

  .split-line {
    background: rgba($color: #000000, $alpha: 0.4);
  }

  .thin-shadow {
    background: #ffffff;
  }

  .detail-link-type:hover {
    color: #000000;
  }

  .link-type:hover {
    color: #000000;
  }

  .q-message-success-style, .q-message-warn-style, .q-message-error-style {
    background-color: #ffffff;
    box-shadow: rgba(0, 0, 0, 0.1) 0 0 10px 0;
  }
  .text-black000 {
    color: #000000 !important;
  }

}

// 可点击的link
// explanation
.eg {
  font-size: 12px;
  line-height: 1;
  display: inline-block;
  font-weight: normal;
}

.hide {
  display: none !important;
}

// 点点点
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: 2;
}

.detail-link-type,
.detail-link-type:focus {
  color: var(--q-primary);
  cursor: pointer;
  padding-right: 16px;
  position: relative;

  &::after {
    content: url('data:image/svg+xml;charset=utf8,%3Csvg%20t%3D%221677140365147%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20p-id%3D%223571%22%20width%3D%2214%22%20height%3D%2214%22%3E%3Cpath%20d%3D%22M675.11699%20539.183194l-271.900268%20271.91116a38.453744%2038.453744%200%200%201-54.380251-54.383222l244.710141-244.723014-244.710141-244.719054a38.453744%2038.453744%200%200%201%2054.380251-54.383222l271.900268%20271.91116a38.455724%2038.455724%200%200%201%200%2054.386192z%22%20fill%3D%22%235469d4%22%20p-id%3D%223572%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E');
    position: absolute;
    right: 0;
    top: 50%;
    width: 14px;
    height: 14px;
    font-size: 14px;
    transform: translateY(-50%);
  }
}

.detail-link-type:hover {
  text-decoration: underline;
}

.link-type,
.link-type:focus {
  color: var(--q-primary);
  cursor: pointer;
}

.link-type:hover {
  text-decoration: underline;
}

.delete-type,
.delete-type:focus {
  color: var(--q-negative);
  cursor: pointer;
}

.delete-type:hover {
  color: var(--el-color-error-dark-2);
  text-decoration: underline;
}

// table里的点击按钮 link
.in-table-link-button {
  display: inline-block;
  text-align: center;
  line-height: 26px;
  padding: 0 8px;
  color: var(--q-primary);
  cursor: pointer;
  height: 26px;
  background: var(--my-white);
  border-radius: 4px;
  font-size: 14px;
  user-select: none;
}

.in-table-link-button:hover {
  background: var(--q-primary);
  color: var(--my-white);
}

// table里的删除按钮 delete/negative
.in-table-delete-button {
  display: inline-block;
  text-align: center;
  padding: 0 8px;
  line-height: 26px;
  color: var(--q-negative);
  cursor: pointer;
  height: 26px;
  border-radius: 4px;
  font-size: 14px;
  user-select: none;
}

.in-table-delete-button:hover {
  background: var(--q-negative);
  color: var(--my-white);
}

.input-password {
  font-family: password !important;

  input {
    -webkit-text-security: square;
  }
}

.absolute-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.absolute-x-center {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
}

.absolute-y-center {
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);
}

.split-line {
  background-color: transparent;
  opacity: 0.2;
}

.text-gradient {
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.f-bold {
  font-weight: 700;
}

.q-icon.f-bold {
  font-family: 'Material Icons';
  font-weight: bold;
}

.thin-shadow {
  border-radius: 4px;
}

.text-black {
  color: var(--q-dark) !important;
}

.table-text-wrap {
  word-break: break-all;
  white-space: pre-wrap;
  display: inline-block;
}

.q-message-error-style {
  color: $negative !important;
  border-radius: 4px;
}

.q-message-warn-style {
  color: $yellow !important;
  border-radius: 4px;
}

.q-message-success-style {
  color: $green !important;
  border-radius: 4px;
}

.my-label {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 2px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  line-height: 1;

  &.blue {
    background: rgba(85, 112, 241, 0.12);
    color: $primary;
  }

  &.green {
    background: $green-2;
    color: $green;
  }

  &.yellow {
    background: $yellow-2;
    color: $yellow;
  }

  &.red {
    background: $negative-2;
    color: $negative;
  }

  &.grey {
    background: var(--my-grey-1);
    color: $grey;
  }
}

.my-button {
  padding: 6px 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: $primary;
  color: var(--my-white);
  cursor: pointer;
  user-select: none;
  position: relative;

  &.negative {
    border: solid 1px $negative;
    color: $negative;
    background: var(--my-white);
    box-sizing: border-box;
  }

  &.primary {
    border: solid 1px $primary;
    color: $primary;
    background: var(--my-white);
    box-sizing: border-box;
  }

  &.disabled {
    background: var(--my-white);
    border: solid 1px $primary;
    opacity: 0.5;
    cursor: not-allowed;
    color: $primary;
  }
}

.my-status {
  padding: 0 16px;
  font-size: 14px;
  position: relative;
  color: $dark;

  &::before {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: $dark;
  }

  &.grey {
    color: $grey;

    &::before {
      background-color: $grey;
    }
  }

  &.green {
    color: $green;

    &::before {
      background: $green;
    }
  }

  &.red {
    color: $negative;

    &::before {
      background: $negative;
    }
  }

  &.yellow {
    color: $yellow;

    &::before {
      background: $yellow;
    }
  }

  &.blue {
    color: $primary;

    &::before {
      background: $primary;
    }
  }
}

.my-warn {
  padding: 4px 6px;
  border-radius: 4px;

  &.critical {
    padding: 4px 10px;
    background: var(--q-negative);
  }

  &.text-critical {
    border-radius: 0;
    position: relative;
    color: var(--q-negative) !important;
    line-height: 1.2;
    padding: 0 0 0 12px;

    &::before {
      content: '';
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      left: 0;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: var(--q-negative) !important;
    }
  }

  &.major {
    padding: 4px 10px;
    background: var(--my-label-warn-major);
  }

  &.text-major {
    border-radius: 0;
    position: relative;
    color: var(--my-label-warn-major) !important;
    padding: 0 0 0 12px;

    &::before {
      content: '';
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      left: 0;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: var(--my-label-warn-major) !important;
    }
  }

  &.minor {
    padding: 4px 10px;
    background: var(--my-label-warn-minor);
  }

  &.text-minor {
    border-radius: 0;
    position: relative;
    color: var(--my-label-warn-minor) !important;
    padding: 0 0 0 12px;

    &::before {
      content: '';
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      left: 0;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: var(--my-label-warn-minor) !important;
    }
  }

  &.warning {
    padding: 4px 10px;
    background: var(--my-label-warn-warning);
  }

  &.text-warning {
    border-radius: 0;
    position: relative;
    color: var(--my-label-warn-warning) !important;
    padding: 0 0 0 12px;

    &::before {
      content: '';
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      left: 0;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: var(--my-label-warn-warning) !important;
    }
  }

  &.cleared {
    padding: 4px 10px;
    background: var(--my-label-warn-cleared);
  }

  &.text-cleared {
    border-radius: 0;
    position: relative;
    color: var(--my-label-warn-cleared) !important;
    padding: 0 0 0 12px;

    &::before {
      content: '';
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      left: 0;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: var(--my-label-warn-cleared) !important;
    }
  }
}

.absolute-hide {
  position: absolute;
  z-index: -1;
}

$directions: (x, y, l, r, t, b);
$padding-value: 20px;

@each $direction in $directions {
  .q-p#{$direction}-md2 {
    @if $direction == 'x' {
      padding-left: $padding-value;
      padding-right: $padding-value;
    } @else if $direction == 'y' {
      padding-top: $padding-value;
      padding-bottom: $padding-value;
    } @else if $direction == 'l' {
      padding-left: $padding-value;
    } @else if $direction == 'r' {
      padding-right: $padding-value;
    } @else if $direction == 't' {
      padding-top: $padding-value;
    } @else if $direction == 'b' {
      padding-bottom: $padding-value;
    }
  }
}

$directions2: (x, y, l, r, t, b);
$padding-value2: 12px;

@each $direction in $directions2 {
  .q-m#{$direction}-sm2 {
    @if $direction == 'x' {
      margin-left: $padding-value2;
      margin-right: $padding-value2;
    } @else if $direction == 'y' {
      margin-top: $padding-value2;
      margin-bottom: $padding-value2;
    } @else if $direction == 'l' {
      margin-left: $padding-value2;
    } @else if $direction == 'r' {
      margin-right: $padding-value2;
    } @else if $direction == 't' {
      margin-top: $padding-value2;
    } @else if $direction == 'b' {
      margin-bottom: $padding-value2;
    }
  }
}