/*
 * Stylish Google Sheet Reader Pro - front-end table styles.
 * Everything is scoped to .sgsrx-root so theme styles don't leak in and ours don't leak out.
 * Reproduces the look of the old iframe player (Bootstrap 5 + DataTables).
 */

/* ---------- base ---------- */

.sgsrx-root {
	--sgsrx-pri: #7d55ff;
	--sgsrx-sec: #ffffff;
	--sgsrx-text: #212529;
	--sgsrx-border: #dee2e6;
	--sgsrx-muted: #6c757d;
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 0 50px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--sgsrx-text);
	text-align: left;
	letter-spacing: normal;
	text-transform: none;
}

.sgsrx-root *,
.sgsrx-root *::before,
.sgsrx-root *::after {
	box-sizing: border-box;
}

.sgsrx-root .sgsrx-hidden {
	display: none;
}

.sgsrx-msg,
.sgsrx-root .sgsrx-msg {
	padding: 23px;
	margin: 24px auto;
	max-width: 400px;
	font-family: Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	background-color: #ff000012;
	color: #ff0000c9;
	border-radius: 12px;
	text-align: left;
}

/* ---------- loading ---------- */

.sgsrx-root .sgsrx-loading {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 200px;
}

.sgsrx-root .sgsrx-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(0, 0, 0, 0.1);
	border-top-color: var(--sgsrx-pri);
	border-radius: 50%;
	animation: sgsrx-spin 0.8s linear infinite;
}

@keyframes sgsrx-spin {
	to { transform: rotate(360deg); }
}

/* ---------- card ---------- */

.sgsrx-root .sgsrx-card {
	padding: 20px;
	background-color: #ffffff;
}

.sgsrx-root .sgsrx-card.sgsrx-shadow {
	max-width: 95%;
	margin: auto;
	box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2);
	transition: background 0.3s, border 0.3s, border-radius 0.3s, box-shadow 0.3s;
}

.sgsrx-root .sgsrx-card.sgsrx-round {
	border-radius: 20px;
}

/* ---------- search ---------- */

.sgsrx-root .sgsrx-search {
	width: 100%;
	max-width: 80%;
	margin: 20px auto;
	text-align: center;
}

.sgsrx-root .sgsrx-search .sgsrx-search-input {
	display: block;
	width: 100%;
	min-height: 31px;
	margin: 0;
	padding: 4px 8px;
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sgsrx-text);
	text-align: center;
	background: #ffffff;
	border: 1px solid #000000;
	border-radius: 20px;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.sgsrx-root .sgsrx-search .sgsrx-search-input:focus {
	border-color: #86b7fe;
	box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
}

.sgsrx-root .sgsrx-search .sgsrx-search-input::placeholder {
	color: grey;
	opacity: 1;
}

/* ---------- top / bottom bars ---------- */

.sgsrx-root .sgsrx-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.sgsrx-root .sgsrx-bar-top {
	margin-bottom: 14px;
}

.sgsrx-root .sgsrx-bar-bottom {
	margin-top: 8px;
}

.sgsrx-root .sgsrx-bar-top:not(:has(> div > *)),
.sgsrx-root .sgsrx-bar-bottom:not(:has(> div > *)) {
	display: none;
}

.sgsrx-root .sgsrx-bar > div {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	min-width: 0;
}

.sgsrx-root .sgsrx-bar-start { justify-content: flex-start; }
.sgsrx-root .sgsrx-bar-end { justify-content: flex-end; }

.sgsrx-root.sgsrx-narrow .sgsrx-bar {
	flex-direction: column;
	align-items: stretch;
}

.sgsrx-root.sgsrx-narrow .sgsrx-bar > div {
	justify-content: center;
}

/* ---------- table ---------- */

.sgsrx-root table.sgsrx-table,
.sgsrx-root div.dt-scroll table.dataTable {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	background: transparent;
	font-size: 16px;
	line-height: 1.5;
	color: inherit;
	table-layout: auto;
}

.sgsrx-root table.dataTable > thead > tr > th,
.sgsrx-root table.dataTable > tbody > tr > td {
	padding: 10px 14px;
	margin: 0;
	border: 0;
	border-bottom: 1px solid var(--sgsrx-border);
	background: transparent;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
	vertical-align: top;
	text-align: left !important;
	word-break: normal;
}

/* Header colors come from the table settings (Background Color / Text Color). */
.sgsrx-root table.dataTable > thead > tr > th {
	font-weight: 600;
	vertical-align: bottom;
	background-color: var(--sgsrx-head-bg, transparent);
	color: var(--sgsrx-head-text, inherit);
}

/* Room for the sort arrows. */
.sgsrx-root table.dataTable > thead > tr > th.dt-orderable-asc,
.sgsrx-root table.dataTable > thead > tr > th.dt-orderable-desc {
	padding-right: 30px;
	cursor: pointer;
}

