/* Trailer Booking - frontend styles */

.tb-app {
	max-width: 600px;
	margin: 0 auto;
	font-family: inherit;
	color: #1d2327;
}

.tb-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.tb-calendar-header h2 {
	margin: 0;
	font-size: 1.25rem;
}

.tb-nav-btn {
	background: #f0f0f1;
	border: 1px solid #ddd;
	border-radius: 6px;
	width: 36px;
	height: 36px;
	font-size: 1rem;
	cursor: pointer;
}
.tb-nav-btn:hover {
	background: #e0e0e1;
}

.tb-weekday-row {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	text-align: center;
	font-size: 0.8rem;
	color: #666;
	margin-bottom: 4px;
}

.tb-calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.tb-day {
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: #f7f7f7;
	cursor: pointer;
	position: relative;
	transition: background 0.15s ease;
}
.tb-day:hover {
	background: #eaeaea;
}
.tb-day-empty {
	background: transparent;
	cursor: default;
}
.tb-day-today .tb-day-number {
	font-weight: 700;
	text-decoration: underline;
}

.tb-day-number {
	font-size: 0.95rem;
}

.tb-day-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	margin-top: 3px;
}

.tb-day-booked { background: #fff4e5; }
.tb-day-blocked { background: #fde8e8; }

.tb-dot-booked, .dot-booked { background: #d98c00; }
.tb-dot-blocked { background: #c0392b; }
.tb-dot-free { background: transparent; border: 1px solid #999; }

.tb-loading, .tb-error {
	grid-column: 1 / -1;
	text-align: center;
	padding: 24px;
	color: #666;
}

.tb-legend {
	margin-top: 14px;
	font-size: 0.85rem;
	color: #555;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.tb-legend-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	margin-left: 10px;
	margin-right: 2px;
}
.tb-legend-dot:first-child { margin-left: 0; }
.tb-legend .tb-dot-free { border: 1px solid #999; }
.tb-legend .tb-dot-booked { background: #d98c00; }
.tb-legend .tb-dot-blocked { background: #c0392b; }

/* Dagsvisning */
.tb-day-view-header {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}
.tb-day-view-header h3 {
	margin: 0;
	font-size: 1.15rem;
}

.tb-day-bookings-list {
	margin-bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tb-booking-item {
	padding: 10px 12px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 0.95rem;
}
.tb-booking-item-booked {
	background: #fff4e5;
	border: 1px solid #f3d9a6;
}
.tb-booking-item-blocked {
	background: #fde8e8;
	border: 1px solid #f2b8b5;
}

.tb-day-empty-msg {
	color: #4caf50;
	font-weight: 500;
	padding: 12px;
	background: #eef9ee;
	border-radius: 8px;
}

/* Knapper */
.tb-btn {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 6px;
	border: none;
	font-size: 0.95rem;
	cursor: pointer;
	width: 100%;
}
.tb-btn-primary {
	background: #2271b1;
	color: #fff;
}
.tb-btn-primary:hover {
	background: #135e96;
}
.tb-btn-danger {
	background: #c0392b;
	color: #fff;
}
.tb-btn-danger:hover {
	background: #a23223;
}

.tb-link-button {
	background: none;
	border: none;
	color: #2271b1;
	cursor: pointer;
	text-decoration: underline;
	font-size: 0.85rem;
	padding: 0;
}

/* Modaler */
.tb-modal {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	padding: 16px;
}
/* Vigtigt: garanterer at modaler er skjulte når attributten 'hidden' er sat.
   Uden denne regel kan 'display: flex' ovenfor i nogle browsere/temaer
   få modalen til at vise sig permanent, uanset hidden-attributten. */
.tb-modal[hidden] {
	display: none !important;
}
.tb-modal-content {
	background: #fff;
	border-radius: 10px;
	padding: 24px;
	max-width: 420px;
	width: 100%;
	position: relative;
	max-height: 90vh;
	overflow-y: auto;
}
.tb-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 1.4rem;
	cursor: pointer;
	color: #666;
	line-height: 1;
}

#tb-booking-form, #tb-cancel-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 12px;
}
#tb-booking-form label, #tb-cancel-form label {
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: -4px;
}
#tb-booking-form select,
#tb-booking-form input,
#tb-cancel-form input {
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 1rem;
	width: 100%;
	box-sizing: border-box;
}

.tb-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.tb-form-error {
	color: #c0392b;
	font-size: 0.85rem;
	background: #fde8e8;
	padding: 8px 10px;
	border-radius: 6px;
}

/* Toast */
.tb-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: #1d2327;
	color: #fff;
	padding: 12px 20px;
	border-radius: 8px;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 10000;
	max-width: 90%;
	text-align: center;
}
.tb-toast-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
	.tb-form-row {
		grid-template-columns: 1fr;
	}
}
