.c-dialog {
  display: flex;
  flex-direction: column;
  width: 60%;
  min-width: 600px;
  min-height: 50%;
  max-height: 80%;
  margin-top: 10vh !important;
  border-radius: 16px;

  &.large {
    width: 80%;
  }

  &.medium {
    width: 40%;
  }

  &.mini {
    width: 600px;
    min-height: 100px;
  }

  .el-dialog__header,
  .el-dialog__footer {
    flex: none;
    padding: 16px 24px;
  }

  .el-dialog__header {
    border-bottom: 1px solid $gray--light;
  }

  .el-dialog__title {
    color: $black;
    font-weight: bold;
  }

  .el-dialog__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: $spacing;
    border-radius: $radius;
    overflow: auto;
  }

  .el-dialog__footer {
    border-top: 1px solid $gray--light;

    .o-button + .o-button {
      margin-left: $spacing;
    }
  }
}

.c-dialog--full {
  .el-dialog__header {
    display: none;
  }

  .el-dialog__body {
    padding: 0;
    height: 100%;
  }
}

.c-lock {
  .el-loading-spinner > i {
    font-size: 48px;
  }

  .el-loading-text {
    margin: 10px;
    color: #fff;
    font-size: 18px;
  }

  &.success {
    .el-loading-spinner > i {
      color: $success;
    }
  }

  &.warning {
    .el-loading-spinner > i {
      color: $warning;
    }
  }

  &.error {
    .el-loading-spinner > i {
      color: $error;
    }
  }
}

.c-table {
  &__header {
    padding-bottom: $spacing;

    &:empty {
      padding-bottom: 0;
    }
  }

  &__main {
    flex: 0 1 auto;
    min-height: 0;
    min-width: 0;
  }

  &__btn {
    display: inline-block;
    position: relative;
    padding: 2px 0;
    color: $blue;
    font-size: 14px;

    & + & {
      margin-left: 16px;
    }

    & + &::before {
      content: "";
      display: inline-block;
      position: absolute;
      top: 50%;
      left: -8px;
      height: 12px;
      border-left: 1px solid $gray;
      transform: translateY(-50%);
    }
  }

  &.prevent-copy {
    .el-table__body-wrapper {
      .el-table__row {
        user-select: none;
        cursor: pointer;

        &.disabled {
          color: $gray;
          pointer-events: none;
          cursor: not-allowed;
        }

        .copy {
          user-select: text;
        }
      }
    }
  }

  thead.has-gutter th.el-table__cell {
    background-color: #f4f7fb;
  }

  .el-table__header-wrapper {
    flex: none;
  }

  .el-table__body-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
}

.c-grid-form {
  display: inline-grid;
  grid-template-columns: max-content minmax(400px, min-content);
  grid-row-gap: 10px;
  grid-column-gap: 10px;
  align-items: flex-start;

  &.medium {
    grid-template-columns: max-content minmax(300px, min-content);
  }

  &.mini {
    grid-template-columns: max-content max-content;
  }

  &.col {
    grid-template-columns: min-content;
    grid-row-gap: 8px;

    .c-grid-form__label {
      text-align: left;
      line-height: 1;
    }
  }

  &__row {
    grid-column: span 2;
  }

  &__label {
    color: $black;
    font-size: 14px;
    line-height: 40px;
    text-align: right;

    &.required::before {
      content: '*';
      color: #ff0000;
    }
  }

  &__option {
    min-height: 40px;
  }

  &__info {
    position: relative;
    margin-bottom: 18px;

    &::after {
      content: attr(data-info);
      position: absolute;
      left: 0;
      bottom: -18px;
      color: $gray;
      font-size: 12px;
      line-height: 1;
    }
  }

  &__auto {
    align-self: center;
    min-height: 0;
    line-height: normal;
  }
}

.c-sibling-item {
  & + & {
    margin-left: 10px !important;
  }

  & + &.far {
    margin-left: $spacing  !important;
  }

  &--v {
    & + & {
      margin-top: 10px !important;
    }

    & + &.far {
      margin-top: $spacing  !important;
    }
  }
}

.c-tabs {
  flex: none;

  .el-tabs__header {
    margin-bottom: 0;
  }

  &.padding {
    .el-tabs__nav-wrap {
      padding: 0 16px;
    }
  }

  .el-tabs__item {
    padding: 0;
    color: $info--dark;
    font-size: 16px;
    font-weight: bold;
    user-select: none;

    &.is-active {
      color: $blue;
    }

    &::before,
    &::after {
      content: '';
      padding-left: 20px;
    }
  }

  .el-tabs__active-bar {
    background-color: $blue;
  }

  .el-tabs__nav-wrap::after {
    height: 1px;
    background-color: $gray--light;
  }
}

.c-progress > .el-dialog {
  top: 20%;
  box-shadow: none;
  background-color: transparent;
}

.c-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 80%;
  max-height: 80%;
  margin-top: 10vh !important;
  box-shadow: none;
  background-color: transparent;

  &.schedule {
    min-width: 800px;
    align-items: stretch;

    .el-dialog__body {
      display: flex;
      min-height: 300px;
      background-color: #fff;
    }
  }

  .el-dialog__header {
    display: none;
  }

  .el-dialog__body {
    flex: 0 1 auto;
    min-height: 0;
    padding: 0;
    text-align: center;
  }
}

.c-thumbnail-col .cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

.c-info {
  color: $black;
  line-height: 1;

  &__block {
    padding: 20px 32px;
    background-color: #f5f7f9;

    & + & {
      margin-top: 8px;
    }
  }

  &__item + &__item {
    margin-left: 20px;
  }

  &__title {
    width: 120px;
    color: $info--dark;
  }

  &__value {
    font-size: 18px;
    font-weight: bold;

    &.primary {
      color: $blue;
    }
  }

  &__edit {
    color: $blue;
    font-size: 14px;
  }
}

.c-tags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(auto, 80px));
  grid-template-rows: max-content;
  grid-row-gap: 8px;
  grid-column-gap: 10px;
}

.c-tree-sidebar {
  flex: none;
  width: 200px;
  padding-right: $spacing;
  margin-right: $spacing;
  border-right: 1px solid $gray--light;

  &.large {
    width: 240px;
  }

  &__main {
    min-height: 100%;
    overflow-x: auto;
  }
}

.c-tree {
  color: $black;
  font-size: 16px;

  &__title {
    margin: 0 0 12px;
    color: $black;
    font-size: 20px;
    font-weight: bold;
  }

  &__content {
    display: flex;
    align-items: center;
    padding: 6px 6px 6px 0;

    &.sub {
      padding-left: 30px;
    }

    &:hover {
      background-color: $blue--light;
    }
  }

  &__expand {
    flex: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    transition: transform 0.4s;

    &.expand {
      transform: rotate(90deg);
    }
  }

  &__label {
    flex: auto;
    padding-right: 10px;
  }

  &__checkbox {
    pointer-events: none;
  }

  &__empty {
    padding: $spacing;
    color: $black;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
  }

  &__empty--content {
    padding: 6px 0 6px 30px;
    color: $info;
    font-size: 12px;
  }
}

.c-footer {
  position: absolute;
  width: 100%;
  bottom: 0;
  padding: 24px 16px 16px;
  color: #fff;
  background-image: linear-gradient(to bottom,
      rgba(#000, 0) 0%,
      rgba(#000, 0.6) 100%);

  .o-icon--active {
    margin-left: $spacing;
    font-size: 18px;
  }
}
