/**
 * tb-calendar.css — Styles für das TBCalendar-Popup (turkboss-booking, Spec §5).
 *
 * CI-Farben:
 *   frei      #e7f6ec / #1a7f37
 *   belegt    #fdeaea / #c0392b (durchgestrichen)
 *   gesperrt  #f3f3f3 / #9DA3A6
 *   Auswahl   #CC0000 / #fff (Range-Zwischentage heller: #f6d5d5)
 *   Hover-Vorschau: gestrichelt
 */

/* ---------------- Overlay + Karte ---------------- */

.tb-cal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	-webkit-font-smoothing: antialiased;
}

.tb-cal-popup {
	position: relative;
	background: #fff;
	color: #1f2328;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	width: 100%;
	max-width: 720px;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-size: 15px;
	line-height: 1.4;
}

/* ---------------- Kopfzeile ---------------- */

.tb-cal-kopf {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border-bottom: 1px solid #ececec;
}

.tb-cal-kopf-titel {
	flex: 1;
	text-align: center;
	font-weight: 700;
	font-size: 16px;
}

.tb-cal-nav,
.tb-cal-schliessen {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border: 1px solid #d8d8d8;
	border-radius: 50%;
	background: #fff;
	color: #1f2328;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.tb-cal-nav:hover:not(:disabled),
.tb-cal-schliessen:hover {
	border-color: #CC0000;
	color: #CC0000;
}

.tb-cal-nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.tb-cal-schliessen {
	border: none;
	font-size: 22px;
}

/* ---------------- Monate ---------------- */

.tb-cal-monate {
	display: flex;
	gap: 24px;
	padding: 16px;
	overflow-y: auto;
}

.tb-cal-monat {
	flex: 1 1 0;
	min-width: 0;
}

.tb-cal-monat-titel {
	text-align: center;
	font-weight: 700;
	margin-bottom: 8px;
}

/* 7-Spalten-Grid, Wochenstart Montag */
.tb-cal-wochentage,
.tb-cal-tage {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.tb-cal-wochentage {
	margin-bottom: 4px;
}

.tb-cal-wochentage div {
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	color: #8b9096;
	padding: 4px 0;
}

/* Sonntags-Spalte dezent hervorheben */
.tb-cal-wochentage div:last-child {
	color: #c3c7cb;
}

/* ---------------- Tageszellen ---------------- */

.tb-cal-tag {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	margin: 0;
	padding: 0;
	min-height: 40px;
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: box-shadow 0.1s ease, background-color 0.1s ease;
}

.tb-cal-leer {
	min-height: 40px;
}

/* Noch keine Verfügbarkeitsdaten geladen */
.tb-cal-tag.tb-lade {
	background: #fafafa;
	color: #c6c6c6;
	cursor: wait;
}

/* frei */
.tb-cal-tag.tb-frei {
	background: #e7f6ec;
	color: #1a7f37;
}

.tb-cal-tag.tb-frei:hover {
	box-shadow: inset 0 0 0 2px #1a7f37;
}

/* belegt (durchgestrichen) */
.tb-cal-tag.tb-belegt {
	background: #fdeaea;
	color: #c0392b;
	text-decoration: line-through;
	cursor: not-allowed;
}

/* gesperrt (Sonntag/Vergangenheit) */
.tb-cal-tag.tb-gesperrt {
	background: #f3f3f3;
	color: #9DA3A6;
	cursor: default;
}

/* ---------------- Hover-Vorschau (gestrichelt) ---------------- */

.tb-cal-tag.tb-hover-range {
	outline: 2px dashed #CC0000;
	outline-offset: -2px;
	background: #fdf0f0;
	color: #8a1010;
	text-decoration: none;
}

.tb-cal-tag.tb-hover-range.tb-hover-invalid {
	outline-color: #c0392b;
	background: #fdeaea;
	color: #c0392b;
}

/* ---------------- Fixierte Auswahl ---------------- */

.tb-cal-tag.tb-auswahl-range {
	background: #f6d5d5;
	color: #8a1010;
	text-decoration: none;
	border-radius: 0;
}

.tb-cal-tag.tb-auswahl-start,
.tb-cal-tag.tb-auswahl-ende {
	background: #CC0000;
	color: #fff;
	text-decoration: none;
	outline: none;
}

.tb-cal-tag.tb-auswahl-start {
	border-radius: 6px 0 0 6px;
}

.tb-cal-tag.tb-auswahl-ende {
	border-radius: 0 6px 6px 0;
}

/* 1-Tages-Miete: Start = Ende */
.tb-cal-tag.tb-auswahl-start.tb-auswahl-ende {
	border-radius: 6px;
}

/* ---------------- Legende ---------------- */

.tb-cal-legende {
	display: flex;
	gap: 14px;
	padding: 0 16px 10px;
	font-size: 12px;
	color: #5f6368;
}

.tb-leg::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 3px;
	margin-right: 5px;
	vertical-align: -1px;
}

.tb-leg-frei::before { background: #e7f6ec; border: 1px solid #1a7f37; }
.tb-leg-belegt::before { background: #fdeaea; border: 1px solid #c0392b; }
.tb-leg-gesperrt::before { background: #f3f3f3; border: 1px solid #9DA3A6; }

/* ---------------- Footer-Leiste ---------------- */

.tb-cal-fuss {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-top: 1px solid #ececec;
	background: #fff;
}

.tb-cal-info {
	font-weight: 700;
	font-size: 15px;
	color: #1f2328;
	min-height: 1.4em;
}

.tb-cal-uebernehmen {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	border-radius: 6px;
	background: #CC0000;
	color: #fff;
	font: inherit;
	font-weight: 700;
	font-size: 15px;
	padding: 10px 26px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.tb-cal-uebernehmen:hover:not(:disabled) {
	background: #a80000;
}

.tb-cal-uebernehmen:disabled {
	background: #dcdcdc;
	color: #9a9a9a;
	cursor: not-allowed;
}

/* ---------------- Tooltip ---------------- */

.tb-cal-tooltip {
	position: absolute;
	z-index: 10;
	background: #222;
	color: #fff;
	font-size: 12px;
	padding: 6px 10px;
	border-radius: 6px;
	pointer-events: none;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.tb-cal-tooltip[hidden] {
	display: none;
}

/* ---------------- Mobile (<768px): 1 Monat, nahezu vollflächig ---------------- */

@media (max-width: 767px) {
	.tb-cal-backdrop {
		padding: 0;
		align-items: stretch;
		justify-content: stretch;
	}

	.tb-cal-popup {
		max-width: none;
		max-height: none;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}

	.tb-cal-monate {
		flex-direction: column;
		flex: 1 1 auto;
	}

	.tb-cal-tag,
	.tb-cal-leer {
		min-height: 46px;
	}

	.tb-cal-fuss {
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}
}
