/**
 * Tables
 *
 * Styling for consistent display of data tables
 *
 * @package    jCLib
 * @author     Neonfire Development <webmaster@neonfire.co.za>
 * @copyright  2009-2024 Neonfire Development
 * @version    1.00.00
 */

/*
	Classes to define common data table formatting
*/
table.jc-styled,
table.styled {
	display: table;
	border-spacing: 0;
}

/* Generic cell formatting */
table.jc-styled > thead > tr > th,
table.jc-styled > tbody > tr > th,
table.jc-styled > tfoot > tr > th,
table.styled > thead > tr > th,
table.styled > tbody > tr > th,
table.styled > tfoot > tr > th {
	display: table-cell;
	vertical-align: top;
	font-weight: bold;
	padding: 2px;
	text-align: left;
}
table.jc-styled > thead > tr > td,
table.jc-styled > tbody > tr > td,
table.jc-styled > tfoot > tr > td,
table.styled > thead > tr > td,
table.styled > tbody > tr > td,
table.styled > tfoot > tr > td {
	display: table-cell;
	vertical-align: top;
	padding: 2px;
	text-align: left;
}

/* Table header cell formatting */
table.jc-styled > thead > tr > th,
table.styled > thead > tr > th {
	vertical-align: bottom;
	text-align: center;
}
table.jc-styled > thead > tr > td,
table.styled > thead > tr > td {
	vertical-align: bottom;
	font-weight: bold;
}

/*
	Classes to define a field list table
*/
table.jc-fieldlist {
	display: table;
	border-spacing: 2px;
}

/* Generic cell formatting */
table.jc-fieldlist > thead > tr > th,
table.jc-fieldlist > tbody > tr > th,
table.jc-fieldlist > tfoot > tr > th {
	display: table-cell;
	vertical-align: top;
	font-weight: bold;
	padding: 2px;
	text-align: left;
}
table.jc-fieldlist > thead > tr > td,
table.jc-fieldlist > tbody > tr > td,
table.jc-fieldlist > tfoot > tr > td {
	display: table-cell;
	vertical-align: top;
	padding: 2px;
	text-align: left;
}

/* Table header cell formatting */
table.jc-fieldlist > thead > tr > th {
	vertical-align: bottom;
	text-align: center;
}
table.jc-fieldlist > thead > tr > td {
	vertical-align: bottom;
	font-weight: bold;
}

/* Classes to define table colouring */
table.jc-fieldlist > thead > tr > th {
	background-color: #333;
	color: #fff;
}
table.jc-fieldlist > thead > tr > td {
	background-color: #666;
	color: #fff;
	font-weight: bold;
}
table.jc-fieldlist > tbody > tr > th {
	background-color: #888;
	color: #fff;
}
table.jc-fieldlist > tbody > tr > td {
	background-color: #ccc;
	color: #000;
}
table.jc-fieldlist > tfoot > tr > th {
	background-color: #333;
	color: #fff;
}
table.jc-fieldlist > tfoot > tr > td {
	background-color: #666;
	color: #fff;
}

/*
	Classes to define a listing table
*/
table.jc-listing > thead > tr > th,
table.listing > thead > tr > th {
	background-color: #aaa;
	color: #000;
}
table.jc-listing > thead > tr > td,
table.listing > thead > tr > td {
	background-color: #bbb;
	color: #333;
	font-weight: bold;
}

table.jc-listing > tbody > tr > th,
table.listing > tbody > tr > th {
	background-color: #ddd;
	color: #333;
}

table.jc-listing > tbody > tr > td,
table.listing > tbody > tr > td {
	background-color: #eee;
	color: #333;
}

table.jc-listing > tfoot > tr > th,
table.listing > tfoot > tr > th {
	background-color: #bbb;
	color: #333;
}

table.jc-listing > tfoot > tr > td,
table.listing > tfoot > tr > td {
	background-color: #ccc;
	color: #333;
}

/*
	Classes to define row hover styling
*/
table.jc-row-hover > tbody > tr:hover,
table.rowHover > tbody > tr:hover {
	background-color: #333;
}

table.jc-row-hover > tbody > tr:hover > th,
table.jc-row-hover > tbody > tr:hover > td,
table.rowHover > tbody > tr:hover > th,
table.rowHover > tbody > tr:hover > td {
	opacity: .8;
}

/*
	Classes to define row link styling
*/
table.jc-cell-link > tbody > tr > td > a,
table.cellLink > tbody > tr > td > a {
	display: block;
	text-decoration: none;
}

/*
	Classes to add borders to a table
*/
table.jc-bordered,
table.bordered {
	border-top: 1px #555 solid;
	border-left: 1px #555 solid;
	border-spacing: 0;

}

table.jc-bordered > thead > tr > th,
table.jc-bordered > thead > tr > td,
table.jc-bordered > tbody > tr > th,
table.jc-bordered > tbody > tr > td,
table.jc-bordered > tfoot > tr > th,
table.jc-bordered > tfoot > tr > td,
table.bordered > thead > tr > th,
table.bordered > thead > tr > td,
table.bordered > tbody > tr > th,
table.bordered > tbody > tr > td,
table.bordered > tfoot > tr > th,
table.bordered > tfoot > tr > td {
	border-right: 1px #555 solid;
	border-bottom: 1px #555 solid;
}

/*
	Classes to add border radii to a table
*/
table.jc-rounded,
table.rounded {
	border-top-left-radius: 6px;
	border-top-right-radius: 6px;
	border-bottom-left-radius: 6px;
	border-bottom-right-radius: 6px;
}

table.jc-rounded > thead > tr > th:nth-child(1),
table.rounded > thead > tr > th:nth-child(1) {
	border-top-left-radius: 6px;
}

table.jc-rounded > thead > tr > th:nth-last-child(1),
table.rounded > thead > tr > th:nth-last-child(1) {
	border-top-right-radius: 6px;
}

table.jc-rounded > tfoot > tr > th:nth-child(1),
table.rounded > tfoot > tr > th:nth-child(1) {
	border-bottom-left-radius: 6px;
}

table.jc-rounded tfoot > tr > th:nth-last-child(1),
table.rounded tfoot > tr > th:nth-last-child(1) {
	border-bottom-right-radius: 6px;
}
