/**
 * Leaflet Interactive Map & Modal Popup Styles
 *
 * @package Avsa_Tesis_Filtreleme
 */

/* Map Modal Overlay (Backdrop) */
.avsa-map-modal-overlay {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.7);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 99998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.avsa-map-modal-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

/* Map Modal Window (Masaüstü ve Mobilde Ayrı Pencere/Modal Popup) */
.avsa-map-modal {
	position: fixed;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	background-color: #ffffff;
	opacity: 0;
	visibility: hidden;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
	transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

/* Mobile: Fullscreen modal popup */
@media (max-width: 1023px) {
	.avsa-map-modal {
		inset: 0;
		width: 100vw;
		height: 100dvh;
		height: 100vh;
		border-radius: 0;
		transform: translateY(10px);
	}

	.avsa-map-modal.is-active {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
}

/* Desktop: Centered modal popup dialog */
@media (min-width: 1024px) {
	.avsa-map-modal {
		top: 50%;
		left: 50%;
		width: min(1120px, 94vw);
		height: min(780px, 88vh);
		border-radius: 12px;
		overflow: hidden;
		transform: translate(-50%, -48%) scale(0.97);
	}

	.avsa-map-modal.is-active {
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, -50%) scale(1);
	}
}

/* Modal Header */
.avsa-map-modal-header {
	height: 54px;
	background-color: var(--avsa-color-primary, #2a5f97);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
	z-index: 10;
	flex-shrink: 0;
}

.avsa-map-modal-title-group {
	display: flex;
	align-items: center;
	gap: 10px;
}

.avsa-map-header-icon {
	color: #ffffff;
	flex-shrink: 0;
}

.avsa-map-modal-title {
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	margin: 0;
	letter-spacing: -0.01em;
}

.avsa-map-count-badge {
	font-size: 13px;
	font-weight: 600;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.2);
	padding: 4px 12px;
	border-radius: 20px;
}

.avsa-map-modal-close-btn {
	background: rgba(255, 255, 255, 0.18);
	border: none;
	color: #ffffff;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.avsa-map-modal-close-btn:hover {
	background: rgba(255, 255, 255, 0.32);
	transform: scale(1.05);
}

/* Modal Body & Interactive Map */
.avsa-map-modal-body {
	position: relative;
	flex: 1;
	min-height: 0;
	width: 100%;
	height: 100%;
	background-color: #f1f5f9;
}

.avsa-interactive-map {
	width: 100%;
	height: 100%;
	min-height: 100%;
}

/* Harita Üzerindeki Tesis Bilgi Kartı (Floating Bottom Card) */
.avsa-map-bottom-card {
	position: absolute;
	bottom: 16px;
	left: 14px;
	right: 14px;
	max-width: 440px;
	background-color: #ffffff;
	border-radius: 12px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.28), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
	padding: 10px;
	z-index: 1000;
	border: 1px solid #e2e8f0;
	animation: avsaCardSlideUp 0.25s ease-out;
}

