
table.dataTable {
	clear: both;

	td,
	th {
		-webkit-box-sizing: content-box;
		box-sizing: content-box;

		&.dataTables_empty {
			text-align: center;
		}
	}

	// Style options for the table. Foundation provides its own, but it is also
	// useful to have a few more for DataTables
	&.nowrap {
		th,
		td {
			white-space: nowrap;
		}
	}
}


// DataTables' built in feature elements
div.dataTables_wrapper {
	div.row.uk-grid.dt-merge-grid {
		margin-top: 5px;
	}

	div.dataTables_length {
		label {
			font-weight: normal;
			text-align: left;
			white-space: nowrap;
		}

		select {
			width: 75px;
			display: inline-block;
		}
	}

	div.dataTables_filter {
		text-align: right;

		label {
			font-weight: normal;
			white-space: nowrap;
			text-align: left;
		}

		input {
			margin-left: 0.5em;
			display: inline-block;
			width: auto;
		}
	}

	div.dataTables_info {
		padding-top: 8px;
		white-space: nowrap;
	}

	div.dataTables_paginate {
		margin: 0;
		white-space: nowrap;
		text-align: right;

		ul.pagination {
			margin: 2px 0;
			white-space: nowrap;
		}
	}

	div.dataTables_processing {
		position: absolute;
		top: 50%;
		left: 50%;
		width: 200px;
		margin-left: -100px;
		margin-top: -26px;
		text-align: center;
		padding: 1em 0;
	}
}


// Sorting - using :before and :after with UTF8 characters
table.dataTable thead {
	> tr > th,
	> tr > td {
		&.sorting_asc,
		&.sorting_desc,
		&.sorting {
			padding-right: 30px;
		}

		&:active {
			outline: none;
		}
	}

	.sorting,
	.sorting_asc,
	.sorting_desc,
	.sorting_asc_disabled,
	.sorting_desc_disabled {
		cursor: pointer;
		position: relative;

		&:before,
		&:after {
			position: absolute;
			bottom: 1.2em;
			display: block;
			opacity: 0.3;
		}

		&:before {
			right: 1em;
			content: "\2191"; // up arrow - ascending
		}

		&:after {
			right: 0.5em;
			content: "\2193"; // down arrow - descending
		}
	}

	.sorting_asc:before,
	.sorting_desc:after {
		opacity: 1;
	}

	.sorting_asc_disabled:before,
	.sorting_desc_disabled:after {
		opacity: 0;
	}
}


// Scrolling
div.dataTables_scrollHead table.dataTable {
	margin-bottom: 0 !important;
}

div.dataTables_scrollBody {
	table {
		border-top: none;
		margin-top: 0 !important;
		margin-bottom: 0 !important;

		thead { // Hide sort icons
			.sorting:after,
			.sorting_asc:after,
			.sorting_desc:after {
				display: none;
			}
		}

		tbody tr:first-child th,
		tbody tr:first-child td {
			border-top: none;
		}
	}
}

div.dataTables_scrollFoot table {
	margin-top: 0 !important;
	border-top: none;
}


// Responsive
@media screen and (max-width: 767px) {
	div.dataTables_wrapper {
		div.dataTables_length,
		div.dataTables_filter,
		div.dataTables_info,
		div.dataTables_paginate {
			text-align: center;
		}
	}
}


//
// UIKit provides a range of styling options for table's via class name
// that we want to full support. They sometimes require some customisations
//

// Condensed
table.dataTable.uk-table-condensed {
	> thead > tr > th {
		padding-right: 20px;
	}

	.sorting:after,
	.sorting_asc:after,
	.sorting_desc:after {
		top: 6px;
		right: 6px;
	}
}



