/**
 * ========================================
 * LOCKERS NEW CSS - Responsive & Modern
 * ========================================
 * - Flexbox layout pentru responsive design
 * - Mobile-first approach
 * - Smooth animations
 * - Optimizat pentru performanță
 */

/* ============= LIGHTBOX CONTAINER ============= */
#lightbox_iframe{
	width: 90%;
}
.lightboxmap {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	background-color: rgba(0, 0, 0, 0.85);
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Container principal */
.container_lightbox {
	width: 100%;
	max-width: 1400px;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	position: relative;
	max-height: 90vh;
	max-height: 90dvh;
	display: flex;
	flex-direction: column;
}

/* Buton închidere */
.container_lightbox > p {
	margin: 0;
	padding: 15px 20px 0;
	background: #fff;
	position: sticky;
	top: 0;
	z-index: 10;
}

.container_lightbox > p i {
	font-size: 24px;
	cursor: pointer;
	color: #333;
	transition: color 0.2s ease, transform 0.2s ease;
}

.container_lightbox > p i:hover {
	color: #e74c3c;
	transform: scale(1.1);
}

/* ============= CONTAINER HARTĂ + SIDEBAR ============= */

.container-map {
	display: flex;
	flex-direction: row;
	height: calc(90vh - 60px);
	height: calc(90dvh - 60px);
	position: relative;
	overflow: hidden;
	min-height: 0;
}

/* ============= SIDEBAR ============= */

.sidebar {
	width: 380px;
	max-width: 100%;
	background: #f8f9fa;
	border-right: 1px solid #e0e0e0;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	flex-shrink: 0;
	transition: transform 0.3s ease;
}

.sidebar.loading {
	opacity: 0.6;
	pointer-events: none;
}

.sidebar.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #3498db;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	z-index: 100;
}

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

/* Header sidebar */
.heading {
	padding: 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	margin-top: 0;
}

.heading h1 {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
}

/* ============= FILTRE ȘI SELECTOARE ============= */

.selects_container {
	padding: 10px;
	background: #fff;
	/* border-bottom: 1px solid #e0e0e0; */
}

.select_county,
.select_city {
	margin-bottom: 15px;
}

.select_county select,
.select_city select {
	width: 100%;
	padding: 12px 15px;
	font-size: 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select_county select:focus,
.select_city select:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Select2 override pentru consistență */
.select2-container--default .select2-selection--single {
	height: 44px;
	border: 1px solid #ddd;
	border-radius: 6px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 42px;
	padding-left: 15px;
	color: #333;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 42px;
}

/* ============= FILTRE CURIERI ============= */

.courier_filters {
	margin-top: 15px;
	padding: 15px;
	background-color: #f9f9f9;
	border-radius: 6px;
	border: 1px solid #e0e0e0;
}

.courier_filters_title {
	font-weight: 600;
	margin-bottom: 12px;
	font-size: 14px;
	color: #333;
}

.courier_checkboxes {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.courier-checkbox-wrapper {
	display: flex;
	align-items: center;
	padding: 8px 10px;
	border-radius: 4px;
	transition: background-color 0.2s ease;
	cursor: pointer;
}

.courier-checkbox-wrapper:hover {
	background-color: #e8eaf6;
}

.courier-checkbox-wrapper input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	margin-right: 10px;
	flex-shrink: 0;
}

.courier-checkbox-wrapper label {
	font-size: 14px;
	color: #333;
	cursor: pointer;
	user-select: none;
	flex: 1;
	margin: 0;
}

/* ============= SEARCH ============= */

.search_all {
	padding: 0 20px 20px;
	background: #fff;
}

.search_container {
	position: relative;
}

.form_search_location {
	width: 100%;
	padding: 12px 45px 12px 15px;
	font-size: 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form_search_location:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.loop_icon {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	color: #999;
	pointer-events: none;
}

.loop_icon i {
	font-size: 16px;
}

/* ============= LISTINGS (Listă locații) ============= */

.listings {
	flex: 1;
	overflow-y: auto;
	padding: 10px 0;
	min-height: 150px;
}

.listings .item {
	padding: 15px 20px;
	border-bottom: 1px solid #e0e0e0;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.listings .item:hover {
	background-color: #f0f4ff;
}

.listings .item.active {
	background-color: #e8eaf6;
	border-left: 4px solid #667eea;
}

.listings .item .title_box {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: #333;
	margin-bottom: 8px;
	text-decoration: none;
	transition: color 0.2s ease;
}

.listings .item .title_box:hover {
	color: #667eea;
}

.listings .item .details {
	font-size: 13px;
	color: #666;
	line-height: 1.6;
}

.listings .item .details strong {
	color: #333;
}

/* ============= HARTĂ ============= */

.map {
	flex: 1;
	position: relative;
	min-height: 400px;
}

.map,
#map-div {
	min-height: 0;
}

#map-div {
	width: 100%;
	height: 100%;
}