.sgsrx-root table.dataTable > thead,
.sgsrx-root table.dataTable > tbody,
.sgsrx-root table.dataTable > thead > tr,
.sgsrx-root table.dataTable > tbody > tr {
	background: transparent;
	border: 0;
}

.sgsrx-root table.dataTable > tbody > tr:hover > td {
	background-color: rgba(0, 0, 0, 0.075);
}

.sgsrx-root table.dataTable.no-footer {
	border-bottom: 0;
}

.sgsrx-root div.dt-container.dt-empty-footer table.dataTable > tbody > tr:last-child > *,
.sgsrx-root div.dt-container.dt-empty-footer .dt-scroll-body {
	border-bottom: 1px solid var(--sgsrx-border);
}

.sgsrx-root .sgsrx-theme-black div.dt-container.dt-empty-footer table.dataTable > tbody > tr:last-child > * {
	border-bottom-color: #ffffff0f;
}

.sgsrx-root table.dataTable > thead > tr > th.dt-orderable-asc:hover,
.sgsrx-root table.dataTable > thead > tr > th.dt-orderable-desc:hover {
	outline: none;
}

.sgsrx-root div.dt-container {
	position: relative;
	clear: both;
}

/* Horizontal scroll for tables wider than their card. */
.sgsrx-root .sgsrx-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.sgsrx-root .sgsrx-scroll::-webkit-scrollbar {
	height: 8px;
}

.sgsrx-root .sgsrx-scroll::-webkit-scrollbar-thumb {
	background-color: #c1c1c1;
	border-radius: 8px;
}

/* ---------- small screens (card narrower than 600px) ---------- */

.sgsrx-root.sgsrx-mobile .sgsrx-card {
	padding: 12px;
}

.sgsrx-root.sgsrx-mobile table.dataTable,
.sgsrx-root.sgsrx-mobile div.dt-scroll table.dataTable,
.sgsrx-root.sgsrx-mobile div.dt-info,
.sgsrx-root.sgsrx-mobile div.dt-length label,
.sgsrx-root.sgsrx-mobile div.dt-buttons > button.dt-button,
.sgsrx-root.sgsrx-mobile div.dt-button-collection button.dt-button,
.sgsrx-root.sgsrx-mobile div.dt-container div.dt-paging .dt-paging-button {
	font-size: 14px;
}

.sgsrx-root.sgsrx-mobile table.dataTable > thead > tr > th,
.sgsrx-root.sgsrx-mobile table.dataTable > tbody > tr > td {
	padding: 8px 10px;
}

.sgsrx-root.sgsrx-mobile table.dataTable > thead > tr > th.dt-orderable-asc,
.sgsrx-root.sgsrx-mobile table.dataTable > thead > tr > th.dt-orderable-desc {
	padding-right: 26px;
}

.sgsrx-root.sgsrx-mobile div.dt-container div.dt-paging .dt-paging-button {
	padding: 4px 9px;
}

/* Table too wide for its card (set by JS): give columns room and scroll instead of squeezing text. */
.sgsrx-root.sgsrx-wide table.dataTable > thead > tr > th {
	white-space: nowrap;
}

.sgsrx-root.sgsrx-wide table.dataTable > tbody > tr > td {
	min-width: 140px;
}

.sgsrx-root div.dt-scroll-body {
	border-bottom: 0;
}

/* ---------- buttons (Show Columns / Export) ---------- */

.sgsrx-root div.dt-buttons {
	position: relative;
	display: inline-flex;
	flex-wrap: wrap;
	vertical-align: middle;
}

.sgsrx-root div.dt-buttons > button.dt-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 6px 12px;
	font: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	color: #ffffff;
	text-align: center;
	text-decoration: none;
	text-shadow: none;
	white-space: nowrap;
	cursor: pointer;
	background: #6c757d;
	border: 1px solid #6c757d;
	border-radius: 6px;
	box-shadow: none;
	min-height: 0;
	width: auto;
	transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.sgsrx-root div.dt-buttons > button.dt-button:hover:not(.disabled),
.sgsrx-root div.dt-buttons > button.dt-button:focus:not(.disabled),
.sgsrx-root div.dt-buttons > button.dt-button.dt-button-active:not(.disabled) {
	color: #ffffff;
	background: #5c636a;
	border-color: #565e64;
	box-shadow: none;
}

.sgsrx-root div.dt-buttons > button.dt-button:not(:first-child) {
	margin-left: -1px;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.sgsrx-root div.dt-buttons > button.dt-button:not(:last-of-type) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.sgsrx-root div.dt-buttons span.dt-button-down-arrow {
	display: none;
}

.sgsrx-root div.dt-buttons > button.buttons-collection::after {
	content: "";
	display: inline-block;
	margin-left: 4px;
	vertical-align: 2px;
	border-top: 0.3em solid;
	border-right: 0.3em solid transparent;
	border-bottom: 0;
	border-left: 0.3em solid transparent;
}

.sgsrx-root div.dt-button-collection {
	width: auto;
	min-width: 160px;
	margin-top: 2px;
	padding: 8px 0;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.175);
	border-radius: 6px;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
	z-index: 2002;
}

