/* Sinar Djaja Trans - Seat Map & Booking System CSS */

/* Hide debug text elements */
.sdt-debug-version,
.sdt-css-version,
[data-sdt-debug],
.sdt-footer-debug,
.sdt-version-display,
.sdt-css-dom {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	position: absolute !important;
	left: -9999px !important;
}

/* Hide any text containing SDT CSS version */
*:contains("SDT CSS"),
*:contains("v1.4.2"),
*:contains("v1.2.0") {
	display: none !important;
}

.sdt-booking-container {
	max-width: 900px;
	margin: 30px auto;
	padding: 30px;
	background-color: #ffffff;
	border-radius: 12px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	width: 100%;
	box-sizing: border-box;
}

.sdt-booking-header {
	text-align: center;
	margin-bottom: 30px;
	background-color: #003d7a !important;
	padding: 25px 20px !important;
	border-radius: 8px 8px 0 0;
	border-bottom: 3px solid #2196F3;
}

.sdt-booking-header h2 {
	margin: 0 0 10px 0;
	color: #ffffff !important;
	font-size: 28px;
	font-weight: 600;
}

.sdt-booking-header p {
	margin: 5px 0;
	color: #ffffff !important;
	font-size: 14px;
}

.sdt-trip-info-preview {
	background-color: #e3f2fd;
	border-left: 4px solid #2196F3;
	padding: 20px;
	margin-bottom: 30px;
	border-radius: 6px;
}

.sdt-info-item {
	margin-bottom: 15px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.sdt-info-item:last-child {
	margin-bottom: 0;
}

.sdt-info-item strong {
	min-width: 120px;
	color: #1976d2;
	font-size: 14px;
}

.sdt-info-item span {
	color: #333;
	font-size: 14px;
}

.sdt-form-group {
	margin-bottom: 20px;
}

.sdt-form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #1976d2;
	font-size: 14px;
}

.sdt-date-picker,
.sdt-input,
select.sdt-input {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
	background-color: #fff;
	transition: all 0.3s ease;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	padding-right: 40px;
	color: #333;
}

select.sdt-input {
	cursor: pointer;
	background-color: #e8f4fd;
}

select.sdt-input option {
	background-color: #fff;
	color: #333;
	padding: 12px;
}

select.sdt-input option:checked {
	background-color: #2196F3;
	color: #fff;
}

.sdt-date-picker:focus,
.sdt-input:focus,
select.sdt-input:focus {
	outline: none;
	border-color: #2196F3;
	box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
	background-color: #e3f2fd;
}

.sdt-date-picker::placeholder,
.sdt-input::placeholder {
	color: #999;
}

.sdt-seat-map-wrapper {
	margin: 30px auto;
	padding: 25px;
	background-color: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	width: 100%;
	box-sizing: border-box;
	border: 2px solid #e0e0e0;
}

.sdt-seat-map-wrapper h3 {
	margin-top: 0;
	margin-bottom: 20px;
	color: #333;
	text-align: center;
	font-size: 16px;
}

.sdt-seat-map {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 20px;
	padding: 20px;
	background-color: #f5f5f5;
	border-radius: 8px;
}

.sdt-seat-map.sdt-custom-matrix {
	display: grid !important;
	gap: 8px !important;
	padding: 0;
	background-color: transparent;
	border-radius: 0;
	margin: 0 auto;
	width: fit-content;
	justify-content: center;
	/* JavaScript will set grid-template-columns via inline style */
}

/* Ensure all direct children of the grid have consistent alignment (exclude aisle) */
.sdt-seat-map.sdt-custom-matrix > *:not(.sdt-seat-aisle) {
	justify-self: center !important;
	align-self: center !important;
	margin: 0 !important;
	width: 48px !important;
	height: 48px !important;
}

/* SMALL BUS (14, 17, 19) - 5 column layout with 36px seats */
.sdt-seat-map.sdt-capacity-14,
.sdt-seat-map.sdt-capacity-17,
.sdt-seat-map.sdt-capacity-19 {
	--seat-size: 36px;
}

