/**
 * TS Theory or Practical Training - Frontend Stylesheet
 * 
 * Clean, modern, responsive dual-card booking interface
 * matching the dog handler certification design system.
 */

/* ==========================================================================
   Wrapper & Reset
   ========================================================================== */
.ts-booking-wrapper {
	box-sizing: border-box;
	max-width: 1200px;
	margin: 40px auto;
	padding: 0 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1f2937;
	-webkit-font-smoothing: antialiased;
}

.ts-booking-wrapper *,
.ts-booking-wrapper *::before,
.ts-booking-wrapper *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   Section Header
   ========================================================================== */
.ts-booking-header {
	text-align: center;
	margin-bottom: 36px;
}

.ts-booking-heading {
	font-size: 30px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 10px 0;
	line-height: 1.25;
}

.ts-booking-subtitle {
	font-size: 16px;
	color: #4b5563;
	margin: 0;
	line-height: 1.5;
}

/* ==========================================================================
   Dual Cards Grid
   ========================================================================== */
.ts-cards-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px;
	align-items: stretch;
}

.ts-card-item {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1.5px solid #e5e7eb;
	border-radius: 16px;
	padding: 30px 26px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
	transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
	position: relative;
}

.ts-card-item:hover {
	border-color: #d1d5db;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

.ts-card-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	justify-content: space-between;
}

/* ==========================================================================
   Card Header (Centered: Badge, Title, Duration)
   ========================================================================== */
.ts-card-header,
.ts-card-top {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	margin-bottom: 24px;
}



.ts-badge-pill {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	padding: 5px 14px;
	border-radius: 9999px;
	margin-bottom: 12px;
}

.ts-badge-pill-theorie {
	background-color: #fee2e2;
	color: #d8232a;
}

.ts-badge-pill-praxis {
	background-color: #fee2e2;
	color: #d8232a;
}

.ts-card-title {
	font-size: 22px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 12px 0;
	line-height: 1.3;
	text-align: center;
	width: 100%;
}

.ts-meta-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background-color: #f3f4f6;
	color: #374151;
	font-size: 13.5px;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 8px;
	margin-bottom: 0;
}

.ts-meta-icon {
	display: flex;
	align-items: center;
	color: #4b5563;
}

/* ==========================================================================
   Card Details (Venue, Price & Notices - Placed After Radio Buttons)
   ========================================================================== */
.ts-card-details {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin-top: 6px;
	margin-bottom: 24px;
	gap: 12px;
}

.ts-venue-box {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background-color: #f9fafb;
	border-left: 3px solid #d8232a;
	padding: 10px 14px;
	border-radius: 6px;
	margin-bottom: 0;
	width: 100%;
}

.ts-venue-icon {
	display: flex;
	align-items: center;
	margin-top: 1px;
	flex-shrink: 0;
}

.ts-venue-text {
	font-size: 13.5px;
	line-height: 1.45;
	color: #374151;
}

.ts-price-box {
	display: inline-flex;
	align-items: center;
	background-color: #fff5f5;
	border: 1px solid #fed7d7;
	color: #c53030;
	font-weight: 600;
	font-size: 14px;
	padding: 8px 14px;
	border-radius: 8px;
	margin-bottom: 0;
}

.ts-praxis-notices {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 2px;
	width: 100%;
}

.ts-capacity-notice {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13.5px;
	color: #4b5563;
}

.ts-capacity-notice svg {
	color: #6b7280;
	flex-shrink: 0;
}

.ts-inquiry-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13.5px;
	font-weight: 600;
	color: #d8232a;
	text-decoration: none;
	transition: color 0.15s ease, transform 0.15s ease;
	width: fit-content;
}

.ts-inquiry-link:hover {
	color: #b71b21;
	text-decoration: underline;
}

.ts-inquiry-link svg {
	transition: transform 0.15s ease;
}

.ts-inquiry-link:hover svg {
	transform: translateX(3px);
}

/* ==========================================================================
   Sessions List & Custom Radio Options
   ========================================================================== */
.ts-card-sessions {
	margin-bottom: 16px;
}

.ts-sessions-heading {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #6b7280;
	margin-bottom: 12px;
}

.ts-sessions-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ts-session-item {
	position: relative;
	display: flex;
	align-items: center;
	padding: 13px 15px;
	background: #ffffff;
	border: 1.5px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	user-select: none;
}

.ts-session-item:hover:not(.is-disabled) {
	border-color: #cbd5e1;
	background: #fbfbfc;
}

/* Selected state */
.ts-session-item.is-selected {
	border-color: #d8232a;
	background-color: #fff9f9;
	box-shadow: 0 0 0 1px #d8232a, 0 3px 10px rgba(216, 35, 42, 0.08);
}

/* Hide native radio */
.ts-session-item input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	pointer-events: none;
}

