@import url(~antd/lib/table/style/index-pure.less);
@import '../../style/themes/index.less';
@import './size';

@table-header-icon-color: @cloud-gray-60;
@icon-prefix-cls: ~'@{ant-prefix}-icon';
.@{table-prefix-cls} {
	color: @heading-color;

	a:hover {
		color: @primary-color;
	}

	&-tbody {
		& > tr {
			&.@{table-prefix-cls}-row:not(.@{table-prefix-cls}-row-level-0) {
				background-color: @table-expanded-row-bg;

				&:hover > td {
					background-color: @secondary-component-background;
				}
			}
		}
	}
}
.b-design-table-tbody > tr.b-design-table-row-selected > td {
	border-color: @table-border-color;
}
.@{table-prefix-cls}-tbody > tr.@{table-prefix-cls}-row-selected:hover > td {
	background-color: @table-selected-row-hover-bg;
}

.@{table-prefix-cls}-thead th.@{table-prefix-cls}-column-has-sorters {
	&,
	&:hover {
		&::before {
			background-color: rgba(0, 0, 0, 0.06) !important;
		}
	}
}

.@{table-prefix-cls}-column-sorter-inner {
	flex-direction: initial;
	align-items: baseline;
}
.@{table-prefix-cls}-column-sorter {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	color: @table-header-icon-color;
	border-radius: 2px;
	cursor: pointer;
	transition: all 0.3s;
	width: 24px;
	height: 24px;

	&-up,
	&-down {
		font-size: 14px;
	}
	&-down {
		margin-left: -14px;
	}
}
.@{table-prefix-cls}-column-sorters:hover .@{table-prefix-cls}-column-sorter {
	color: @table-header-icon-color;
	background: @table-header-filter-active-bg;
}

// Bordered
.@{table-prefix-cls} {
	&&-bordered > &-container {
		border-left: none;
	}
}
// ============================ Header ============================
.@{table-prefix-cls} {
	&-thead {
		> tr {
			> th {
				&:not(:last-child):not(.@{table-prefix-cls}-selection-column):not(.@{table-prefix-cls}-row-expand-icon-cell):not([colspan])::before {
					height: 100%;
				}
			}
		}
		th.@{table-prefix-cls}-column-sort {
			background: @table-header-bg;
		}
	}
}

// ========================== Expandable ==========================
.@{table-prefix-cls} {
	&-cell&-row-expand-icon-cell {
		padding-right: 0;
		color: @font-color-caption;
		.@{icon-prefix-cls} {
			color: @font-color-caption;
		}

		> .@{icon-prefix-cls} {
			display: inherit;
		}
	}

	&-row-expand-icon {
		width: @iconfont-size-sm;
		height: @iconfont-size-sm;
		border: none;
		background: none;
		transform: none;
		// float: unset;
		position: initial;
		border-radius: unset;
		vertical-align: middle;
		font-size: @iconfont-size-sm;
		color: @font-color-caption;

		&:focus {
			color: @font-color-caption;
		}

		&:hover {
			color: @font-color-caption;
		}

		&::before,
		&::after {
			content: none;
		}

		.@{table-prefix-cls}-row-indent + & {
			margin-top: 1px;
		}
	}
}

//========================== 子表格嵌套 ==========================
.@{table-prefix-cls}-expanded-row {
	.@{table-prefix-cls} {
		background: @table-expanded-row-bg;
		border-left: 1px solid @border-color-split;
	}
	.@{table-prefix-cls}-thead {
		> tr {
			> th {
				background: @table-expanded-row-bg;
			}
		}
	}
}
