/* WP-ADSB Plugin Styles */

.wp-adsb-wrapper {
	display: flex;
	height: 700px;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	background-color: #e3e3e3;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	width: 100%;
	max-width: 100%;
	margin: 20px auto;
	position: relative;
	gap: 0;
}

#wp-adsb-map {
	width: 100% !important;
	min-width: 100% !important;
	flex-basis: 100% !important;
	height: 100% !important;
	background: #f0f0f0 !important;
	flex-grow: 1 !important;
	flex-shrink: 1 !important;
	position: relative !important;
	z-index: 1 !important;
	display: block !important;
	min-width: 1px !important;
}

#wp-adsb-map .leaflet-container {
	background-color: #e3e3e3;
	z-index: 1;
}

.wp-adsb-map {
	flex: 1;
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
}

.leaflet-container {
	width: 100% !important;
	height: 100% !important;
	background-color: #f0f0f0;
	font-family: 'Helvetica Neue', Arial, sans-serif;
	z-index: 1 !important;
}

.leaflet-tile-pane {
	z-index: 2 !important;
}

.leaflet-marker-pane {
	z-index: 600 !important;
}

.leaflet-popup-pane {
	z-index: 700 !important;
}

/* Polylines e trails */
.leaflet-polyline-pane {
	z-index: 300 !important;
}

.leaflet-polyline {
	stroke: #2196F3 !important;
	stroke-width: 2 !important;
	opacity: 0.6 !important;
	z-index: 300 !important;
	fill: none !important;
}

svg path[fill="#2196F3"],
svg path[stroke="#2196F3"] {
	stroke: #2196F3 !important;
	opacity: 0.6 !important;
	z-index: 300 !important;
}

/* Sidebar */
.wp-adsb-sidebar {
	width: 350px;
	background-color: #fff;
	border-left: 1px solid #ddd;
	display: none !important;
	flex: 0 0 0 !important;
	flex-direction: column;
	max-height: 100%;
	box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
	z-index: 2;
}

.wp-adsb-sidebar.active {
	display: flex !important;
	flex: 0 0 350px !important;
}

.wp-adsb-sidebar-header {
	padding: 15px;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: #f9f9f9;
}

.wp-adsb-sidebar-header h3 {
	margin: 0;
	font-size: 16px;
	color: #333;
}

.wp-adsb-sidebar-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 3px;
	transition: background-color 0.2s;
}

.wp-adsb-sidebar-close:hover {
	background-color: #eee;
	color: #000;
}

.wp-adsb-sidebar-content {
	flex: 1;
	overflow-y: auto;
	padding: 15px;
}

.wp-adsb-info-item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 13px;
}

.wp-adsb-info-item:last-child {
	border-bottom: none;
}

.wp-adsb-info-item .label {
	font-weight: 600;
	color: #555;
	min-width: 130px;
	flex-shrink: 0;
}

.wp-adsb-info-item .value {
	color: #333;
	word-break: break-word;
	text-align: right;
	flex: 1;
	margin-left: 10px;
}

.wp-adsb-info-item .value.empty {
	color: #999;
	font-style: italic;
}

/* Markers */
.wp-adsb-aircraft-marker {
	width: 35px !important;
	height: 32px !important;
	background-size: contain !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	cursor: pointer !important;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)) !important;
	transition: filter 0.2s, transform 0.2s !important;
	visibility: visible !important;
	opacity: 1 !important;
	display: block !important;
	transform: scale(1) !important;
}

.wp-adsb-aircraft-marker svg {
	width: 100% !important;
	height: 100% !important;
	visibility: visible !important;
	opacity: 1 !important;
	display: block !important;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
}

.wp-adsb-aircraft-marker:hover {
	filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)) !important;
	z-index: 1000 !important;
	transform: scale(1.15) !important;
}

.wp-adsb-aircraft-marker.selected {
	filter: drop-shadow(0 0 10px rgba(255, 152, 0, 0.9)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)) !important;
	transform: scale(1.2) !important;
}

/* Popup */
.wp-adsb-popup {
	font-size: 12px;
	min-width: 150px;
}

.wp-adsb-popup-title {
	font-weight: 600;
	margin-bottom: 5px;
	color: #333;
}

.wp-adsb-popup-info {
	color: #666;
	line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
	.wp-adsb-wrapper {
		flex-direction: column;
		height: 500px;
	}

	.wp-adsb-sidebar {
		position: absolute;
		width: 100%;
		height: 50%;
		border-left: none;
		border-top: 1px solid #ddd;
		bottom: 0;
		left: 0;
		right: 0;
		transform: translateY(100%);
		border-radius: 8px 8px 0 0;
	}

	.wp-adsb-sidebar.active {
		transform: translateY(0);
	}

	.wp-adsb-map {
		height: 100%;
	}
}

@media (max-width: 480px) {
	.wp-adsb-wrapper {
		height: 400px;
	}

	.wp-adsb-sidebar {
		height: 60%;
	}

	.wp-adsb-sidebar-content {
		padding: 10px;
	}

	.wp-adsb-info-item {
		font-size: 12px;
	}

	.wp-adsb-info-item .label {
		min-width: 100px;
	}
}

/* Loading state */
.wp-adsb-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(255, 255, 255, 0.9);
	padding: 20px 30px;
	border-radius: 4px;
	text-align: center;
	z-index: 500;
}

.wp-adsb-loading::after {
	content: '';
	display: block;
	width: 20px;
	height: 20px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #3498db;
	border-radius: 50%;
	animation: wp-adsb-spin 1s linear infinite;
	margin: 10px auto 0;
}

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

/* Error state */
.wp-adsb-error {
	padding: 20px;
	background-color: #fee;
	color: #c33;
	border: 1px solid #fcc;
	border-radius: 4px;
	margin: 10px;
}

/* SVG rendering fixes */
.leaflet-marker-icon {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.leaflet-marker-icon img,
.leaflet-marker-icon svg {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	width: 100% !important;
	height: 100% !important;
}

/* Trail polyline rendering */
.leaflet-polyline-pane svg {
	visibility: visible !important;
	display: block !important;
	opacity: 1 !important;
}

.leaflet-polyline-pane polyline {
	visibility: visible !important;
	opacity: 0.6 !important;
	stroke: #2196F3 !important;
	stroke-width: 2 !important;
	fill: none !important;
}

/* Ensure all Leaflet panes are visible */
.leaflet-pane {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	z-index: inherit !important;
}

.leaflet-objects-pane {
	z-index: 400 !important;
}

/* Additional marker icon styling */
img.leaflet-marker-icon {
	max-width: none !important;
	max-height: none !important;
}
