// ================================================
// Table View Template Styles for GravityView
// https://www.gravitykit.com
// ================================================

// 1. Variables
// ================================================

// 1.1. Colors
// Change accordingly to your website styles
// ------------------------------------------------

.gv-table-view {
	table-layout: fixed;
	width: 100%;
}

.gv-table-view th,
.gv-table-view td {
	padding: .3em;
}

// Counter the browser's default th centering on opt-in row-header cells.
.gv-table-view tbody th[scope='row'] {
	text-align: start;
}

.gv-table-view-content {
	table-layout: fixed;

	// The single entry view left column
	> tbody > tr > th {
		width: 35%;
		vertical-align: top;
	}

    & th.gsurvey-likert-choice-label {
        border: inherit;
    }
}

// 2. Sorting links
// Change accordingly to your website styles
// ------------------------------------------------

a.gv-sort.gv-icon-caret-up-down {
    opacity: 0.5;

    &:hover {
      opacity: 1;
    }
}

.gv-bulk-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	font-size: 1rem;
	line-height: 1.4;
	margin: 0 0 0.75em;
}

.gv-bulk-actions select,
.gv-bulk-actions button,
.gv-bulk-actions-selection-summary button {
	font-size: inherit;
	line-height: inherit;
}

.gv-bulk-actions .gv-bulk-actions-apply:disabled,
.gv-bulk-actions .gv-bulk-actions-apply[disabled] {
	cursor: default;
	pointer-events: none;
}

.gv-bulk-actions-clear,
.gv-bulk-actions-select-all,
.gv-bulk-actions-show-selected,
.gv-bulk-actions-show-all {
	background: none;
	border: 0;
	color: currentColor;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.gv-bulk-actions-selection-summary {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

.gv-bulk-actions-selection-summary[hidden],
.gv-bulk-actions-selection-row[hidden],
.gv-bulk-actions-page-selection[hidden],
.gv-bulk-actions-all-selected[hidden],
.gv-bulk-actions-clear[hidden],
.gv-bulk-actions-show-selected[hidden],
.gv-bulk-actions-show-all[hidden] {
	display: none;
}

.gv-bulk-actions-selection-row td {
	background: #ffc;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
	text-align: center;
	padding: 0.7em 0.5em;
}

.gv-bulk-actions-selection-row .gv-bulk-actions-selection-summary {
	display: flex;
	justify-content: center;
	gap: 0.8em;
}

.gv-bulk-actions-selection-row .gv-bulk-actions-page-selection {
	display: inline;
}

.gv-bulk-actions-selection-row .gv-bulk-actions-page-selection[hidden] {
	display: none;
}

.gv-bulk-actions-column {
	position: relative;
	text-align: center;
	vertical-align: middle;
	width: 2.5em;
}

.gv-table-view th.gv-bulk-actions-column,
.gv-table-view td.gv-bulk-actions-column {
	vertical-align: middle;
}

.gv-bulk-actions-column label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	margin: 0;
}

.gv-bulk-actions-column input {
	margin: 0;
}

.gv-bulk-actions-message {
	margin-bottom: 0.75em;
}

.gv-bulk-actions-confirmation-modal {
	align-items: center;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 1em;
	position: fixed;
	z-index: 99999;
}

.gv-bulk-actions-confirmation-dialog {
	background: #fff;
	box-shadow: 0 1em 3em rgba(0, 0, 0, 0.25);
	color: #1d2327;
	max-width: 32em;
	padding: 1.25em;
	width: min(100%, 32em);
}

.gv-bulk-actions-confirmation-dialog h2 {
	font-size: 1.35em;
	line-height: 1.25;
	margin: 0 0 0.75em;
}

.gv-bulk-actions-confirmation-label {
	display: block;
	font-weight: 600;
	margin: 1em 0;
}

.gv-bulk-actions-confirmation-label input {
	display: block;
	margin-top: 0.35em;
	width: 100%;
}

.gv-bulk-actions-confirmation-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	justify-content: flex-end;
}

.gv-bulk-actions-edit-dialog {
	max-height: calc(100vh - 2em);
	max-height: calc(100dvh - 2em);
	max-width: 44em;
	overflow: auto;
	width: min(100%, 44em);
}