/* Custom Circular Radio */
.ts-custom-radio {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid #d1d5db;
	background: #ffffff;
	margin-right: 14px;
	flex-shrink: 0;
	position: relative;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ts-session-item input[type="radio"]:checked+.ts-custom-radio {
	border-color: #d8232a;
}

.ts-session-item input[type="radio"]:checked+.ts-custom-radio::after {
	content: '';
	position: absolute;
	width: 10px;
	height: 10px;
	background: #d8232a;
	border-radius: 50%;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

/* Focus styles for keyboard accessibility */
.ts-session-item input[type="radio"]:focus-visible+.ts-custom-radio {
	outline: 2px solid #d8232a;
	outline-offset: 2px;
}

.ts-session-content {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.ts-session-title {
	font-size: 14.5px;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.35;
}

.ts-session-time {
	font-size: 13px;
	color: #6b7280;
	margin-top: 2px;
}

/* Badges for Sold out / Status */
.ts-session-badge {
	font-size: 11.5px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 6px;
	margin-left: 10px;
	white-space: nowrap;
	flex-shrink: 0;
}

.ts-session-badge.is-full-badge {
	background-color: #fee2e2;
	color: #b91c1c;
}

.ts-session-badge.is-inactive {
	background-color: #f3f4f6;
	color: #6b7280;
}

.ts-session-badge.is-warning {
	background-color: #fef3c7;
	color: #92400e;
}

/* Disabled row styles */
.ts-session-item.is-disabled {
	opacity: 0.55;
	background: #f9fafb;
	border-color: #e5e7eb;
	cursor: not-allowed;
	pointer-events: none;
}

.ts-session-item.is-disabled .ts-session-title {
	text-decoration: line-through;
	color: #9ca3af;
}

.ts-empty-sessions,
.ts-master-disabled-notice {
	padding: 16px;
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	font-size: 13.5px;
	color: #6b7280;
	text-align: center;
}

/* ==========================================================================
   Card Footer & Equal-Height CTAs
   ========================================================================== */
.ts-card-footer {
	margin-top: auto;
}

/* Inline Validation Error */
.ts-card-error-notice {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #dc2626;
	font-size: 13.5px;
	font-weight: 500;
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 12px;
	animation: tsShakeError 0.35s ease;
}

.ts-card-error-notice svg {
	flex-shrink: 0;
	color: #dc2626;
}

@keyframes tsShakeError {

	0%,
	100% {
		transform: translateX(0);
	}

	20%,
	60% {
		transform: translateX(-5px);
	}

	40%,
	80% {
		transform: translateX(5px);
	}
}

/* Primary Booking Button */
.ts-cta-btn,
button.ts-btn-submit,
.ts-booking-wrapper .ts-cta-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	height: 48px !important;
	padding: 0 20px !important;
	background-color: #d8232a !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 9px !important;
	font-size: 15.5px !important;
	font-weight: 700 !important;
	letter-spacing: 0.2px !important;
	cursor: pointer !important;
	text-decoration: none !important;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease !important;
	position: relative !important;
	overflow: hidden !important;
}

.ts-cta-btn:hover:not(:disabled):not(.is-btn-disabled),
button.ts-btn-submit:hover:not(:disabled):not(.is-btn-disabled) {
	background-color: #b71b21 !important;
	box-shadow: 0 4px 14px rgba(216, 35, 42, 0.35) !important;
	transform: translateY(-1px) !important;
}

.ts-cta-btn:active:not(:disabled):not(.is-btn-disabled) {
	transform: translateY(1px);
	box-shadow: 0 2px 6px rgba(216, 35, 42, 0.25);
}

.ts-cta-btn:disabled,
.ts-cta-btn.is-btn-disabled {
	background-color: #9ca3af;
	color: #ffffff !important;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
	opacity: 0.75;
}

/* Spinner for redirection */
.ts-btn-spinner {
	display: none;
	width: 16px;
	height: 16px;
	margin-left: 8px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: tsSpin 0.7s infinite linear;
}

.ts-cta-btn.is-loading .ts-btn-spinner {
	display: inline-block;
}

@keyframes tsSpin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 860px) {
	.ts-cards-grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.ts-booking-heading {
		font-size: 26px;
	}

	.ts-card-item {
		padding: 24px 20px;
	}
}

@media (max-width: 480px) {
	.ts-booking-wrapper {
		margin: 24px auto;
		padding: 0 12px;
	}

	.ts-booking-heading {
		font-size: 22px;
	}

	.ts-card-title {
		font-size: 19px;
	}

	.ts-session-item {
		padding: 11px 12px;
	}

	.ts-session-title {
		font-size: 13.5px;
	}

	.ts-cta-btn {
		height: 46px;
		font-size: 15px;
	}
}