/* Wspólne style kalendarza rezerwacji — port BookingPage.razor.css / ReservationItem.razor.css */

.fb-booking {
	font-family: 'Arial', sans-serif;
}

/* Bez własnego kontenera przewijania — inaczej position: sticky w nagłówku
   odnosiłoby się do niego, a nie do okna, i nagłówek by się nie przyklejał. */
.fb-table-wrap {
	overflow: visible;
}

.fb-calendar {
	border-collapse: collapse;
	width: 100%;
	margin: 20px 0;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fb-calendar th,
.fb-calendar td {
	padding: 0;
	text-align: center;
	border: 1px solid #ddd;
	user-select: none;
	-webkit-user-select: none;
}

.fb-calendar th {
	letter-spacing: 0.5px;
	padding: 10px;
}

/* Nagłówek dni zostaje widoczny przy przewijaniu strony.
   --fb-sticky-top wylicza skrypt (pasek admina, legenda); motyw z własnym
   przyklejonym menu może nadpisać tę zmienną. */
.fb-calendar .day-of-week {
	background-color: #4CAF50;
	color: white;
	font-weight: bold;
	position: sticky;
	top: var(--fb-sticky-top, 0px);
	z-index: 20;
	/* Przy border-collapse obramowanie przyklejonej komórki znika przy przewijaniu. */
	box-shadow: inset 0 -1px 0 #ddd, inset -1px 0 0 #ddd;
}

.fb-calendar .fb-day-name,
.fb-calendar .fb-day-date {
	display: block;
}

.fb-calendar .fb-day-parts {
	display: flex;
	margin: 6px -10px -10px;
	font-size: 11px;
	font-weight: normal;
	line-height: 20px;
	background-color: rgba(0, 0, 0, 0.12);
}

.fb-calendar .fb-day-parts span {
	flex: 1 1 50%;
}

.fb-calendar .fb-day-parts span:first-child {
	border-right: 1px solid rgba(255, 255, 255, 0.4);
}

/* Nazwa stanowiska zostaje widoczna przy poziomym przewijaniu. */
.fb-calendar .station-name {
	background-color: #f2f2f2;
	color: #333;
	font-weight: bold;
	width: 150px;
	min-width: 150px;
	position: sticky;
	left: 0;
	z-index: 10;
	box-shadow: inset -1px 0 0 #ddd, inset 0 -1px 0 #ddd;
}

.fb-calendar .station-name.camping-name,
.fb-mobile-station.camping-name {
	background-color: #e8f0e4;
	font-style: italic;
	font-weight: 600;
}

.fb-calendar th.station-name {
	top: var(--fb-sticky-top, 0px);
	background-color: #4CAF50;
	z-index: 21;
}

/* Kolumny dni rozciągają się na dostępną szerokość, ale nie schodzą poniżej
   czytelnego minimum — wtedy pojawia się poziomy scroll. */
.fb-calendar .reservation-item {
	min-width: 90px;
	height: 60px;
}

.fb-calendar .saturday-item {
	background-color: #f0f0f0;
}

.fb-calendar .free-day-item {
	background-color: #f0f0f0;
}

.fb-calendar .sunday-item {
	background-color: #e0e0e0;
}

.fb-calendar .day-night {
	display: flex;
	height: 100%;
	width: 100%;
	min-height: 40px;
}

.fb-calendar .part-day {
	flex: 1 1 50%;
	border-right: 1px solid #ddd;
	cursor: pointer;
}

.fb-calendar .part-day:last-child {
	border-right: 0;
}

/* Statusy slotów */
.fb-booking .blocked,
.fb-legend .blocked {
	background-color: red;
}

.fb-booking .blocked-temp,
.fb-legend .blocked-temp {
	background-color: yellow;
}

.fb-booking .your,
.fb-legend .your {
	background-color: springgreen;
}

.fb-booking .selected {
	background-color: blue;
}

/* Nawigacja */
.fb-nav {
	display: flex;
	justify-content: space-between;
	margin-bottom: 15px;
}

.fb-btn {
	background-color: #4CAF50;
	color: white;
	padding: 10px 20px;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 16px;
	margin: 5px;
}

.fb-btn:hover {
	background-color: #45a049;
}

.fb-btn-danger {
	background-color: #dc3545;
}

.fb-btn-danger:hover {
	background-color: #bb2d3b;
}

.fb-btn-warning {
	background-color: #ffc107;
	color: #212529;
}

.fb-btn-warning:hover {
	background-color: #e0a800;
}

/* Legenda */
.fb-legend {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background-color: #fff;
	box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
	display: flex;
	justify-content: center;
	padding: 10px;
	box-sizing: border-box;
	z-index: 100;
}

.fb-legend-item {
	display: flex;
	align-items: center;
	margin-right: 20px;
}

.fb-legend-color {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	margin-right: 5px;
}

.fb-legend-text {
	font-size: 14px;
}

/* Belka akcji przypięta do dołu okna — nie zasłania slotów tak jak
   wcześniejsze pływające kółka i jest zawsze pod ręką. */
.fb-actions {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	gap: 1px;
	z-index: 101;
}

.fb-float {
	flex: 1 1 auto;
	height: 52px;
	text-align: center;
	border: 0;
	background-color: #4CAF50;
	color: #fff;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
	transition: background-color 0.3s;
	font-size: 16px;
	line-height: 52px;
	cursor: pointer;
	padding: 0;
}

.fb-float:hover {
	background-color: #45a049;
}

.fb-float-secondary {
	background-color: #777;
}

.fb-float-secondary:hover {
	background-color: #666;
}

.fb-float-icon {
	display: none;
}

/* Modal */
.fb-fullscreen {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	overflow: auto;
	z-index: 99999;
}

.fb-fullscreen.fb-visible {
	display: block;
}

.fb-modal {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	width: 350px;
	max-width: calc(100vw - 20px);
	max-height: 90vh;
	overflow-y: auto;
}

.fb-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 15px;
	border-bottom: 1px solid #ddd;
}

