/* Glassmorphism Sidebar & Panels */

/* Supprimer les contours de focus par défaut du navigateur */
button:focus,
button:focus-visible,
input:focus,
textarea:focus,
select:focus,
a:focus {
	outline: none !important;
	box-shadow: none !important;
}

/* Login/Logout Button - Integrated in Sidebar Container */
.glass-auth-btn {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 1100;
	width: 52px;
	height: 52px;
	background: #1e1f24;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid #1e1f24;
	border-radius: 10px;
	color: #e4e4e4;
	font-size: 18px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.glass-auth-btn:hover {
	transform: scale(1.05);
}

/* When logged in, change to red logout button and round only top corners */
.glass-auth-btn.logged-in {
	color: rgb(255, 50, 13);
	border-radius: 10px 10px 0 0;
	border-bottom: none;
}

.glass-auth-btn.logged-in:hover {
		transform: none;
}

/* Tooltip for auth button */
.glass-auth-btn::after {
	content: attr(title);
	position: absolute;
	right: 70px;
	background: #1e1f24;
	color: white;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 15px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 1001;
}

.glass-auth-btn:hover::after {
	opacity: 1;
}

.glass-sidebar {
	position: fixed;
	right: 20px;
	top: 71px;
	z-index: 1200;
	background: #1e1f24;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-top: none;
	border-radius: 0 0 10px 10px;
	padding: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	display: none; /* Caché par défaut, affiché en mode admin */
	flex-direction: column;
	gap: 12px;
	width: 52px;
	align-items: center;
}

.glass-icon-btn {
	width: 38px;
	height: 38px;
	/* background: rgba(88, 101, 242, 0.2); */
	/* backdrop-filter: blur(5px); */
	/* border: 1px solid rgba(88, 101, 242, 0.3); */
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-light);
	font-size: 16px;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
}

.glass-icon-btn:hover {
	color: #feae00;
	/* background: rgba(88, 101, 242, 0.4); */
	transform: scale(1.1);
	/* box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3); */
}

.glass-icon-btn.active {
	background: #feae00;
	color: black;
}

.glass-icon-btn i {
	pointer-events: none;
}

/* Tooltip */
.glass-icon-btn::after {
	content: attr(data-tooltip);
	position: absolute;
	right: 70px;
	background: #1e1f24;
	color: white;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 1001;
}

.glass-icon-btn:hover::after {
	opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
	.glass-sidebar {
		left: 10px;
		padding: 10px 8px;
		gap: 10px;
	}
	
	.glass-icon-btn {
		width: 45px;
		height: 45px;
		font-size: 18px;
	}
}

/* Login Modal Glassmorphism Styles */
.modal-backdrop.show {
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	background-color: #1e1f24 !important;
}

.modern-login-modal {
	background: linear-gradient(0deg, rgba(0, 0, 0,.3) 10%, #171a1f 40%), #171a1f;	-webkit-backdrop-filter: blur(20px);
	border-radius: 24px !important;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
	color: #e4e4e4;
	padding: 0;
	position: relative;
	max-width: 400px;
	margin: 0 auto;
	overflow: hidden;
}

.modern-login-modal .modal-body {
	padding: 40px 40px 10px 40px;
	background: transparent;
}

.login-title {
	color: #d8d8d8;
	font-size: 30px;
	letter-spacing: 1px;
	font-weight: 700;
	text-align: center;
	margin-bottom: 40px;
	margin-top: 0;
}

.modern-input-group {
	position: relative;
	margin-bottom: 20px;
}

.input-icon {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: #6e7787;
	font-size: 16px;
	z-index: 1;
}

.modern-input {
	width: 100%;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	background: #1b1e24f5;
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #d8d8d8;
	border-radius: 12px;
	padding: 16px 18px 16px 50px;
	font-size: 15px;
	transition: all 0.3s ease;
	outline: none;
}

/* Supprimer le style par défaut de l'autocomplete du navigateur */
.modern-input:-webkit-autofill,
.modern-input:-webkit-autofill:hover,
.modern-input:-webkit-autofill:focus,
.modern-input:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 1000px #1b1e24f5 inset !important;
	-webkit-text-fill-color: #d8d8d8 !important;
	background-color: #1b1e24f5 !important;
	background-clip: content-box !important;
	transition: background-color 5000s ease-in-out 0s;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modern-input::placeholder {
	color: #6e7787;
}


.modern-input:focus,
.modern-select:focus,
.modern-textarea:focus {
	border-color: #feae00;
	box-shadow: 0 0 0 3px rgba(254, 174, 0, 0.1);
}

.modern-input-group:focus-within .input-icon {
	/* color: #feae00; */
}

.modern-alert {
	background: rgba(220, 53, 69, 0.15);
	border: 1px solid rgba(220, 53, 69, 0.3);
	color: #b82121;
	border-radius: 12px;
	padding: 12px 16px;
	font-size: 14px;
	margin-top: 20px;
}

.modern-login-btn {
	width: 100%;
	background: transparent;
	border: none;
	border-radius: 0 0 24px 24px;
	padding: 10px 16px 24px 16px;
	font-size: 16px;
	font-weight: 600;
	color: #ffffff;
	cursor: pointer;
	transition: background-position 0.6s ease, transform 0.3s ease;
	margin: 0;
	position: relative;
	text-align: center;
	outline: none !important;
}

.modern-login-btn:hover {
	color: #feae00;
}

.modern-login-btn:focus {
	outline: none !important;
	box-shadow: none !important;
}

.login-btn-text {
	display: inline-block;
	transition: transform 0.3s ease;
}

.modern-login-btn:active {
	transform: translateY(0);
}

#loginModal .modal-dialog {
	max-width: 400px;
}