.sdt-seat-map.sdt-capacity-14 > *:not(.sdt-seat-aisle),
.sdt-seat-map.sdt-capacity-17 > *:not(.sdt-seat-aisle),
.sdt-seat-map.sdt-capacity-19 > *:not(.sdt-seat-aisle) {
	width: 36px !important;
	height: 36px !important;
	font-size: 12px !important;
}

.sdt-seat-map.sdt-capacity-14 .sdt-seat-aisle,
.sdt-seat-map.sdt-capacity-17 .sdt-seat-aisle,
.sdt-seat-map.sdt-capacity-19 .sdt-seat-aisle {
	width: 36px !important;
	height: 36px !important;
}

/* BIG BUS (35, 45) - 5 column layout with 52px seats */
.sdt-seat-map.sdt-capacity-35,
.sdt-seat-map.sdt-capacity-45 {
	--seat-size: 52px;
}

.sdt-seat-map.sdt-capacity-35 > *:not(.sdt-seat-aisle),
.sdt-seat-map.sdt-capacity-45 > *:not(.sdt-seat-aisle) {
	width: 52px !important;
	height: 52px !important;
	font-size: 14px !important;
}

.sdt-seat-map.sdt-capacity-35 .sdt-seat-aisle,
.sdt-seat-map.sdt-capacity-45 .sdt-seat-aisle {
	width: 52px !important;
	height: 52px !important;
}

/* Hapus atau nonaktifkan style sdt-seat-row karena sekarang langsung di-handle oleh grid utama */
.sdt-seat-row {
	display: none !important;
}

/* Sopir & Kernet bentuk kotak dengan sudut tumpul */
.sdt-seat-driver,
.sdt-seat-label {
	background-color: #ff9800;
	color: white;
	border: 2px solid #f57c00;
	border-radius: 8px; /* Changed from 30px to 8px for box shape */
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: bold;
	text-transform: uppercase;
	pointer-events: none;
	height: 50px;
	width: 50px;
	min-width: 50px;
	padding: 2px;
}

/* Placeholder untuk null - kotak transparan */
.sdt-seat-placeholder {
	background-color: transparent;
	border: none;
	pointer-events: none;
	width: 36px; /* Default for small bus */
	height: 36px;
	visibility: hidden; /* Reserve grid space but invisible */
}

.sdt-seat-aisle {
	background-color: transparent;
	border: none;
	pointer-events: none;
	width: 36px; /* Default for small bus */
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: bold;
	color: #999;
	visibility: visible; /* Show row number */
}

/* Seat styling - responsive default for small buses */
.sdt-seat {
	width: 36px;
	height: 36px;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px; /* Changed from 50% to 8px for box shape */
	font-weight: bold;
	font-size: 12px;
	transition: all 0.25s ease;
	user-select: none;
	margin: 0;
}

/* Override seat size for bigger buses */
.sdt-seat-map.sdt-capacity-35 .sdt-seat,
.sdt-seat-map.sdt-capacity-45 .sdt-seat {
	width: 52px !important;
	height: 52px !important;
	font-size: 14px !important;
}

/* Override driver/kernet size for small buses */
.sdt-seat-map.sdt-capacity-14 .sdt-seat-driver,
.sdt-seat-map.sdt-capacity-17 .sdt-seat-driver,
.sdt-seat-map.sdt-capacity-19 .sdt-seat-driver {
	width: 36px !important;
	height: 36px !important;
	font-size: 10px !important;
	border-radius: 8px !important;
	padding: 2px !important;
}

/* Override driver/kernet size for big buses */
.sdt-seat-map.sdt-capacity-35 .sdt-seat-driver,
.sdt-seat-map.sdt-capacity-45 .sdt-seat-driver {
	width: 50px !important;
	height: 50px !important;
	font-size: 11px !important;
}

/* Biru Langit = Kosong (Available) */
.sdt-seat.available {
	background-color: #daeefe; /* Sky blue background */
	color: #1565c0; /* Darker blue text for contrast */
	border: 2px solid #b3e5fc; /* Light sky blue border */
	cursor: pointer;
}

