/* CSS organizat cu BEM methodology */
html,
body {
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	position: relative;
}

#map {
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
}

/* Grass strip component */
.grass-strip {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100px;
	background-image: url("/images/banda_iarba4.png");
	background-repeat: repeat-x;
	background-size: auto 100%;
	background-position: bottom;
	z-index: 999;
	pointer-events: none;
}

/* Logo component */
.logo-container {
	background: none !important;
	padding: 0 !important;
	border: none !important;
	box-shadow: none !important;
	margin: 5px;
}

.logo-container__image {
	width: 100px;
	height: auto;
	display: block;
}

.logo-container__image:hover {
	transform: scale(1.2);
}

/* Legend component */
.legend-container {
	background: rgba(255, 255, 255, 0);
	padding: 15px;
	border-radius: 1px;
	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
	font-family: "Arial", sans-serif;
	min-width: 120px;
}

.legend-container__title {
	margin: 0 0 5px 0;
	color: #2c3e50;
	font-size: 14px;
	border-bottom: 1px solid #ecf0f1;
	padding-bottom: 8px;
}

.legend-container__items {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 4px 0;
}

.legend-item__icon {
	width: 24px;
	height: 24px;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(12, 212, 45, 0.1);
}

.legend-item__label {
	color: #34495e;
	font-size: 12px;
	line-height: 1;
}

.legend-item:hover {
	background: #47c73b;
	cursor: pointer;
	border-radius: 4px;
}

/* Tooltip component */
.tooltip--custom {
	font-size: 12px;
	font-weight: bold;
	color: white;
	background: #0d730d;
	border: none;
	padding: 6px 10px;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
	text-align: center;
	white-space: nowrap;
}
/* Filter Button Component - Scroll Fix */
.filter-control {
	position: fixed;
	bottom: 80px;
	right: 15px;
	z-index: 1000;
	font-family: "Arial", sans-serif;
}

.filter-control__button {
	background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
	color: white;
	border: none;
	border-radius: 8px;
	padding: 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 52px;
	height: 52px;
	position: relative;
	overflow: hidden;
}

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

.filter-control__button:hover::before {
	left: 100%;
}