/* Region Creation Modal - Modern Style */
.modern-region-modal {
	background: linear-gradient(0deg, rgba(0, 0, 0,.3) 10%, #171a1f 40%), #171a1f;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-radius: 24px !important;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
	color: #e4e4e4;
	padding: 0;
	position: relative;
	max-width: 500px;
	margin: 0 auto;
	overflow: hidden;
}

/* Ensure modals appear above region manager overlay */
#editRegionModal.modal {
	z-index: 10500 !important;
}

#editRegionModal .modal-backdrop {
	z-index: 10450 !important;
}

.modern-region-modal .modal-body {
	padding: 40px 40px 20px 40px;
	background: transparent;
}

.region-title {
	color: #d8d8d8;
	font-size: 28px;
	letter-spacing: 1px;
	font-weight: 700;
	text-align: center;
	margin-bottom: 30px;
	margin-top: 0;
}

.modern-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-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='%236e7787' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 18px center;
	padding-right: 45px !important;
	cursor: pointer;
	width: 100%;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	background-color: #1b1e24f5;
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #d8d8d8;
	border-radius: 12px;
	padding: 16px 18px 16px 50px;
	font-size: 15px;
	transition: all 0.3s ease;
	outline: none;
}

.modern-select option {
	background: #1b1e24;
	color: #d8d8d8;
	padding: 10px;
}

.modern-textarea {
	resize: vertical;
	min-height: 80px;
	font-family: inherit;
	line-height: 1.5;
	width: 100%;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	background: #1b1e24f5;
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #d8d8d8;
	border-radius: 12px;
	padding: 16px 18px 16px 50px;
	font-size: 15px;
	transition: all 0.3s ease;
	outline: none;
}

.modern-textarea::placeholder {
	color: #6e7787;
}

.modern-color {
	padding: 8px 18px 8px 50px !important;
	height: 50px;
	cursor: pointer;
}

.color-label {
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: #6e7787;
	font-size: 14px;
	pointer-events: none;
}

.modern-modal-footer {
	display: flex;
	gap: 12px;
	padding: 0 40px 30px 40px;
	background: transparent;
}

.modern-cancel-btn,
.modern-validate-btn {
	flex: 1;
	padding: 14px 24px;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.modern-cancel-btn {
	background: #b82121;
	color: #1b1e24;
}

.modern-cancel-btn:hover {
	transform: scale(0.95);
}

.modern-validate-btn {
	background: linear-gradient(135deg, #feae00, #ff8c00);
	color: #1b1e24;
	border: 1px solid transparent;
}

.modern-validate-btn:hover {
	transform: scale(0.95);
}

/* Confirmation Modal - Icon and Text */
.confirm-icon {
	width: 80px;
	height: 80px;
	margin: 0 auto 25px;
	background: linear-gradient(145deg, rgba(254, 174, 0, 0.2), rgba(254, 174, 0, 0.1));
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid rgba(254, 174, 0, 0.3);
}

.confirm-icon i {
	font-size: 36px;
	color: #feae00;
}

.modern-modal-text {
	font-size: 16px;
	color: rgba(255, 255, 255, 0.8);
	text-align: center;
	margin: 0 0 20px 0;
	line-height: 1.6;
}

.modern-validate-btn:hover {
	transform: scale(0.95);
}

.modern-cancel-btn:active,
.modern-validate-btn:active {
	transform: translateY(0);
}

#regionCreationModal .modal-dialog {
	max-width: 500px;
}

/* Confirm Cancel Modal - Compact Style */
.modern-confirm-modal .modal-dialog {
	max-width: 400px;
}

/* Larger modal for edit info confirmation */
#confirmEditInfoModal .modal-dialog {
	max-width: 520px;
}

