/**
 * Frontend-Styles für das Kiosk-Widget ("ChurchTools Kiosk").
 * Bewusst groß und touch-freundlich (großzügige Klickflächen, große
 * Schrift) für ein fest im Raum stehendes iPad statt für Desktop-Mäuse.
 *
 * Farben/Rahmen der Buttons werden über CSS-Variablen gesetzt, die
 * Elementor je nach Stil-Einstellung befüllt (siehe class-kiosk-widget.php,
 * register_controls() - "Stil"-Reiter, nutzt CTC_Button_Style_Trait wie die
 * übrigen Plugin-Widgets). Ohne eigene Einstellung greifen die hier
 * angegebenen Fallback-Werte.
 */

.ctl-kiosk {
	max-width: 720px;
	margin: 0 auto;
	padding: 32px 24px;
	box-sizing: border-box;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	font-size: 1.15em;
}

.ctl-kiosk * {
	box-sizing: border-box;
}

.ctl-kiosk-step[hidden] {
	display: none;
}

.ctl-kiosk-heading {
	font-size: 1.6em;
	margin: 0 0 24px;
	text-align: center;
	color: var( --ctc-kiosk-heading-color, inherit );
}

.ctl-kiosk-step,
.ctl-kiosk-list-form {
	color: var( --ctc-kiosk-text-color, inherit );
}

.ctl-kiosk-list-description {
	margin-bottom: 20px;
	color: #555;
	text-align: center;
}

.ctl-kiosk-overview {
	margin-bottom: 24px;
}

.ctl-kiosk-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}

.ctl-kiosk-summary-item {
	background: #f4f5f7;
	border: 1px solid #e5e7ea;
	border-radius: 10px;
	padding: 10px 16px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 110px;
}

.ctl-kiosk-summary-label {
	font-size: 0.75em;
	color: #5c5c5c;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ctl-kiosk-summary-value {
	font-size: 1em;
	font-weight: 700;
}

.ctl-kiosk-group-list {
	margin-bottom: 20px;
}

.ctl-kiosk-group-heading {
	font-size: 1em;
	font-weight: 700;
	margin: 0 0 8px;
}

.ctl-kiosk-table-wrapper {
	width: 100%;
	overflow-x: auto;
	/* Ab mehr als 8 Zeilen wird die Liste scrollbar statt beliebig lang zu
	   werden - bei 8 oder weniger Einträgen passt alles ohne Scrollbalken
	   hinein, der Wert wirkt dann einfach nicht (kein Scrollen nötig). */
	max-height: 330px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid #e5e7ea;
	border-radius: 8px;
}

.ctl-kiosk-table {
	width: 100%;
	min-width: 100%;
	border-collapse: collapse;
	font-size: 0.85em;
}

.ctl-kiosk-table th,
.ctl-kiosk-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid #e5e5e5;
}

.ctl-kiosk-table thead th {
	background: #f4f5f7;
	font-weight: 600;
	position: sticky;
	top: 0;
	z-index: 1;
}

.ctl-kiosk-table thead th.ctl-kiosk-sortable {
	cursor: pointer;
	user-select: none;
}

.ctl-kiosk-table thead th.ctl-kiosk-sortable:hover,
.ctl-kiosk-table thead th.ctl-kiosk-sortable:focus-visible {
	background: #e9ebee;
}

.ctl-kiosk-table thead th.ctl-kiosk-sortable::after {
	content: "\21C5";
	display: inline-block;
	margin-left: 6px;
	opacity: 0.4;
	font-size: 0.85em;
}

.ctl-kiosk-table thead th.ctl-kiosk-sortable[data-sort-dir="asc"]::after {
	content: "\2191";
	opacity: 1;
}

.ctl-kiosk-table thead th.ctl-kiosk-sortable[data-sort-dir="desc"]::after {
	content: "\2193";
	opacity: 1;
}