.filter-control__button:hover {
	background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
	transform: translateY(-3px) scale(1.05);
	box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.filter-control__button:active {
	transform: translateY(-1px) scale(1.02);
	box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.filter-control__logo {
	position: relative;
	width: 24px;
	height: auto;
	margin-bottom: 0;
	filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
	opacity: 0.9;
	transition: transform 0.3s ease;
}

.filter-control__button:hover .filter-control__logo {
	transform: scale(1.1);
}

.filter-control__badge {
	position: absolute;
	top: -1px;
	right: -1px;
	background: #48484e;
	color: white;
	border-radius: 10px;
	padding: 2px 6px;
	font-size: 9px;
	font-weight: bold;
	min-width: 15px;
	height: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid white;
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Panel cu scroll fix */
.filter-control__panel {
	position: absolute;
	bottom: 70px;
	right: 0;
	background: white;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	width: 350px;
	max-height: 500px;
	/* ELIMINAT: overflow: hidden - aceasta era problema principala */
	display: flex;
	flex-direction: column;
	transform: translateY(20px) scale(0.95);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-control__panel--active {
	transform: translateY(0) scale(1);
	opacity: 1;
	visibility: visible;
}

.filter-control__header {
	background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
	color: white;
	padding: 20px;
	font-weight: 600;
	font-size: 16px;
	text-align: center;
	position: relative;
	flex-shrink: 0; /* Nu se contracta */
}

.filter-control__header::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #4CAF50, #81C784, #4CAF50);
}

.filter-control__filters {
	padding: 15px;
	border-bottom: 1px solid #f0f0f0;
	background: #fafafa;
	flex-shrink: 0; /* Nu se contracta */
}

.filter-control__filter-row {
	display: flex;
	gap: 10px;
	margin-bottom: 10px;
}

.filter-control__filter-row:last-child {
	margin-bottom: 0;
}

.filter-control__search-input,
.filter-control__county-select {
	flex: 1;
	padding: 10px 14px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 14px;
	outline: none;
	transition: all 0.3s ease;
	background: white;
}

.filter-control__search-input:focus,
.filter-control__county-select:focus {
	border-color: #4CAF50;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.filter-control__county-select {
	cursor: pointer;
}

.filter-control__clear-btn {
	background: #f44336;
	color: white;
	border: none;
	border-radius: 8px;
	padding: 10px 14px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	transition: all 0.3s ease;
}

.filter-control__clear-btn:hover {
	background: #d32f2f;
	transform: scale(1.05);
}

.filter-control__stats {
	background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
	color: white;
	padding: 12px 15px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0; /* Nu se contracta */
}

.filter-control__county-count {
	font-size: 11px;
	opacity: 0.9;
}

/* Lista cu scroll îmbunătățit */
.filter-control__list {
	flex: 1; /* Ocupa tot spatiul ramas disponibil */
	min-height: 0; /* Permite contractarea */
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0;
	margin: 0;
	list-style: none;
	/* Padding jos pentru a asigura că ultima opțiune este vizibilă */
	padding-bottom: 10px;
}

/* Scrollbar îmbunătățit */
.filter-control__list::-webkit-scrollbar {
	width: 8px;
}

.filter-control__list::-webkit-scrollbar-track {
	background: #f8f8f8;
	border-radius: 4px;
	margin: 5px 0;
}

.filter-control__list::-webkit-scrollbar-thumb {
	background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
	border-radius: 4px;
	border: 1px solid rgba(255,255,255,0.3);
}

.filter-control__list::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

/* Firefox scrollbar */
.filter-control__list {
	scrollbar-width: thin;
	scrollbar-color: #4CAF50 #f8f8f8;
}

.filter-control__item {
	padding: 14px 20px;
	border-bottom: 1px solid #f5f5f5;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 14px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: relative;
}

.filter-control__item:hover {
	background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
	transform: translateX(5px);
}

.filter-control__item:active {
	background: #c8e6c9;
}

.filter-control__item:last-child {
	border-bottom: none;
	/* Margin jos pentru a asigura vizibilitatea */
	margin-bottom: 5px;
}

.filter-control__item-name {
	font-weight: 500;
	color: #2e7d32;
}

.filter-control__item-county {
	font-size: 12px;
	color: #666;
	background: #e8f5e8;
	padding: 2px 8px;
	border-radius: 12px;
	font-weight: 500;
}

.filter-control__empty {
	padding: 40px 20px;
	text-align: center;
	color: #999;
	font-style: italic;
	font-size: 14px;
}

.filter-control__loading {
	padding: 40px 20px;
	text-align: center;
	color: #4CAF50;
	font-weight: 600;
}

/* Responsive controls adaptate la mobile */
@media (max-width: 768px) {
	.filter-control {
		bottom: 45px;
		right: 10px;
	}

	.filter-control__button {
		width: 50px;
		height: 50px;
		padding: 12px;
	}

	.filter-control__logo {
		width: 20px;
		margin-bottom: 0;
	}

	.filter-control__badge {
		top: -3px;
		right: -3px;
		padding: 3px 6px;
		font-size: 10px;
		min-width: 18px;
		height: 18px;
	}

	.filter-control__panel {
		width: 320px;
		max-height: 450px;
	}

	.filter-control__filter-row {
		flex-direction: column;
		gap: 8px;
	}

	.filter-control__clear-btn {
		padding: 8px 12px;
	}

	/* Lista cu mai mult spațiu pe mobile */
	.filter-control__list {
		padding-bottom: 15px;
	}
}

/* Viewport optimization pentru mobile */
@media (max-width: 480px) {
	.filter-control {
		bottom: 35px;
		right: 8px;
	}

	.filter-control__button {
		width: 45px;
		height: 45px;
		padding: 10px;
	}

	.filter-control__logo {
		width: 18px;
		margin-bottom: 0;
	}

	.filter-control__badge {
		top: -2px;
		right: -2px;
		padding: 2px 5px;
		font-size: 9px;
		min-width: 16px;
		height: 16px;
	}

	.filter-control__panel {
		width: 300px;
		max-height: 400px;
	}

	.filter-control__filter-row {
		flex-direction: column;
		gap: 6px;
	}

	.filter-control__clear-btn {
		padding: 6px 10px;
		font-size: 11px;
	}

	/* Spațiu suplimentar pentru ultima opțiune pe mobile */
	.filter-control__list {
		padding-bottom: 20px;
	}
}

	/* Gesture support îmbunătățit */
	.leaflet-container {
		-webkit-touch-callout: none;
		-webkit-user-select: none;
		-khtml-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
	}