/* ============= MARKERE HARTĂ ============= */

.marker {
	background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iNDUiIHZpZXdCb3g9IjAgMCAzMCA0NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTUgMEM2LjcxNTczIDAgMCA2LjcxNTczIDAgMTVDMCAyNi4yNSAxNSA0NSAxNSA0NUMxNSA0NSAzMCAyNi4yNSAzMCAxNUMzMCA2LjcxNTczIDIzLjI4NDMgMCAxNSAwWiIgZmlsbD0iIzExYjRkYSIvPjxjaXJjbGUgY3g9IjE1IiBjeT0iMTUiIHI9IjciIGZpbGw9IndoaXRlIi8+PC9zdmc+');
	background-size: contain;
	background-repeat: no-repeat;
	width: 30px;
	height: 45px;
	cursor: pointer;
	transition: transform 0.2s ease;
}

.marker:hover {
	transform: scale(1.1);
}

.marker-favorite {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='45' viewBox='0 0 30 45'><path d='M15 0C6.71573 0 0 6.71573 0 15C0 26.25 15 45 15 45C15 45 30 26.25 30 15C30 6.71573 23.2843 0 15 0Z' fill='%2311b4da'/><circle cx='15' cy='15' r='7' fill='white'/></svg>");
	background-size: contain;
	background-repeat: no-repeat;
	width: 35px;
	height: 52px;
	cursor: pointer;
	/* Do not animate transform here: Mapbox uses transform for marker placement. */
	animation: pulseGlow 1.8s infinite;
}

.marker-favorite--sameday {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='45' viewBox='0 0 30 45'><path d='M15 0C6.71573 0 0 6.71573 0 15C0 26.25 15 45 15 45C15 45 30 26.25 30 15C30 6.71573 23.2843 0 15 0Z' fill='%2300A651'/><circle cx='15' cy='15' r='7' fill='white'/></svg>");
}

.marker-favorite--fanbox {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='45' viewBox='0 0 30 45'><path d='M15 0C6.71573 0 0 6.71573 0 15C0 26.25 15 45 15 45C15 45 30 26.25 30 15C30 6.71573 23.2843 0 15 0Z' fill='%23E30613'/><circle cx='15' cy='15' r='7' fill='white'/></svg>");
}

.marker-favorite--default {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='45' viewBox='0 0 30 45'><path d='M15 0C6.71573 0 0 6.71573 0 15C0 26.25 15 45 15 45C15 45 30 26.25 30 15C30 6.71573 23.2843 0 15 0Z' fill='%2311b4da'/><circle cx='15' cy='15' r='7' fill='white'/></svg>");
}

@keyframes pulseGlow {
	0%,
	100% {
		filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0.15));
	}
	50% {
		filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.3));
	}
}

/* ============= POPUP HARTĂ ============= */

.mapboxgl-popup-content {
	padding: 0;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	min-width: 280px;
	max-width: 350px;
}

.locker-popup {
	padding: 0;
}