@keyframes avsaCardSlideUp {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (min-width: 1024px) {
	.avsa-map-bottom-card {
		left: 20px;
		right: auto;
		width: 400px;
		bottom: 20px;
	}
}

.avsa-bottom-card-close {
	position: absolute;
	top: 8px;
	right: 8px;
	background: #f1f5f9;
	border: none;
	border-radius: 50%;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
	cursor: pointer;
	z-index: 2;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.avsa-bottom-card-close:hover {
	background: #e2e8f0;
	color: #0f172a;
}

/* Kartın tamamının tıklanabilir bağlantı olması */
.avsa-bottom-card-link {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	width: 100%;
	cursor: pointer;
	border-radius: 8px;
	transition: background-color 0.15s ease;
}

.avsa-bottom-card-link:hover .avsa-bc-title {
	color: var(--avsa-color-primary, #2a5f97);
}

.avsa-bottom-card-link:hover .avsa-bc-btn {
	background-color: var(--avsa-color-primary-dark, #1e4570);
}

.avsa-bc-image {
	width: 95px;
	height: 75px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}

.avsa-bc-details {
	flex: 1;
	min-width: 0;
}

.avsa-bc-type {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: var(--avsa-color-primary, #2a5f97);
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.avsa-bc-title {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	margin: 2px 0 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.15s ease;
}

.avsa-bc-phone {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 5px;
}

.avsa-bc-btn {
	display: inline-block;
	padding: 4px 10px;
	background-color: var(--avsa-color-primary, #2a5f97);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 4px;
	transition: background-color 0.15s ease;
}

/* Harita Özel Pin Marker Tasarımı (Büyük Location İkonu + Buton Tesis Adı) */
.leaflet-div-icon.avsa-map-marker-div {
	background: transparent !important;
	border: none !important;
}

.avsa-marker-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	width: 140px;
	cursor: pointer;
	text-align: center;
	user-select: none;
	transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
	pointer-events: auto;
}

.avsa-marker-container:hover,
.avsa-map-marker-div.is-active .avsa-marker-container {
	transform: scale(1.1);
}

.avsa-map-marker-div:hover,
.avsa-map-marker-div.is-active {
	z-index: 10000 !important;
}

/* Location Pin Circle (Daha Büyük Location İkonu) */
.avsa-marker-pin-circle {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: var(--avsa-color-primary, #2a5f97);
	color: #ffffff;
	border: 2.5px solid #ffffff;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.avsa-marker-container:hover .avsa-marker-pin-circle,
.avsa-map-marker-div.is-active .avsa-marker-pin-circle {
	background-color: var(--avsa-color-accent, #ffa500);
	color: #000000;
	box-shadow: 0 4px 14px rgba(255, 165, 0, 0.55);
}

/* Buton Şeklinde Tesis Adı (Facility Title Button Pill) */
.avsa-marker-title-btn {
	margin-top: 4px;
	padding: 3px 10px;
	background-color: #ffffff;
	color: #0f172a;
	border: 1.5px solid var(--avsa-color-primary, #2a5f97);
	border-radius: 14px;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
	max-width: 135px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	cursor: pointer;
}

.avsa-marker-title-text {
	font-size: 11px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}

.avsa-marker-container:hover .avsa-marker-title-btn,
.avsa-map-marker-div.is-active .avsa-marker-title-btn {
	background-color: var(--avsa-color-primary, #2a5f97);
	color: #ffffff;
	border-color: var(--avsa-color-primary, #2a5f97);
	box-shadow: 0 4px 12px rgba(42, 95, 151, 0.45);
}

/* Leaflet Popup Özel Tasarımı (Tüm kart tıklanabilir) */
.leaflet-popup-content-wrapper {
	border-radius: 10px !important;
	padding: 0 !important;
	overflow: hidden !important;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
}

.leaflet-popup-content {
	margin: 0 !important;
	line-height: 1.4 !important;
}

.avsa-popup-card {
	width: 230px;
}

.avsa-popup-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

.avsa-popup-card-link:hover .avsa-popup-title {
	color: var(--avsa-color-primary, #2a5f97);
}

.avsa-popup-card-link:hover .avsa-popup-btn {
	background-color: var(--avsa-color-primary-dark, #1e4570);
}

.avsa-popup-img {
	width: 100%;
	height: 125px;
	object-fit: cover;
	display: block;
}

.avsa-popup-info {
	padding: 10px 12px 12px;
}

.avsa-popup-title {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 4px;
	color: #0f172a;
	transition: color 0.15s ease;
}

.avsa-popup-btn {
	display: inline-block;
	margin-top: 4px;
	padding: 4px 10px;
	background-color: var(--avsa-color-primary, #2a5f97);
	color: #ffffff !important;
	font-size: 11px;
	font-weight: 700;
	border-radius: 4px;
	text-decoration: none;
	transition: background-color 0.15s ease;
}