.gv-bulk-actions-edit-error {
	background: #fcf0f1;
	border-inline-start: 0.25em solid #d63638;
	margin: 0 0 1em;
	padding: 0.75em;
}

.gv-bulk-actions-edit-rows {
	display: grid;
	gap: 1em;
	margin: 1em 0;
}

.gv-bulk-actions-edit-row {
	border: 1px solid #dcdcde;
	display: grid;
	gap: 0.75em;
	padding: 1em;
}

.gv-bulk-actions-edit-row-has-error {
	border-color: #d63638;
}

.gv-bulk-actions-edit-row label {
	display: block;
	font-weight: 600;
}

.gv-bulk-actions-edit-row input,
.gv-bulk-actions-edit-row select,
.gv-bulk-actions-edit-row textarea {
	display: block;
	margin-top: 0.35em;
	width: 100%;
}

.gv-bulk-actions-edit-row option:disabled {
	color: #646970;
}

.gv-bulk-actions-edit-row-error {
	color: #8a2424;
	margin: 0;
}

.gv-bulk-actions-edit-add,
.gv-bulk-actions-edit-remove {
	justify-self: start;
}

.gv-bulk-actions-edit-review {
	background: #fff8e5;
	border-inline-start: 0.25em solid #dba617;
	margin: 1em 0;
	padding: 0.75em;
}

.gv-bulk-actions-edit-review-has-error {
	background: #fcf0f1;
	border-inline-start-color: #d63638;
}

.gv-bulk-actions-edit-review label {
	align-items: flex-start;
	display: flex;
	gap: 0.5em;
	line-height: 1.4;
}

.gv-bulk-actions-edit-review input[type="checkbox"] {
	block-size: 1.1em;
	box-sizing: border-box;
	flex: 0 0 1.1em;
	inline-size: 1.1em;
	margin: 0.1em 0 0;
	min-block-size: 1.1em;
	min-inline-size: 1.1em;
	width: 1.1em;
}

.gv-bulk-actions-edit-review-has-error input[type="checkbox"] {
	outline: 2px solid #d63638;
	outline-offset: 2px;
}

.gv-bulk-actions-edit-review-warning {
	margin: 0 0 0.75em;
}

.gv-bulk-actions-edit-review-list {
	margin: 0 0 0.75em 1.5em;
	padding: 0;
}

.gv-bulk-actions-edit-review-error {
	color: #8a2424;
	margin: 0.5em 0 0;
	margin-inline-start: calc(1.1em + 0.5em);
}

.gv-bulk-actions-resend-dialog {
	max-height: calc(100vh - 2em);
	max-height: calc(100dvh - 2em);
	max-width: 40em;
	overflow: auto;
	width: min(100%, 40em);
}

.gv-bulk-actions-resend-groups {
	display: grid;
	gap: 1em;
	margin: 1em 0;
}

.gv-bulk-actions-resend-group {
	border: 1px solid #dcdcde;
	display: grid;
	gap: 0.75em;
	padding: 1em;
}

.gv-bulk-actions-resend-group-title {
	font-size: 1em;
	line-height: 1.3;
	margin: 0;
}

.gv-bulk-actions-resend-options {
	display: grid;
	gap: 0.5em;
}

.gv-bulk-actions-resend-option {
	align-items: flex-start;
	display: flex;
	gap: 0.5em;
	line-height: 1.4;
}

.gv-bulk-actions-resend-option input[type="checkbox"] {
	block-size: 1.1em;
	box-sizing: border-box;
	flex: 0 0 1.1em;
	inline-size: 1.1em;
	margin: 0.1em 0 0;
	min-block-size: 1.1em;
	min-inline-size: 1.1em;
	width: 1.1em;
}

.gv-bulk-actions-resend-help {
	display: block;
	font-weight: 400;
	margin-top: 0.35em;
}

.gv-bulk-actions-spinner {
	animation: gv-bulk-actions-spin 0.75s linear infinite;
	border: 0.15em solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	display: inline-block;
	height: 1em;
	vertical-align: -0.125em;
	width: 1em;
}

@keyframes gv-bulk-actions-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gv-bulk-actions-spinner {
		animation: none;
	}
}