.sdt-seat.available:hover {
	background-color: #b3e5fc; /* Slightly darker on hover */
	transform: scale(1.08);
}

/* Merah Transparan = Sudah Booking (Booked) */
.sdt-seat.booked {
	background-color: #F7B8B7; /* Transparent red background */
	color: #c62828; /* Dark red text */
	border: 2px solid #e57373; /* Light red border */
	cursor: not-allowed;
	opacity: 0.8;
}

/* Kuning Lemon = Dipilih (Selected) */
.sdt-seat.selected {
	background-color: #fff782; /* Lemon yellow background */
	color: #f57f17; /* Darker yellow/amber text */
	border: 2px solid #ffd54f; /* Lighter yellow border */
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(255, 213, 79, 0.4);
	cursor: pointer;
}

.sdt-seat-legend {
	display: flex;
	justify-content: center;
	gap: 25px;
	padding: 15px;
	margin-bottom: 20px;
	background-color: #f9f9f9;
	border-radius: 6px;
	flex-wrap: wrap;
	border: 1px solid #eee;
}

.sdt-legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #555;
}

/* Indikator legend ikut kotak */
.sdt-seat-indicator {
	width: 22px;
	height: 22px;
	border-radius: 8px; /* Changed from 50% to 8px for box shape */
	border: 2px solid #ddd;
	display: inline-block;
}

.sdt-seat-indicator.sdt-available {
	background-color: #daeefe; /* Sky blue */
	border-color: #b3e5fc;
	color: #1565c0;
}

.sdt-seat-indicator.sdt-booked {
	background-color: #F7B8B7; /* Transparent red */
	border-color: #e57373;
	color: #c62828;
}

.sdt-seat-indicator.sdt-selected {
	background-color: #fff782; /* Lemon yellow */
	border-color: #ffd54f;
	color: #f57f17;
}

.sdt-booking-form-wrapper {
	margin: 30px 0;
	padding: 30px;
	background-color: #fff;
	border-radius: 12px;
	border: 2px solid #e0e0e0;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.sdt-selected-seat-info {
	background-color: #e3f2fd;
	border-left: 4px solid #2196F3;
	padding: 15px;
	margin-bottom: 20px;
	border-radius: 4px;
}

.sdt-booking-form {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.sdt-btn-submit,
.sdt-btn-cancel {
	padding: 16px 32px;
	font-size: 16px;
	font-weight: 700;
	border: none;
	border-radius: 2px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100%;
	max-width: 320px;
	display: block;
	margin: 12px auto;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	position: relative;
	overflow: hidden;
}

.sdt-btn-submit {
	background: #1768a7;
	color: white;
}

.sdt-btn-submit::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
	transition: left 0.5s;
}

.sdt-btn-submit:hover::before {
	left: 100%;
}

.sdt-btn-submit:hover {
	background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
}

.sdt-btn-cancel {
	background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
	color: white;
	box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.sdt-btn-cancel::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
	transition: left 0.5s;
}

.sdt-btn-cancel:hover::before {
	left: 100%;
}