.fb-modal-body {
	padding: 15px;
}

.fb-modal-body label {
	display: block;
	margin: 8px 0 3px;
	font-weight: 600;
}

.fb-modal-body .fb-check label {
	font-weight: normal;
	display: inline;
}

.fb-input {
	width: 100%;
	box-sizing: border-box;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	margin-bottom: 6px;
}

.fb-close {
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
	padding: 0 4px;
}

.fb-required {
	color: #dc3545;
}

.fb-error {
	color: #dc3545;
	margin: 8px 0;
	min-height: 1em;
}

.fb-check {
	margin: 10px 0;
}

.fb-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* ----------------------------------------------------------------------
   Widok mobilny: pasek wyboru dnia + pionowa lista stanowisk
   ---------------------------------------------------------------------- */

.fb-mobile {
	margin: 15px 0;
}

/* Pasek dni i podpisy Dzień/Noc zostają widoczne przy przewijaniu listy. */
.fb-day-strip {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding: 6px 0;
	scrollbar-width: thin;
	position: sticky;
	top: var(--fb-sticky-top, 0px);
	z-index: 20;
	background-color: #fff;
}

.fb-day-chip {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 64px;
	padding: 8px 6px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background-color: #fff;
	cursor: pointer;
	font-size: 12px;
	line-height: 1.3;
}

.fb-day-chip-name {
	font-size: 11px;
	color: #555;
}

.fb-day-chip-date {
	font-weight: bold;
	font-size: 14px;
}

.fb-day-chip.fb-day-active {
	background-color: #4CAF50;
	border-color: #4CAF50;
	color: #fff;
}

.fb-day-chip.fb-day-active .fb-day-chip-name {
	color: #eafbe9;
}

.fb-day-title {
	font-weight: bold;
	margin: 12px 0 8px;
	font-size: 16px;
}

.fb-mobile-row {
	display: flex;
	align-items: stretch;
	gap: 6px;
	border-bottom: 1px solid #eee;
	padding: 4px 0;
}

.fb-mobile-station {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	font-weight: 600;
	font-size: 14px;
}

.fb-mobile-row .part-day {
	flex: 0 0 90px;
	min-height: 44px; /* wygodny cel dotyku */
	border: 1px solid #ccc;
	border-radius: 4px;
	background-color: #fff;
	cursor: pointer;
	padding: 0;
}

.fb-mobile-header {
	border-bottom: 2px solid #4CAF50;
	font-weight: bold;
	font-size: 12px;
	text-transform: uppercase;
	color: #555;
	position: sticky;
	top: calc(var(--fb-sticky-top, 0px) + var(--fb-strip-height, 60px));
	z-index: 19;
	background-color: #fff;
}

.fb-mobile-part-label {
	flex: 0 0 90px;
	text-align: center;
}

/* Kolory statusów muszą wygrać z domyślnym białym tłem przycisku slotu. */
.fb-mobile-row .part-day.blocked {
	background-color: red;
	border-color: transparent;
}

.fb-mobile-row .part-day.blocked-temp {
	background-color: yellow;
	border-color: transparent;
}

.fb-mobile-row .part-day.your {
	background-color: springgreen;
	border-color: transparent;
}

.fb-mobile-row .part-day.selected {
	background-color: blue;
	border-color: transparent;
}

@media screen and (max-width: 782px) {
	.fb-btn {
		padding: 8px 14px;
		font-size: 14px;
	}

	.fb-legend {
		position: static;
		flex-wrap: wrap;
		box-shadow: none;
		padding: 8px 0;
	}

	.fb-legend-item {
		margin-right: 12px;
	}

	.fb-float {
		height: 48px;
		line-height: 48px;
		font-size: 15px;
	}

	.fb-modal {
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: 100%;
		top: 0;
		left: 0;
		transform: none;
		border-radius: 0;
	}
}

@media screen and (max-width: 380px) {
	.fb-mobile-row .part-day,
	.fb-mobile-part-label {
		flex-basis: 70px;
	}
}
