/* --- Map Container --- */
#nppn-leaflet-map {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    background-color: #e9e9e9;
}

/* --- Custom Marker Icon (L.divIcon) --- */
.nppn-marker-icon {
    background-color: var(--wp--preset--color--primary);
    color: #000;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: transform 0.2s ease;
}

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

.nppn-marker-icon span {
    line-height: 1;
}

/* --- Leaflet Popup Customization --- */
.leaflet-popup-content-wrapper {
    border-radius: 5px;
}

.leaflet-popup-content {
    margin: 15px 20px;
    font-family: sans-serif;
    line-height: 1.5;
}

.nppn-popup-content h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}
.nppn-popup-content div {
    max-height: 250px;
    overflow-y: auto;
}

/* --- Custom Reset Button --- */
#nppn-map-reset-button {
    position: absolute;
    top: 80px; /* Position below the default zoom controls */
    right: 10px;
    z-index: 800; /* Below leaflet's controls but above map */
    width: 30px;
    height: 30px;
    background-color: #fff;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    line-height: 26px;
    text-align: center;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-12h2v4h-2zm-1.5 6h5v2h-5zM12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z" transform="rotate(45 12 12)"/></svg>');
    background-size: 20px 20px;
    background-repeat: no-repeat;
    background-position: center;
    padding: 0;
}

#nppn-map-reset-button:before {
    content: "Reset";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
#nppn-map-reset-button:hover:before {
    opacity: 1;
}

/* --- Close Button for Fullscreen --- */
#nppn-map-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    color: #333;
}

#nppn-map-close-button:hover {
    background-color: #fff;
}

/* --- Centered Modal --- */
.nppn-centered-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.nppn-modal-content {
    background-color: #fff;
    padding: 16px;
    border-radius: 8px;
    width: min( 90%, 450px );
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-align: center;
}

.nppn-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    font-weight: bold;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
	padding: 0;
	width: 24px;
	height: 24px;
}

.nppn-modal-close:hover {
    color: #000;
}

.nppn-modal-main-content {
	padding-block-start: 32px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 16px;
	justify-content: center;
	align-items: center;
}

.nppn-modal-main-content *:first-child {
	margin-block-start: 0;
}

.nppn-modal-main-content *:last-child {
	margin-block-end: 0;
}

.nppn-modal-main-content .index-badge {
	background-color: #000;
	color: #fff;
	display: flex;
	width: 32px;
	height: 32px;
	position: absolute;
	top: 100px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	left: 16px;
}

.nppn-modal-main-content .nppn-modal-content-title {
	margin: 0;
}

.nppn-modal-main-content .thumbnail img {
	max-width: 100%;
	max-height: 150px;
	width: auto;
	height: auto;
}

@media (min-width: 768px) {
	.nppn-modal-main-content .thumbnail img {
		max-height: 250px;
	}
}

.nppn-modal-content-box {
	height: 80px;
	overflow-y: auto;
	padding-block-end: 8px;
	font-size: clamp(0.875rem, 0.7917rem + 0.2778vw, 1rem);
	margin-block-end: 8px;
}

.nppn-modal-main-content .flood-measures-modal-info {
    display: grid;
    grid-template-columns: repeat(4, minmax(0 ,1fr) );
	margin-inline: -8px;
	width: 100%;
}

.flood-measure-modal-info-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--wp--preset--color--black);
	padding: 0 8px;
	gap: 8px;
}

.flood-measure-modal-info-item:last-child {
    border-right: none;
}

.flood-measure-modal-info-item .info-title {
	margin: 0;
	font-size: clamp(0.625rem, 0.375rem + 0.8333vw, 0.8125rem);
}

.flood-measure-modal-info-item .info-description {
	margin: 0;
	font-size: clamp(0.625rem, 0.375rem + 0.8333vw, 1rem);
}

/* --- Hide Leaflet Attribution --- */
.leaflet-bottom {
    display: none;
}
