/**
 * Travel Plan Builder Styles
 *
 * Comprehensive styling for the travel plan builder interface including:
 * - Responsive grid layout for main content and sidebar
 * - Interactive museum list with drag-and-drop styling
 * - Form styling and button states
 * - Mobile-first responsive design
 * - Loading states and animations
 * - Message system styling
 *
 * @package AutomuseumsCore
 * @author Synergy Marketing info@synergymarketing.mk
 * @since 1.0.0
 */

/* ==========================================================================
   Main Layout & Container
   ========================================================================== */

.travel-plan-builder-wrapper {
	padding: 2rem 0;
	min-height: calc(100vh - 200px);
	background: #f8f9fa;
}

.travel-plan-builder-wrapper .container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1rem;
}

.travel-plan-header {
	text-align: center;
	margin-bottom: 3rem;
	padding: 2rem 0;
	background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
	color: white;
	border-radius: 12px;
	box-shadow: 0 4px 15px rgba(0, 124, 186, 0.2);
}

.travel-plan-header .page-title {
	font-size: 2.5rem;
	margin: 0 0 1rem 0;
	font-weight: 700;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.travel-plan-header .page-description {
	font-size: 1.1rem;
	margin: 0;
	opacity: 0.9;
	line-height: 1.6;
	max-width: 600px;
	margin: 0 auto;
}

.travel-plan-content {
	display: grid;
	grid-template-columns: 1fr 420px;
	gap: 2rem;
	align-items: start;
}

/* ==========================================================================
   Map Section
   ========================================================================== */

.map-section {
	background: white;
	border-radius: 12px;
	padding: 2rem;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	border: 1px solid #e9ecef;
	transition: box-shadow 0.3s ease;
}

.map-section:hover {
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.map-header h2 {
	margin: 0 0 0.5rem 0;
	color: #2c3e50;
	font-size: 1.5rem;
	font-weight: 600;
}

.map-instructions {
	color: #6c757d;
	margin-bottom: 1.5rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.museum-map-container-wrapper {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Sidebar Layout
   ========================================================================== */

.travel-plan-sidebar {
	position: sticky;
	top: 2rem;
	height: fit-content;
	max-height: calc(100vh - 4rem);
	overflow-y: auto;
}

.sidebar-content > div {
	background: white;
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	border: 1px solid #e9ecef;
	margin-bottom: 1.5rem;
	transition: all 0.3s ease;
}

.sidebar-content > div:hover {
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

/* ==========================================================================
   Selected Museums Panel
   ========================================================================== */

.selected-museums-panel {
	min-height: 400px;
}

.panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 2px solid #e9ecef;
}

.panel-header h3 {
	margin: 0;
	color: #2c3e50;
	font-size: 1.3rem;
	font-weight: 600;
}

.museum-count {
	background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
	color: white;
	padding: 0.4rem 1rem;
	border-radius: 20px;
	font-size: 0.9rem;
	font-weight: 700;
	box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
	transition: all 0.2s ease;
}

.museum-count:empty::before {
	content: "0";
}

.museums-list-container {
	max-height: 450px;
	overflow-y: auto;
	overflow-x: hidden;
}

.museums-list {
	min-height: 300px;
	border: 2px dashed #dee2e6;
	border-radius: 10px;
	padding: 1rem;
	transition: all 0.3s ease;
}

.museums-list.ui-sortable {
	border-color: #007cba;
	background: rgba(0, 124, 186, 0.02);
}

.museums-list:hover {
	border-color: #007cba;
	background: rgba(0, 124, 186, 0.01);
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.empty-state {
	text-align: center;
	padding: 3rem 1rem;
	color: #6c757d;
	transition: all 0.3s ease;
}

.empty-state:hover {
	color: #495057;
}

.empty-icon {
	font-size: 4rem;
	margin-bottom: 1rem;
	opacity: 0.6;
}

.empty-state p {
	margin: 0 0 0.5rem 0;
	font-size: 1.1rem;
	font-weight: 500;
}

.empty-state small {
	font-size: 0.9rem;
	opacity: 0.8;
	line-height: 1.4;
}

/* ==========================================================================
   Museum Items
   ========================================================================== */

.museum-item {
	background: #ffffff;
	border: 1px solid #e9ecef;
	border-radius: 8px;
	padding: 1.2rem;
	margin-bottom: 0.75rem;
	cursor: move;
	transition: all 0.2s ease;
	position: relative;
	overflow: hidden;
}

.museum-item::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: linear-gradient(to bottom, #007cba, #005a87);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.museum-item:hover {
	background: #f8f9fa;
	border-color: #007cba;
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(0, 124, 186, 0.15);
}

.museum-item:hover::before {
	opacity: 1;
}

.museum-item.ui-sortable-helper {
	transform: rotate(3deg) scale(1.02);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
	z-index: 1000;
	opacity: 0.95;
}

.museum-item.dragging {
	opacity: 0.7;
	transform: rotate(2deg);
}

.museum-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}

.drag-handle {
	cursor: grab;
	color: #6c757d;
	font-size: 1.1rem;
	padding: 0.25rem;
	user-select: none;
	transition: color 0.2s ease;
	border-radius: 4px;
}

.drag-handle:hover {
	color: #007cba;
	background: rgba(0, 124, 186, 0.1);
}

.drag-handle:active {
	cursor: grabbing;
}

.museum-order {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	color: #495057;
	padding: 0.3rem 0.7rem;
	border-radius: 15px;
	font-size: 0.8rem;
	font-weight: 700;
	border: 1px solid #dee2e6;
	min-width: 30px;
	text-align: center;
}

.remove-museum {
	background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
	color: white;
	border: none;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	cursor: pointer;
	font-size: 14px;
	font-weight: bold;
	line-height: 1;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.remove-museum:hover {
	background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
	transform: scale(1.1);
	box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
}

.museum-title {
	margin: 0 0 0.75rem 0;
	color: #2c3e50;
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.3;
}

.museum-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	font-size: 0.85rem;
}

.museum-city,
.museum-country {
	background: #e9ecef;
	color: #495057;
	padding: 0.25rem 0.7rem;
	border-radius: 12px;
	border: 1px solid #dee2e6;
	font-weight: 500;
}

.museum-types {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-top: 0.5rem;
}

.type-tag {
	background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
	color: white;
	padding: 0.2rem 0.6rem;
	border-radius: 10px;
	font-size: 0.75rem;
	font-weight: 500;
	box-shadow: 0 1px 3px rgba(0, 124, 186, 0.3);
}

/* ==========================================================================
   Sortable Placeholder
   ========================================================================== */

.museum-item-placeholder {
	background: linear-gradient(135deg, rgba(0, 124, 186, 0.05) 0%, rgba(0, 90, 135, 0.05) 100%);
	border: 2px dashed #007cba;
	height: 120px;
	border-radius: 8px;
	margin-bottom: 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #007cba;
	font-size: 0.95rem;
	font-weight: 600;
	animation: pulse 1.5s ease-in-out infinite;
}

.museum-item-placeholder::before {
	content: "🎯 Drop museum here";
}

@keyframes pulse {
	0%, 100% { opacity: 0.7; }
	50% { opacity: 1; }
}

/* ==========================================================================
   Trip Details Form
   ========================================================================== */

.trip-details-panel h3 {
	margin: 0 0 1.5rem 0;
	color: #2c3e50;
	font-size: 1.3rem;
	font-weight: 600;
	border-bottom: 2px solid #e9ecef;
	padding-bottom: 1rem;
}

.trip-form {
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.form-group label {
	font-weight: 600;
	color: #495057;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.form-control {
	width: 100%;
	padding: 0.8rem 1rem;
	border: 2px solid #e9ecef;
	border-radius: 8px;
	font-size: 0.95rem;
	transition: all 0.3s ease;
	background: white;
}

.form-control:focus {
	outline: none;
	border-color: #007cba;
	box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-control:invalid {
	border-color: #dc3545;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.action-buttons-panel {
	margin-top: 0;
}

.button-group {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.btn {
	padding: 1rem 1.5rem;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 600;
	transition: all 0.2s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	position: relative;
	overflow: hidden;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.btn::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;
}

.btn:hover::before {
	left: 100%;
}

.btn-primary {
	background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
	color: white;
	box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.btn-primary:hover:not(:disabled) {
	background: linear-gradient(135deg, #005a87 0%, #004066 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.btn-secondary {
	background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
	color: white;
	box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover:not(:disabled) {
	background: linear-gradient(135deg, #495057 0%, #343a40 100%);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-outline {
	background: white;
	color: #6c757d;
	border: 2px solid #dee2e6;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-outline:hover:not(:disabled) {
	border-color: #007cba;
	color: #007cba;
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(0, 124, 186, 0.15);
}

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none !important;
	box-shadow: none !important;
}

.btn-loading {
	display: none;
}

/* ==========================================================================
   Login Notice
   ========================================================================== */

.login-notice {
	background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
	border: 1px solid #ffeaa7;
	border-radius: 8px;
	padding: 1rem;
	color: #856404;
	font-size: 0.9rem;
	text-align: center;
	box-shadow: 0 2px 8px rgba(255, 234, 167, 0.3);
}

.login-notice a {
	color: #007cba;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}

.login-notice a:hover {
	border-bottom-color: #007cba;
}

/* ==========================================================================
   Loading & Messages
   ========================================================================== */

.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(2px);
}

.loading-content {
	background: white;
	padding: 2rem;
	border-radius: 12px;
	text-align: center;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
	max-width: 300px;
}

.loading-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #007cba;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 1rem;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.message-container {
	position: fixed;
	top: 2rem;
	right: 2rem;
	z-index: 10000;
	max-width: 400px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
	.travel-plan-content {
		grid-template-columns: 1fr 380px;
		gap: 1.5rem;
	}
}

@media (max-width: 992px) {
	.travel-plan-content {
		grid-template-columns: 1fr;
		gap: 2rem;
	}
	
	.travel-plan-sidebar {
		position: static;
		order: -1;
		max-height: none;
	}
	
	.sidebar-content {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 1.5rem;
	}
	
	.selected-museums-panel {
		grid-column: 1 / -1;
		min-height: 300px;
	}
}

@media (max-width: 768px) {
	.travel-plan-builder-wrapper {
		padding: 1rem 0;
	}
	
	.travel-plan-builder-wrapper .container {
		padding: 0 0.5rem;
	}
	
	.travel-plan-header {
		margin-bottom: 2rem;
		padding: 1.5rem 1rem;
	}
	
	.travel-plan-header .page-title {
		font-size: 2rem;
	}
	
	.travel-plan-header .page-description {
		font-size: 1rem;
	}
	
	.sidebar-content {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
	
	.sidebar-content > div {
		padding: 1rem;
		margin-bottom: 1rem;
	}
	
	.form-row {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
	
	.museum-item {
		padding: 1rem;
	}
	
	.museum-item-header {
		flex-wrap: wrap;
		gap: 0.5rem;
	}
	
	.message-container {
		top: 1rem;
		right: 1rem;
		left: 1rem;
		max-width: none;
	}
	
	.museums-list {
		min-height: 200px;
	}
}

@media (max-width: 480px) {
	.travel-plan-header .page-title {
		font-size: 1.5rem;
	}
	
	.panel-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}
	
	.museum-meta {
		flex-direction: column;
		gap: 0.25rem;
	}
	
	.form-control {
		padding: 0.7rem 0.8rem;
		font-size: 0.9rem;
	}
	
	.btn {
		padding: 0.8rem 1rem;
		font-size: 0.9rem;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.travel-plan-sidebar,
	.action-buttons-panel,
	.loading-overlay,
	.message-container {
		display: none !important;
	}
	
	.travel-plan-content {
		grid-template-columns: 1fr;
	}
	
	.museum-item {
		break-inside: avoid;
		box-shadow: none;
		border: 1px solid #ccc;
	}
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
	.museum-item {
		border-width: 2px;
	}
	
	.btn {
		border: 2px solid currentColor;
	}
	
	.form-control {
		border-width: 2px;
	}
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
	
	.loading-spinner {
		animation: none;
		border-top-color: #007cba;
	}
}

/* ==========================================================================
   Route Information Panel
   ========================================================================== */

.route-info-panel {
	background: #f8f9fa;
	border: 2px solid #007cba;
	border-radius: 8px;
	padding: 1rem;
	margin-top: 1rem;
	margin-bottom: 1rem;
	font-size: 0.9rem;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	z-index: 10;
	position: relative;
	min-height: 80px;
	width: 100%;
	box-shadow: 0 4px 15px rgba(0, 124, 186, 0.15);
	transition: all 0.3s ease;
}

.route-info-panel:hover {
	box-shadow: 0 6px 20px rgba(0, 124, 186, 0.25);
	transform: translateY(-1px);
}

.route-summary h4 {
	margin: 0 0 0.75rem 0;
	color: #007cba;
	font-size: 1rem;
	font-weight: 600;
}

.route-stats {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 0.75rem;
	margin-bottom: 1rem;
	background: #ffffff;
	padding: 0.75rem;
	border-radius: 6px;
	border: 1px solid #e9ecef;
}

.route-stat {
	text-align: center;
	padding: 0.5rem;
	background: #f8f9fa;
	border-radius: 4px;
	border: 1px solid #dee2e6;
}

.route-stat strong {
	display: block;
	color: #007cba;
	font-weight: 600;
	font-size: 0.8rem;
	text-transform: uppercase;
	margin-bottom: 0.25rem;
	letter-spacing: 0.5px;
}

.route-stat span {
	display: block;
	color: #2c3e50;
	font-weight: 700;
	font-size: 1.1rem;
}

.optimize-route-btn {
	background: #28a745;
	color: white;
	border: none;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s;
	width: 100%;
}

.optimize-route-btn:hover {
	background: #218838;
}

.optimize-route-btn:active {
	background: #1e7e34;
}

/* Enhanced route panel styles */
.route-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}

.route-title {
	margin: 0;
	color: #007cba;
	font-size: 1rem;
	font-weight: 600;
	flex: 1;
}

.route-toggle-btn {
	background: transparent;
	border: none;
	color: #007cba;
	font-size: 0.9rem;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 3px;
	transition: background-color 0.2s;
}

.route-toggle-btn:hover {
	background: rgba(0, 124, 186, 0.1);
}

.route-details {
	transition: all 0.3s ease;
}

.route-info-panel.collapsed {
	padding-bottom: 0.5rem;
}

.route-info-panel.collapsed .route-details {
	display: none;
}

.route-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	align-items: center;
}

.route-actions button {
	border: none;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	flex: 1;
	min-width: 120px;
}

.route-actions button.primary {
	background: #28a745;
	color: white;
}

.route-actions button.primary:hover {
	background: #218838;
	transform: translateY(-1px);
}

.route-actions button.secondary {
	background: #6c757d;
	color: white;
}

.route-actions button.secondary:hover {
	background: #5a6268;
	transform: translateY(-1px);
}

.route-hint {
	color: #6c757d;
	font-size: 0.8rem;
	font-style: italic;
	padding: 0.5rem;
	text-align: center;
	background: #f8f9fa;
	border-radius: 4px;
	flex: 1;
}

/* Mode-specific styles */
.route-info-panel.mode-building {
	border-color: #28a745;
	box-shadow: 0 4px 15px rgba(40, 167, 69, 0.15);
}

.route-info-panel.mode-viewing {
	border-color: #6c757d;
	box-shadow: 0 4px 15px rgba(108, 117, 125, 0.15);
}

.route-info-panel.mode-viewing:hover {
	box-shadow: 0 6px 20px rgba(108, 117, 125, 0.25);
}

#route-calculating-indicator {
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffeaa7;
	border-radius: 4px;
	padding: 0.5rem;
	margin-top: 0.5rem;
	font-size: 0.85rem;
	text-align: center;
}

/* Mobile responsive */
@media (max-width: 768px) {
	.route-stats {
		font-size: 0.85rem;
	}
	
	.route-stat {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}
}

/* ==========================================================================
   Enhanced Route Visualization Styles
   ========================================================================== */

/* Route Segment Popups */
.route-segment-popup {
	min-width: 280px;
	font-family: system-ui, -apple-system, sans-serif;
	line-height: 1.4;
}

.route-segment-popup .popup-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #e0e0e0;
}

.route-segment-popup .status-icon {
	font-size: 1.2rem;
}

.route-segment-popup .status-badge {
	padding: 0.2rem 0.5rem;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.route-segment-popup .status-badge.primary {
	background: #e3f2fd;
	color: #1976d2;
}

.route-segment-popup .status-badge.optimized {
	background: #e8f5e8;
	color: #2e7d32;
}

.route-segment-popup .popup-content {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.route-segment-popup .route-info {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.route-segment-popup .arrow {
	color: #666;
	font-weight: bold;
}

.route-segment-popup .from,
.route-segment-popup .to {
	font-weight: 500;
}

.route-segment-popup .travel-details {
	display: flex;
	gap: 1rem;
	padding: 0.5rem;
	background: #f8f9fa;
	border-radius: 4px;
	font-size: 0.9rem;
}

.route-segment-popup .distance,
.route-segment-popup .duration {
	font-weight: 500;
}

/* Route Segment Popup Actions (P1-2) */
.route-segment-popup .popup-actions {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid #e0e0e0;
}

.route-segment-popup .directions-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: #1a73e8;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-size: 0.9rem;
	font-weight: 500;
	transition: background-color 0.2s ease;
}

.route-segment-popup .directions-link:hover {
	background: #1557b0;
	color: #fff;
	text-decoration: none;
}

.route-segment-popup .directions-link:focus {
	outline: 2px solid #1a73e8;
	outline-offset: 2px;
}

/* Route Hover Tooltips */
.route-hover-tooltip {
	background: rgba(0, 0, 0, 0.8) !important;
	border: none !important;
	border-radius: 4px !important;
	color: white !important;
	font-size: 0.85rem !important;
	padding: 0.5rem 0.75rem !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.route-hover-tooltip::before {
	border-top-color: rgba(0, 0, 0, 0.8) !important;
}

/* Enhanced Route Hover Tooltip (P1-2) */
.route-hover-tooltip-enhanced {
	padding: 0.75rem 1rem !important;
	min-width: 200px !important;
	max-width: 320px !important;
}

.route-tooltip-enhanced {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

/* Museum names section */
.route-tooltip-museums {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	font-weight: 500;
	line-height: 1.3;
}

.route-tooltip-museums .museum-from,
.route-tooltip-museums .museum-to {
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 130px;
}

.route-tooltip-museums .tooltip-arrow {
	color: #ffd700;
	font-weight: bold;
	flex-shrink: 0;
}

/* Stats section */
.route-tooltip-stats {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9em;
	color: rgba(255, 255, 255, 0.85);
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	padding-top: 0.5rem;
	margin-top: 0.25rem;
}

.route-tooltip-stats .stat-distance,
.route-tooltip-stats .stat-duration {
	white-space: nowrap;
}

.route-tooltip-stats .stat-separator {
	color: rgba(255, 255, 255, 0.5);
}

/* Mobile responsive tooltip */
@media (max-width: 768px) {
	.route-hover-tooltip-enhanced {
		min-width: 180px !important;
		max-width: 280px !important;
		padding: 0.5rem 0.75rem !important;
		font-size: 0.8rem !important;
	}

	.route-tooltip-museums {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}

	.route-tooltip-museums .museum-from,
	.route-tooltip-museums .museum-to {
		max-width: 100%;
	}

	.route-tooltip-museums .tooltip-arrow {
		display: block;
		margin-left: 1.5rem;
	}

	.route-tooltip-stats {
		flex-wrap: wrap;
	}
}

/* Waypoint Markers */
.custom-waypoint-marker {
	background: transparent !important;
	border: none !important;
}

.waypoint-marker {
	position: relative;
	background: white;
	border: 2px solid;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	font-size: 0.75rem;
	font-weight: bold;
}

.waypoint-start {
	border-color: #28a745;
	background: #28a745;
	color: white;
}

.waypoint-waypoint {
	border-color: #007cba;
	background: white;
	color: #007cba;
}

.waypoint-end {
	border-color: #dc3545;
	background: #dc3545;
	color: white;
}

.waypoint-marker .waypoint-icon {
	position: absolute;
	top: -8px;
	right: -8px;
	background: white;
	border-radius: 50%;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.waypoint-marker .waypoint-number {
	font-weight: bold;
	font-size: 0.8rem;
}

/* Waypoint Popups */
.waypoint-popup {
	text-align: center;
	min-width: 150px;
}

.waypoint-popup .waypoint-title {
	font-weight: 600;
	margin-bottom: 0.25rem;
	font-size: 0.95rem;
}

.waypoint-popup .waypoint-order {
	color: #666;
	font-size: 0.85rem;
}

/* Route Line Animation */
.route-segment {
	transition: all 0.3s ease;
}

.route-segment:hover {
	filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
}

/* Ensure route polylines are visible with high z-index */
.leaflet-overlay-pane svg path {
	z-index: 500 !important;
	pointer-events: all !important;
}

/* Force route visibility for debugging */
.leaflet-overlay-pane .route-segment-0,
.leaflet-overlay-pane .route-segment-1,
.leaflet-overlay-pane .route-segment-2,
.leaflet-overlay-pane .route-segment-3,
.leaflet-overlay-pane .route-segment-4 {
	stroke-opacity: 0.9 !important;
	fill-opacity: 0 !important;
	stroke-width: 4px !important;
}

/* Optimized Route Styling */
.route-segment.optimized {
	animation: optimized-pulse 2s ease-in-out infinite;
}

@keyframes optimized-pulse {
	0%, 100% {
		opacity: 0.8;
	}
	50% {
		opacity: 1.0;
	}
}

/* Mobile Responsiveness for Route Elements */
@media (max-width: 768px) {
	.route-segment-popup {
		min-width: 240px;
		font-size: 0.9rem;
	}

	.route-segment-popup .travel-details {
		flex-direction: column;
		gap: 0.25rem;
	}

	.waypoint-marker {
		width: 28px;
		height: 28px;
	}

	.waypoint-marker .waypoint-icon {
		width: 16px;
		height: 16px;
		font-size: 9px;
	}

	.route-hover-tooltip {
		font-size: 0.8rem !important;
		padding: 0.4rem 0.6rem !important;
	}
}

/* ==========================================================================
   Share Modal Styles
   ========================================================================== */

/* Prevent body scroll when modal is open */
body.share-modal-open {
	overflow: hidden;
}

/* Modal Overlay */
.travel-plan-share-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.travel-plan-share-modal-overlay.share-modal--visible {
	opacity: 1;
	visibility: visible;
}

/* Modal Container */
.travel-plan-share-modal {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	max-width: 480px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	transform: translateY(-20px);
	transition: transform 0.3s ease;
}

.share-modal--visible .travel-plan-share-modal {
	transform: translateY(0);
}

/* Modal Header */
.share-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e0e0e0;
}

.share-modal__header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.share-modal__close {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 4px;
	transition: color 0.2s;
}

.share-modal__close:hover {
	color: #333;
}

/* Modal Body */
.share-modal__body {
	padding: 20px;
}

/* Plan Preview */
.share-modal__preview {
	text-align: center;
	padding-bottom: 16px;
	border-bottom: 1px solid #e0e0e0;
	margin-bottom: 16px;
}

.share-modal__plan-title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.share-modal__plan-meta {
	margin: 0;
	font-size: 14px;
	color: #666;
}

/* URL Section */
.share-modal__url-section {
	margin-bottom: 20px;
}

.share-modal__url-section label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	margin-bottom: 8px;
}

.share-modal__url-wrapper {
	display: flex;
	gap: 8px;
}

.share-modal__url-input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	background-color: #f8f9fa;
	color: #333;
}

.share-modal__copy-btn {
	padding: 10px 16px;
	background-color: #0073aa;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s;
	min-width: 80px;
}

.share-modal__copy-btn:hover {
	background-color: #005a87;
}

.share-modal__copy-btn--copied {
	background-color: #28a745;
}

/* Social Buttons */
.share-modal__social {
	margin-bottom: 20px;
}

.share-modal__social-label {
	font-size: 14px;
	font-weight: 500;
	color: #333;
	margin-bottom: 12px;
}

.share-modal__social-buttons {
	display: flex;
	gap: 12px;
	justify-content: center;
}

.share-modal__social-btn {
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s, opacity 0.2s;
}

.share-modal__social-btn:hover {
	transform: scale(1.1);
	opacity: 0.9;
}

.share-modal__social-btn--facebook {
	background-color: #1877f2;
	color: #fff;
}

.share-modal__social-btn--twitter {
	background-color: #000;
	color: #fff;
}

.share-modal__social-btn--whatsapp {
	background-color: #25d366;
	color: #fff;
}

.share-modal__social-btn--email {
	background-color: #666;
	color: #fff;
}

/* Privacy Section */
.share-modal__privacy {
	padding-top: 16px;
	border-top: 1px solid #e0e0e0;
}

.share-modal__privacy label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	margin-bottom: 8px;
}

.share-modal__privacy-select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	background-color: #fff;
}

.share-modal__privacy-warning {
	margin-top: 8px;
	padding: 8px 12px;
	background-color: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	font-size: 13px;
	color: #856404;
}

/* Modal Footer */
.share-modal__footer {
	padding: 16px 20px;
	border-top: 1px solid #e0e0e0;
	text-align: right;
}

.share-modal__btn {
	padding: 10px 20px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s;
}

.share-modal__btn--secondary {
	background-color: #f0f0f0;
	border: 1px solid #ddd;
	color: #333;
}

.share-modal__btn--secondary:hover {
	background-color: #e0e0e0;
}

/* Screen Reader Only */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Mobile Responsive - Share Modal */
@media (max-width: 480px) {
	.travel-plan-share-modal {
		width: 95%;
		margin: 10px;
	}

	.share-modal__header,
	.share-modal__body,
	.share-modal__footer {
		padding: 12px 16px;
	}

	.share-modal__url-wrapper {
		flex-direction: column;
	}

	.share-modal__copy-btn {
		width: 100%;
	}

	.share-modal__social-buttons {
		flex-wrap: wrap;
	}
}

/* ==========================================================================
   Popup Blocked Fallback Styles
   ========================================================================== */

.share-modal__popup-blocked {
	margin-top: 16px;
	padding: 16px;
	background-color: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 8px;
	text-align: center;
}

.share-modal__popup-blocked p {
	margin: 0 0 8px;
	color: #856404;
}

.share-modal__popup-blocked p:first-child {
	font-size: 14px;
}

.share-modal__popup-blocked-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	margin-top: 12px;
}

.share-modal__popup-blocked-actions .share-modal__btn {
	padding: 8px 16px;
	font-size: 13px;
	text-decoration: none;
}

.share-modal__btn--primary {
	background-color: #0073aa;
	color: #fff;
	border: none;
}

.share-modal__btn--primary:hover {
	background-color: #005a87;
	color: #fff;
}

@media (max-width: 480px) {
	.share-modal__popup-blocked-actions {
		flex-direction: column;
	}
}

/* ==========================================================================
   Navigation Apps Section (P1-5)
   ========================================================================== */

.share-modal__navigation {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #e5e7eb;
}

.share-modal__navigation-label {
	font-size: 14px;
	font-weight: 500;
	color: #6b7280;
	margin-bottom: 12px;
}

.share-modal__navigation-buttons {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.share-modal__nav-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #ffffff;
	color: #374151;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
}

.share-modal__nav-btn:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.share-modal__nav-btn:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.share-modal__nav-btn svg {
	flex-shrink: 0;
}

.share-modal__nav-btn--google:hover {
	color: #4285f4;
	border-color: #4285f4;
	background: #f0f7ff;
}

.share-modal__nav-btn--apple:hover {
	color: #000000;
	border-color: #000000;
	background: #f5f5f5;
}

.share-modal__navigation-warning {
	margin-top: 12px;
	padding: 8px 12px;
	background-color: #fef3c7;
	border: 1px solid #f59e0b;
	border-radius: 6px;
	font-size: 13px;
	color: #92400e;
}

.share-modal__navigation-warning strong {
	font-weight: 600;
}

/* Mobile Responsive - Navigation Buttons */
@media (max-width: 480px) {
	.share-modal__navigation-buttons {
		flex-direction: column;
	}

	.share-modal__nav-btn {
		width: 100%;
		justify-content: center;
	}
}

/* ==========================================================================
   Route Export Section (P2-1)
   ========================================================================== */

.share-modal__export {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #e5e7eb;
}

.share-modal__export-label {
	font-size: 14px;
	font-weight: 500;
	color: #6b7280;
	margin-bottom: 12px;
}

.share-modal__export-buttons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.share-modal__export-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #ffffff;
	color: #374151;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
}

.share-modal__export-btn:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.share-modal__export-btn:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.share-modal__export-btn svg {
	flex-shrink: 0;
}

/* GPX Export Button - Green accent */
.share-modal__export-btn--gpx {
	border-color: #10b981;
	color: #047857;
}

.share-modal__export-btn--gpx:hover {
	background: #ecfdf5;
	border-color: #059669;
	color: #047857;
}

/* Google Maps Export Button */
.share-modal__export-btn--google:hover {
	color: #4285f4;
	border-color: #4285f4;
	background: #f0f7ff;
}

/* Apple Maps Export Button */
.share-modal__export-btn--apple:hover {
	color: #000000;
	border-color: #000000;
	background: #f5f5f5;
}

.share-modal__export-note {
	margin: 12px 0 0;
	font-size: 12px;
	color: #6b7280;
	font-style: italic;
}

.share-modal__export-warning {
	margin-top: 12px;
	padding: 8px 12px;
	background-color: #fef3c7;
	border: 1px solid #f59e0b;
	border-radius: 6px;
	font-size: 13px;
	color: #92400e;
}

.share-modal__export-warning strong {
	font-weight: 600;
}

/* Mobile Responsive - Export Buttons */
@media (max-width: 480px) {
	.share-modal__export-buttons {
		flex-direction: column;
	}

	.share-modal__export-btn {
		width: 100%;
		justify-content: center;
	}
}

/* ==========================================================================
   Navigation Links Section (P2-1b - Copy Link + Open buttons)
   ========================================================================== */

.share-modal__nav-links {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e5e7eb;
}

.share-modal__nav-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.share-modal__nav-row:last-child {
	margin-bottom: 0;
}

.share-modal__nav-label {
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	min-width: 95px;
	flex-shrink: 0;
}

.share-modal__nav-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 500;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #ffffff;
	color: #374151;
	cursor: pointer;
	transition: all 0.15s ease;
}

.share-modal__nav-btn:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.share-modal__nav-btn:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Copy Link Button */
.share-modal__nav-btn--copy {
	min-width: 110px;
}

.share-modal__nav-btn--copy .copied-text {
	color: #059669;
}

/* Copied Success State */
.share-modal__nav-btn--copied {
	background: #d1fae5 !important;
	border-color: #10b981 !important;
	color: #047857;
}

/* Open Button - Blue accent */
.share-modal__nav-btn--open {
	background: #eff6ff;
	border-color: #3b82f6;
	color: #1d4ed8;
}

.share-modal__nav-btn--open:hover {
	background: #dbeafe;
	border-color: #2563eb;
}

/* Mobile Responsive - Navigation Links */
@media (max-width: 480px) {
	.share-modal__nav-row {
		flex-wrap: wrap;
	}

	.share-modal__nav-label {
		width: 100%;
		margin-bottom: 6px;
	}

	.share-modal__nav-btn {
		flex: 1;
		justify-content: center;
	}
}