.sgsrx-root div.dt-button-collection [role="menu"] {
	display: block;
}

.sgsrx-root div.dt-button-collection button.dt-button {
	display: block;
	width: 100%;
	margin: 0;
	padding: 4px 16px;
	font: inherit;
	font-size: 16px;
	line-height: 1.5;
	color: var(--sgsrx-text);
	text-align: left;
	white-space: nowrap;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

.sgsrx-root div.dt-button-collection button.dt-button:hover:not(.disabled) {
	color: #1e2125;
	background: #e9ecef;
}

.sgsrx-root div.dt-button-collection button.dt-button.dt-button-active,
.sgsrx-root div.dt-button-collection button.dt-button.dt-button-active:hover {
	padding-right: 16px;
	color: #ffffff;
	background: #0d6efd;
}

.sgsrx-root div.dt-button-collection button.dt-button.dt-button-active::after {
	display: none;
}

/* ---------- length menu ---------- */

.sgsrx-root div.dt-length {
	color: inherit;
}

.sgsrx-root div.dt-length label {
	margin: 0;
	font-size: 16px;
	font-weight: 400;
	color: inherit;
}

.sgsrx-root div.dt-length select.dt-input {
	display: inline-block;
	width: auto;
	min-height: 0;
	height: auto;
	margin: 0 8px 0 0;
	padding: 4px 32px 4px 8px;
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sgsrx-text);
	background-color: #ffffff;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 16px 12px;
	border: 1px solid var(--sgsrx-border);
	border-radius: 4px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

/* ---------- info + paging ---------- */

.sgsrx-root div.dt-info {
	padding: 0;
	font-size: 16px;
	color: inherit;
}

.sgsrx-root.sgsrx-narrow div.dt-info {
	text-align: center;
}

.sgsrx-root div.dt-paging {
	display: flex;
	flex-wrap: wrap;
	padding: 0;
	color: inherit;
}

.sgsrx-root div.dt-paging nav {
	display: flex;
	flex-wrap: wrap;
}

.sgsrx-root div.dt-container div.dt-paging .dt-paging-button,
.sgsrx-root div.dt-container div.dt-paging .dt-paging-button:hover,
.sgsrx-root div.dt-container div.dt-paging .dt-paging-button:active {
	display: inline-block;
	min-width: 0;
	margin: 0 0 0 -1px;
	padding: 6px 12px;
	font: inherit;
	font-size: 16px;
	line-height: 1.5;
	color: var(--sgsrx-pri) !important;
	text-decoration: none !important;
	background: #ffffff;
	border: 1px solid var(--sgsrx-border);
	border-radius: 0;
	box-shadow: none;
	outline: none;
	cursor: pointer;
}

.sgsrx-root div.dt-container div.dt-paging .dt-paging-button:hover {
	background: #e9ecef;
}

.sgsrx-root div.dt-container div.dt-paging .dt-paging-button.first,
.sgsrx-root div.dt-container div.dt-paging nav > :first-child {
	margin-left: 0;
	border-top-left-radius: 6px;
	border-bottom-left-radius: 6px;
}

.sgsrx-root div.dt-container div.dt-paging .dt-paging-button.last,
.sgsrx-root div.dt-container div.dt-paging nav > :last-child {
	border-top-right-radius: 6px;
	border-bottom-right-radius: 6px;
}

.sgsrx-root div.dt-container div.dt-paging .dt-paging-button.current,
.sgsrx-root div.dt-container div.dt-paging .dt-paging-button.current:hover {
	position: relative;
	z-index: 1;
	color: var(--sgsrx-sec) !important;
	background: var(--sgsrx-pri);
	border-color: var(--sgsrx-pri);
}

.sgsrx-root div.dt-container div.dt-paging .dt-paging-button.disabled,
.sgsrx-root div.dt-container div.dt-paging .dt-paging-button.disabled:hover,
.sgsrx-root div.dt-container div.dt-paging .dt-paging-button.disabled:active {
	color: var(--sgsrx-muted) !important;
	background: #e9ecef;
	border-color: var(--sgsrx-border);
	cursor: default;
}

.sgsrx-root div.dt-paging .ellipsis {
	display: inline-block;
	margin-left: -1px;
	padding: 6px 12px;
	border: 1px solid var(--sgsrx-border);
}

/* ---------- custom scrollbar ---------- */

.sgsrx-root .sgsrx-scrollbar div.dt-scroll-body {
	scrollbar-width: thin;
	scrollbar-color: black #dedede;
}

.sgsrx-root .sgsrx-scrollbar div.dt-scroll-body::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

.sgsrx-root .sgsrx-scrollbar div.dt-scroll-body::-webkit-scrollbar-track {
	background-color: #dedede;
}

.sgsrx-root .sgsrx-scrollbar div.dt-scroll-body::-webkit-scrollbar-thumb {
	background-color: #6e6a6a;
	border-radius: 8px;
}

.sgsrx-root .sgsrx-scrollbar div.dt-scroll-body::-webkit-scrollbar-thumb:hover {
	background-color: #000000;
	cursor: pointer;
}

/* ---------- cell formats ---------- */

.sgsrx-root a.sgsrx-link {
	color: red;
	text-align: center;
	text-decoration: none;
	box-shadow: none;
	border: 0;
}

.sgsrx-root img.sgsrx-img {
	display: inline-block;
	max-width: none;
	margin: 0;
	border: 0;
	box-shadow: none;
	vertical-align: middle;
}

.sgsrx-root img.sgsrx-img[data-sgsrx-url] {
	cursor: pointer;
}

.sgsrx-root .sgsrx-select {
	display: block;
	width: 100%;
	padding: 4px 32px 4px 8px;
	font: inherit;
	font-size: 14px;
	color: var(--sgsrx-text);
	background: #ffffff;
	border: 1px solid var(--sgsrx-border);
	border-radius: 4px;
}

.sgsrx-root .sgsrx-up::before,
.sgsrx-root .sgsrx-down::before {
	font-family: "Font Awesome 5 Pro";
	font-weight: 900;
}

.sgsrx-root .sgsrx-up::before {
	content: "\f0de \00a0";
	color: green;
}

.sgsrx-root .sgsrx-down::before {
	content: "\f0dd \00a0";
	color: red;
}

.sgsrx-root .sgsrx-star-full::before,
.sgsrx-root .sgsrx-star-empty::after,
.sgsrx-root .sgsrx-star-half::after {
	font-family: "Font Awesome 5 Pro";
	font-weight: 900;
}

.sgsrx-root .sgsrx-star-full::before { content: "\f005"; }
.sgsrx-root .sgsrx-star-empty::after { content: "\f005"; font-weight: 300; }
.sgsrx-root .sgsrx-star-half::after { content: "\f5c0"; }

.sgsrx-root .sgsrx-rating-track {
	position: relative;
	display: inline-block;
	width: 80%;
	height: 8px;
	background-color: #c2c2c2;
	text-align: left;
}

.sgsrx-root .sgsrx-rating-fill {
	position: absolute;
	display: inline-block;
	height: 8px;
	background-color: red;
}

/* ---------- black theme ---------- */

.sgsrx-root .sgsrx-card.sgsrx-theme-black {
	max-width: 95%;
	margin: auto;
	color: #6c6c6c;
	background-color: #121212;
}

.sgsrx-root .sgsrx-theme-black table.dataTable > thead > tr > th,
.sgsrx-root .sgsrx-theme-black table.dataTable > tbody > tr > td {
	color: silver;
	background-color: #ffffff12;
	border-bottom: 1px solid #ffffff0f;
}

.sgsrx-root .sgsrx-theme-black table.dataTable > tbody > tr:hover > td {
	background-color: #ffffff1f;
}

.sgsrx-root .sgsrx-theme-black table.dataTable > thead > tr > th {
	color: #949292;
	background-color: #ffffff24;
	font-weight: 400;
}

.sgsrx-root .sgsrx-theme-black .sgsrx-search .sgsrx-search-input {
	color: #ffffff;
	background-color: #3a3838;
	border: 0;
}

.sgsrx-root .sgsrx-theme-black div.dt-buttons > button.dt-button,
.sgsrx-root .sgsrx-theme-black div.dt-buttons > button.dt-button:hover:not(.disabled) {
	background: #3a3838;
	border-color: #121111;
}

.sgsrx-root .sgsrx-theme-black div.dt-length select.dt-input {
	color: #bababa;
	background-color: #606060;
	border-color: #3a3838;
}

.sgsrx-root .sgsrx-theme-black div.dt-container div.dt-paging .dt-paging-button {
	color: #c1c1c1 !important;
	background: #3a3838;
	border-color: #3a3838;
}

.sgsrx-root .sgsrx-theme-black div.dt-container div.dt-paging .dt-paging-button.current,
.sgsrx-root .sgsrx-theme-black div.dt-container div.dt-paging .dt-paging-button.current:hover {
	color: #ffffff !important;
	background: #1f1f1f;
	border-color: #000000;
}

.sgsrx-root .sgsrx-theme-black div.dt-container div.dt-paging .dt-paging-button.disabled {
	color: #6c757d !important;
	background: #a5a5a5;
	border-color: #3a3838;
}