.modern-confirm-modal .modern-modal-content {
	background: linear-gradient(0deg, rgba(0, 0, 0,.3) 10%, #171a1f 40%), #171a1f;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-radius: 20px !important;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
	color: #e4e4e4;
	padding: 30px;
	position: relative;
	overflow: hidden;
	text-align: center;
}

.modern-confirm-modal .modal-body {
	padding: 0;
	background: transparent;
	text-align: center;
}

.confirm-icon {
	width: 60px;
	height: 60px;
	margin: 0 auto 20px;
	background: rgba(254, 174, 0, 0.15);
	border: 2px solid rgba(254, 174, 0, 0.3);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	color: #feae00;
}

.modern-modal-title {
	color: #e4e4e4;
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 10px 0;
}

.modern-modal-text {
	color: #a0a0a0;
	font-size: 14px;
	margin: 0 0 25px 0;
}

.modern-confirm-modal .modern-modal-footer {
	padding: 0;
	margin-top: 25px;
	display: flex;
	gap: 10px;
	justify-content: center;
}

.modern-modal-cancel,
.modern-modal-validate {
	flex: 1;
	padding: 12px 24px;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.modern-modal-cancel {
	background: rgba(255, 255, 255, 0.08);
	color: #e4e4e4;
	border: 1px solid rgba(255, 255, 255, 0.15);
}

.modern-modal-cancel:hover {
	background: rgba(255, 255, 255, 0.12);
	transform: translateY(-2px);
}

.modern-modal-validate {
	background: linear-gradient(135deg, #feae00 0%, #ff8c00 100%);
	color: #000;
	font-weight: 700;
	box-shadow: 0 4px 15px rgba(254, 174, 0, 0.3);
}

.modern-modal-validate:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(254, 174, 0, 0.4);
}

/* Drawing Toolbar - Top Bar */
.glass-drawing-toolbar {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1100;
	background: #1e1f24;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	padding: 0;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	display: none;
	flex-direction: column;
	gap: 0;
	opacity: 0;
	animation: slideDown 0.3s ease forwards;
}

.glass-drawing-toolbar.active {
	display: flex;
}

.toolbar-title {
	color: #e4e4e4;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	padding: 12px 20px 10px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 20px rgba(254, 174, 0, 0.3);
	letter-spacing: 0.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	flex-shrink: 0;
}

.toolbar-content {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 15px;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

.toolbar-btn {
	background: transparent;
	border: 1px solid transparent;
	border-radius: 8px;
	position: relative;
	color: #e4e4e4;
	padding: 10px 15px;
	font-size: 16px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 40px;
	justify-content: center;
}

.toolbar-btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.1);
	color: #feae00;
	transform: translateY(-2px);
}

.toolbar-btn:active:not(:disabled) {
	transform: translateY(0);
}

.toolbar-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* Bouton delete avec badge - toujours visible mais disabled par défaut */
#delete-point-btn {
	position: relative;
	padding: 10px !important;
	min-width: 44px;
	gap: 0 !important;
}

#delete-point-btn:disabled {
	opacity: 0.3;
}

#delete-point-btn:not(:disabled) {
	opacity: 1;
}

/* Animation flash pour les boutons */
.toolbar-btn.flash-active {
	color: #feae00 !important;
	animation: btnPulse 0.4s ease;
}

@keyframes btnPulse {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.1);
	}
	100% {
		transform: scale(1);
	}
}

.toolbar-btn span {
	font-size: 14px;
	font-weight: 600;
}

/* Boutons cancel et validate - pas de fond, juste icône */
.toolbar-cancel {
	background: transparent;
	border-color: transparent;
	color: #b82121;
}

.toolbar-cancel:hover:not(:disabled) {
	color: #b82121;
}

.toolbar-validate {
	background: transparent;
	border-color: transparent;
	color: #feae00;
}

.toolbar-validate:hover:not(:disabled) {
	border-color: rgba(254, 174, 0, 0.3);
	color: #feae00;
}

.toolbar-toggle-zones {
	color: #e4e4e4;
}