.sdt-btn-cancel:hover {
	background: linear-gradient(135deg, #ee5a6f 0%, #ff6b6b 100%);
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 12px 28px rgba(255, 107, 107, 0.5);
}

.sdt-loading {
	text-align: center;
	padding: 20px;
	color: #2196F3;
	font-weight: 600;
}

.sdt-message {
	padding: 15px 20px;
	border-radius: 6px;
	margin: 20px 0;
	border-left: 4px solid;
	font-weight: 500;
}

.sdt-message.success {
	background-color: #d4edda;
	color: #155724;
	border-color: #4caf50;
}

.sdt-message.error {
	background-color: #f8d7da;
	color: #721c24;
	border-color: #f44336;
}

/* Hide old theme booking modal */
#bookingPopup,
.booking-popup,
.sdt-old-booking-modal {
	display: none !important;
	visibility: hidden !important;
}

/* Global dropdown styling to fix yellow/black colors - AGGRESSIVE OVERRIDE */
* {
	box-sizing: border-box;
}

select,
.form-control select,
select.form-control,
select.sdt-input,
.form-control select,
input[type="select"],
* select,
* * select,
* * * select,
* > select,
* > * > select,
* > * > * > select,
div select,
span select,
form select,
.gform_wrapper select,
select.form-control,
.form-control > select,
.select2-container--default .select2-selection--single {
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	background-color: #ffffff !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 16px center !important;
	padding-right: 40px !important;
	border: 2px solid #e0e0e0 !important;
	border-radius: 12px !important;
	color: #333333 !important;
	transition: all 0.3s ease !important;
	font-size: 14px !important;
	padding: 14px 16px !important;
	min-height: 48px !important;
}

/* Override any inline styles */
select[style],
.form-control select[style],
select.form-control[style],
* select[style] {
	background-color: #ffffff !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
	border: 2px solid #e0e0e0 !important;
	color: #333333 !important;
}

select option,
.form-control select option,
select.form-control option,
select.sdt-input option,
* select option,
* * select option {
	background-color: #ffffff !important;
	color: #333333 !important;
	padding: 12px !important;
}

select option:checked,
.form-control select option:checked,
select.form-control option:checked,
select.sdt-input option:checked,
* select option:checked {
	background-color: #667eea !important;
	color: #ffffff !important;
}

select:hover,
.form-control select:hover,
select.form-control:hover,
select.sdt-input:hover,
* select:hover {
	border-color: #667eea !important;
}

select:focus,
.form-control select:focus,
select.form-control:focus,
select.sdt-input:focus,
* select:focus {
	outline: none !important;
	border-color: #667eea !important;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
	background-color: #fafbfc !important;
}

@media (max-width: 768px) {
	.sdt-booking-container {
		padding: 15px;
		margin: 10px;
	}

	.sdt-seat-map {
		grid-template-columns: repeat(3, 1fr);
		gap: 8px;
	}

	.sdt-seat-map.sdt-custom-matrix {
		gap: 4px;
		padding: 15px;
	}

	.sdt-seat-row {
		gap: 5px;
		max-width: 100%;
	}

	.sdt-seat {
		width: 40px;
		height: 40px;
		font-size: 11px;
	}

	.sdt-seat-map.sdt-custom-matrix .sdt-seat,
	.sdt-seat-map.sdt-custom-matrix .sdt-seat-driver {
		width: 40px;
		height: 40px;
	}

	.sdt-seat-driver,
	.sdt-seat-label {
		height: 36px;
		font-size: 10px;
	}

	.sdt-booking-form-wrapper {
		padding: 20px;
		margin: 20px 0;
	}

	.sdt-form-group {
		margin-bottom: 15px;
	}

	.sdt-date-picker,
	.sdt-input,
	select.sdt-input {
		padding: 12px 14px;
		font-size: 13px;
	}

	.sdt-btn-submit,
	.sdt-btn-cancel {
		padding: 14px 24px;
		font-size: 14px;
		max-width: 100%;
	}

	.sdt-seat-legend {
		gap: 15px;
		padding: 12px;
	}

	.sdt-legend-item {
		font-size: 12px;
	}

	.sdt-seat-indicator {
		width: 18px;
		height: 18px;
	}
}

@media (max-width: 768px) {
	.sdt-booking-container {
		padding: 15px;
		margin: 10px;
	}

	.sdt-seat-map.sdt-custom-matrix {
		gap: 4px;
		padding: 15px;
		overflow-x: auto;
		box-sizing: border-box;
		max-width: 100%;
	}

	.sdt-seat-row {
		gap: 4px;
		/* Flexible grid for mobile */
		grid-template-columns: repeat(var(--max-cols, 5), minmax(32px, 1fr)) !important;
	}

	.sdt-seat,
	.sdt-seat-driver,
	.sdt-seat-aisle {
		width: 100% !important;
		min-width: 32px;
	}

	.sdt-seat {
		height: 32px;
		font-size: 11px;
	}

	.sdt-seat-driver,
	.sdt-seat-label {
		height: 30px;
		font-size: 10px;
	}

	.sdt-seat-aisle {
		min-width: 20px;
	}

	.sdt-booking-form-wrapper {
		padding: 15px;
		margin: 15px 0;
	}

	.sdt-btn-submit,
	.sdt-btn-cancel {
		padding: 12px 20px;
		font-size: 13px;
	}

	.sdt-seat-legend {
		flex-direction: column;
		gap: 10px;
		align-items: flex-start;
	}
}

@media (max-width: 480px) {
	.sdt-booking-container {
		padding: 8px;
		margin: 5px;
		max-width: none; /* Remove width constraint for full width */
		overflow-x: auto;
		width: 180%; /* Diperbesar lagi 40% untuk mobile */
	}

	.sdt-seat-map.sdt-custom-matrix {
		row-gap: 4px !important;
		column-gap: 8px !important;
		padding: 10px !important;
		overflow-x: auto;
		box-sizing: border-box;
		max-width: 100%; /* Full width for better mobile UI visibility */
		margin: 0 auto;
		/* Use fixed grid for mobile to match desktop alignment */
		grid-template-columns: repeat(var(--max-cols, 4), 26px) !important; /* Seat size 26px */
	}

	.sdt-seat-row {
		gap: 4px;
		/* Fixed grid for mobile to match desktop */
		grid-template-columns: repeat(var(--max-cols, 4), 26px) !important; /* Seat size 26px */
	}

	/* Lorong tengah lebih lebar khusus armada 14/17/19 kursi (margin di elemen kosong tidak menggeser kolom grid, jadi pakai column-gap) */
	.sdt-seat-map.sdt-custom-matrix.sdt-capacity-14,
	.sdt-seat-map.sdt-custom-matrix.sdt-capacity-17,
	.sdt-seat-map.sdt-custom-matrix.sdt-capacity-19 {
		column-gap: 8px !important;
		row-gap: 4px !important;
	}

	/* Set seat size to 26px for mobile */
	.sdt-seat,
	.sdt-seat-driver,
	.sdt-seat-aisle {
		width: 26px !important; /* Seat size 26px */
		min-width: 26px !important;
		height: 26px !important;
	}

	.sdt-seat {
		height: 26px !important;
		font-size: 10px; /* Font size adjusted for 26px seat */
	}

	.sdt-seat-map.sdt-custom-matrix .sdt-seat,
	.sdt-seat-map.sdt-custom-matrix .sdt-seat-driver {
		width: 26px !important;
		height: 26px !important;
		min-width: 26px !important;
	}

	.sdt-seat-driver,
	.sdt-seat-label {
		height: 26px !important;
		font-size: 6px !important; /* Smaller font for sopir/kernet to fit in 26px seat */
		padding: 1px;
		line-height: 1.2;
	}

	.sdt-seat-aisle {
		min-width: 26px !important;
		height: 26px !important;
	}

	.sdt-booking-form-wrapper {
		padding: 25px;
		margin: 30px auto 0;
		max-width: 100%;
		width: 100%;
		overflow-x: auto;
		box-sizing: border-box;
		background-color: #fff;
		border-radius: 10px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	}

	.sdt-btn-submit,
	.sdt-btn-cancel {
		padding: 12px 16px;
		font-size: 12px;
		max-width: calc(50% - 4px);
		display: inline-block;
		margin-right: 4px;
	}

	.sdt-seat-legend {
		flex-direction: column;
		gap: 8px;
		align-items: flex-start;
	}
}

/* Extra small mobile (375px and below) */
@media (max-width: 375px) {
	.sdt-seat-legend {
		gap: 8px !important;
		padding: 12px 8px !important;
		flex-wrap: wrap !important;
		justify-content: center !important;
		align-items: center !important;
	}

	.sdt-legend-item {
		font-size: 11px !important;
		padding: 4px 6px !important;
		height: 24px !important;
		flex: 0 0 auto !important;
		white-space: nowrap !important;
	}

	.sdt-seat-indicator {
		width: 16px !important;
		height: 16px !important;
	}
}