.popup-title {
    margin: 0;
    padding: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.popup-details {
	padding: 15px;
	background: #fff;
}

.popup-row {
	font-size: 13px;
	color: #666;
	margin-bottom: 3px;
	line-height: 1.5;
}

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

.popup-row strong {
	color: #333;
	font-weight: 600;
}

.popup-actions {
	padding: 5px;
	background: #f8f9fa;
	text-align: center;
	border-radius: 0 0 8px 8px;
}

.btn-popup-select {
    padding: 7px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-popup-select:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-popup-select:active {
	transform: translateY(0);
}

/* Stil pentru cluster popup (compatibilitate cu versiunea veche) */
.btn_popup {
	display: inline-block;
	padding: 10px 25px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn_popup:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============= MAPBOX CONTROLS ============= */

.mapboxgl-ctrl-top-right {
	top: 10px;
	right: 10px;
}

.mapboxgl-ctrl-bottom-right {
	bottom: 30px;
	right: 10px;
}

.mapboxgl-ctrl-group {
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ============= RESPONSIVE DESIGN ============= */

/* Tablets (landscape și portrait) */
@media (max-width: 1024px) {
	.container_lightbox {
		max-width: 95%;
		max-height: 95vh;
		max-height: 95dvh;
	}

	.sidebar {
		width: 320px;
	}

	.heading h1 {
		font-size: 20px;
	}
}

/* Tablets (portrait) și Mobile (landscape) */
@media (max-width: 768px) {
	.listings{
		overflow: visible;
	}
	.lightboxmap {
		padding: 10px;
	}

	.container_lightbox {
		max-width: 100%;
		max-height: 95vh;
		max-height: 95dvh;
		border-radius: 8px;
	}

	.container-map {
		flex-direction: column;
		height: calc(95vh - 50px);
		height: calc(95dvh - 50px);
	}

	.sidebar {
		width: 100%;
		max-height: 40%;
		border-right: none;
		border-bottom: 1px solid #e0e0e0;
		flex-shrink: 0;
	}

	.map {
		flex: 1;
		min-height: 300px;
	}

	.heading {
		padding: 15px;
	}

	.heading h1 {
		font-size: 18px;
	}

	.selects_container {
		padding: 15px;
	}

	.search_all {
		padding: 0 15px 15px;
	}

	.listings .item {
		padding: 12px 15px;
	}

	.mapboxgl-popup-content {
		min-width: 250px;
	}
}

/* Mobile (portrait) */
@media (max-width: 480px) {
	.lightboxmap {
		padding: 5px;
	}

	.container_lightbox {
		border-radius: 6px;
		max-height: 98vh;
		max-height: 98dvh;
	}

	.container_lightbox > p {
		padding: 10px 15px 0;
	}

	.container_lightbox > p i {
		font-size: 20px;
	}

	.container-map {
		height: calc(98vh - 45px);
		height: calc(98dvh - 45px);
	}

	.sidebar {
		max-height: 45%;
	}

	.heading {
		padding: 12px 15px;
	}

	.heading h1 {
		font-size: 16px;
	}

	.selects_container {
		padding: 12px;
	}

	.select_county select,
	.select_city select,
	.form_search_location {
		padding: 10px 12px;
		font-size: 13px;
	}

	.form_search_location {
		padding-right: 40px;
	}

	.courier_filters {
		padding: 12px;
	}

	.courier_filters_title {
		font-size: 13px;
	}

	.courier-checkbox-wrapper {
		padding: 6px 8px;
	}

	.courier-checkbox-wrapper label {
		font-size: 13px;
	}

	.search_all {
		padding: 0 12px 12px;
	}

	.listings .item {
		padding: 10px 12px;
	}

	.listings .item .title_box {
		font-size: 14px;
	}

	.listings .item .details {
		font-size: 12px;
	}

	.map {
		min-height: 250px;
	}

	.marker {
		width: 25px;
		height: 37px;
	}

	.marker-favorite {
		width: 30px;
		height: 44px;
	}

	.mapboxgl-popup-content {
		min-width: 220px;
		max-width: 280px;
	}

	.popup-title {
		font-size: 12px;
		padding: 5px;
	}

	.popup-details {
		padding: 5px;
	}

	.popup-row {
		font-size: 12px;
		margin-bottom: 6px;
	}

	.btn-popup-select {
		padding: 10px 20px;
		font-size: 13px;
	}
}

/* Mobile foarte mic */
@media (max-width: 360px) {
	.sidebar {
		max-height: 50%;
	}

	.heading h1 {
		font-size: 15px;
	}

	.listings .item .title_box {
		font-size: 13px;
	}

	.listings .item .details {
		font-size: 11px;
	}
}

/* ============= SCROLLBAR STYLING ============= */

.sidebar::-webkit-scrollbar,
.listings::-webkit-scrollbar {
	width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.listings::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
.listings::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.listings::-webkit-scrollbar-thumb:hover {
	background: #999;
}

/* ============= LOADING MODAL OVERLAY ============= */

.loading_modal {
	position: relative;
	pointer-events: none;
	opacity: 0.7;
}

.loading_modal::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.8);
	z-index: 1000;
}

.loading_modal::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 50px;
	height: 50px;
	border: 5px solid #f3f3f3;
	border-top: 5px solid #667eea;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	z-index: 1001;
}

/* ============= UTILITY CLASSES ============= */

.d-none {
	display: none !important;
}

.mg-top-20 {
	margin-top: 20px;
}

/* ============= PRINT STYLES ============= */

@media print {
	.lightboxmap {
		display: none !important;
	}
}

/* ============= ACCESSIBILITY ============= */

/* Focus visible pentru keyboard navigation */
.select_county select:focus-visible,
.select_city select:focus-visible,
.form_search_location:focus-visible,
.courier-checkbox-wrapper input:focus-visible,
.btn-popup-select:focus-visible {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

/* Reduce motion pentru utilizatori cu preferințe de accesibilitate */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