.toolbar-toggle-zones:hover:not(:disabled) {
	color: #feae00;
}

.toolbar-toggle-zones.zones-hidden {
	color: #feae00;
	background: rgba(254, 174, 0, 0.12);
	border-color: rgba(254, 174, 0, 0.3);
}

.selection-badge {
	position: absolute;
	top: -8px;
	right: -8px;
	background: linear-gradient(135deg, #feae00, #ff8c00);
	color: #1b1e24;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 10px;
	min-width: 20px;
	text-align: center;
	display: none;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .5);;
}

.selection-badge.visible {
	display: block;
}

/* Tooltip for toolbar buttons */
.toolbar-btn::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: -55px;
	left: 50%;
	transform: translateX(-50%);
	background: #1e1f24;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: white;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 1101;
	box-shadow: 0 4px 10px rgba(0, 0, 0, .5);;
}

.toolbar-btn:hover::before {
	opacity: 1;
}

.toolbar-btn span + i,
.toolbar-btn i + span {
	margin-left: 0;
}

/* Color Picker Popup */
.color-picker-popup {
	position: fixed;
	top: 130px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1150;
	background: #1e1f24;
	backdrop-filter: blur(15px);
	-webkit-backdrop-filter: blur(15px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	animation: popupSlideIn 0.3s ease forwards;
}

@keyframes popupSlideIn {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(-15px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

.color-picker-content {
	display: flex;
	flex-direction: column;
	gap: 15px;
	align-items: center;
	min-width: 250px;
}

.color-picker-title {
	color: #e4e4e4;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
	letter-spacing: 0.5px;
}

.color-picker-popup #edit-color-picker {
	width: 100%;
	height: 50px;
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	cursor: pointer;
	background: transparent;
}

.color-picker-actions {
	display: flex;
	gap: 10px;
	width: 100%;
}

.color-picker-btn {
	flex: 1;
	padding: 10px 16px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.color-picker-btn.cancel-btn {
	background: rgba(255, 255, 255, 0.1);
	color: #e4e4e4;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.color-picker-btn.cancel-btn:hover {
	background: rgba(255, 255, 255, 0.15);
	transform: translateY(-2px);
}

.color-picker-btn.validate-btn {
	background: linear-gradient(135deg, #feae00 0%, #ff8c00 100%);
	color: #000;
	font-weight: 600;
	box-shadow: 0 4px 15px rgba(254, 174, 0, 0.3);
}

.color-picker-btn.validate-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(254, 174, 0, 0.4);
}

.color-picker-btn:active {
	transform: translateY(0);
}
/* ============================================
   MAP FILTER BOTTOMBAR
   ============================================ */
.map-filter-bottombar {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	animation: slideUpFade 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Masquer la bottombar en mode admin */
body.admin-mode .map-filter-bottombar {
	display: none;
}

@keyframes slideUpFade {
	from {
		opacity: 0;
		transform: translate(-50%, 30px) scale(0.9);
	}
	to {
		opacity: 1;
		transform: translate(-50%, 0) scale(1);
	}
}

.filter-container {
	display: flex;
	gap: 16px;
	background: #1e1f24;
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-radius: 12px;
	padding: 7px 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.filter-btn {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 16px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 12px;
	color: #babdc7;
	cursor: pointer;
	transition: all 0.7s ease;
	overflow: visible;
}

.filter-btn i {
	font-size: 15px;
	transition: all 0.7s ease;
	flex-shrink: 0;
	margin-bottom: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 16px;
}

.filter-btn span {
	font-size: 16px;
	font-weight: 700;
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	opacity: 0;
	max-width: 0;
	overflow: hidden;
	transition: all 0.7s ease;
	line-height: 16px;
	display: flex;
	align-items: center;
	height: 16px;
}

.filter-btn:hover {
	color: #feae00;
}

.filter-btn:hover span {
	opacity: 1;
	max-width: 150px;
	margin-left: 0;
}

.filter-btn.active {
	color: #feae00;
}

.filter-btn.active span {
	opacity: 1;
	max-width: 150px;
}

/* Responsive */
@media (max-width: 768px) {
	.map-filter-bottombar {
		bottom: 20px;
	}
	
	.filter-container {
		gap: 12px;
		padding: 10px 16px;
	}
	
	.filter-btn {
		padding: 8px 12px;
	}
	
	.filter-btn i {
		font-size: 18px;
	}
	
	.filter-btn span {
		font-size: 13px;
	}
}