.ctl-kiosk-event-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.ctl-kiosk-event-button {
	background-color: var( --ctc-btn-bg, #1a73e8 );
	color: var( --ctc-btn-color, #fff );
	border-width: var( --ctc-btn-border-width, 0px ) !important;
	border-style: solid !important;
	border-color: var( --ctc-btn-border-color, transparent ) !important;
	border-radius: 14px;
	padding: 28px 20px;
	font-size: 1.15em;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.ctl-kiosk-event-button:hover,
.ctl-kiosk-event-button:focus-visible {
	background-color: var( --ctc-btn-bg-hover, #0f52ba );
}

.ctl-kiosk-event-button:active {
	transform: scale( 0.98 );
}

.ctl-kiosk-field-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 20px;
}

.ctl-kiosk-field-group[hidden] {
	display: none;
}

.ctl-kiosk-field-group label {
	font-weight: 600;
	font-size: 1em;
}

.ctl-required {
	color: #a94442;
}

.ctl-kiosk-field-group input[type="text"],
.ctl-kiosk-field-group input[type="email"],
.ctl-kiosk-field-group input[type="number"],
.ctl-kiosk-field-group select,
.ctl-kiosk-field-group textarea,
.ctl-kiosk-name-input,
.ctl-kiosk-email-input {
	/* "!important" gegen Theme-Vorgaben für input[type="number"] (manche
	   Themes/Plugins schränken Zahlenfelder absichtlich auf eine schmale
	   "Warenkorb-Menge"-Breite ein, mit höherer Spezifität oder "!important"). */
	width: 100% !important;
	max-width: none !important;
	padding: 16px 14px;
	border: 2px solid #ccc;
	border-radius: 10px;
	font-size: 1.1em;
	font-family: inherit;
	box-sizing: border-box;
}

.ctl-kiosk-email-hint {
	margin: 8px 0 0;
	padding: 10px 14px;
	border-radius: 8px;
	background: #fff8e1;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.4;
	color: var( --ctc-kiosk-email-hint-color, #6b5300 );
}

.ctl-privacy-notice {
	margin: 10px 0 0;
	font-size: 0.75em;
	color: #6b6b6b;
	line-height: 1.4;
}

.ctl-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ctl-kiosk-button {
	display: block;
	width: 100%;
	background-color: var( --ctc-btn-bg, #1a73e8 );
	color: var( --ctc-btn-color, #fff );
	border-width: var( --ctc-btn-border-width, 0px ) !important;
	border-style: solid !important;
	border-color: var( --ctc-btn-border-color, transparent ) !important;
	border-radius: 999px;
	padding: 20px 24px;
	font-size: 1.1em;
	font-weight: 600;
	cursor: pointer;
	margin-top: 10px;
	transition: background-color 0.15s ease;
}

.ctl-kiosk-button:hover,
.ctl-kiosk-button:focus-visible {
	background-color: var( --ctc-btn-bg-hover, #0f52ba );
}

.ctl-kiosk-button:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Höhere Selektor-Spezifität (zwei Klassen) sorgt automatisch dafür, dass
   die eigene Stil-Einstellung "Sekundäre Buttons" hier gewinnt, obwohl
   dieselben CSS-Variablennamen wie beim allgemeinen ".ctl-kiosk-button"
   verwendet werden - keine weiteren, eigenen Variablennamen nötig. */
.ctl-kiosk-button.ctl-kiosk-secondary {
	background-color: var( --ctc-btn-bg, #f4f5f7 );
	color: var( --ctc-btn-color, #2b2b2b );
	border-width: var( --ctc-btn-border-width, 0px ) !important;
	border-style: solid !important;
	border-color: var( --ctc-btn-border-color, transparent ) !important;
}

.ctl-kiosk-button.ctl-kiosk-secondary:hover,
.ctl-kiosk-button.ctl-kiosk-secondary:focus-visible {
	background-color: var( --ctc-btn-bg-hover, #e9ebee );
}

.ctl-kiosk-list-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 10px;
}

.ctl-kiosk-messages {
	min-height: 1.4em;
	margin: 12px 0;
	color: #a94442;
	text-align: center;
}

.ctl-kiosk-done-text {
	text-align: center;
	font-size: 1.1em;
	margin-bottom: 24px;
}

.ctl-kiosk-done-email-text {
	text-align: center;
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.5;
	margin-bottom: 24px;
	padding: 16px 18px;
	border-radius: 10px;
	background: #e8f4fd;
	color: var( --ctc-kiosk-done-email-color, #0f3d6b );
}

.ctl-kiosk-done-text[hidden],
.ctl-kiosk-done-email-text[hidden] {
	display: none;
}

@media (max-width: 480px) {
	.ctl-kiosk {
		padding: 20px 16px;
		font-size: 1.05em;
	}

	.ctl-kiosk-heading {
		font-size: 1.35em;
	}
}
