﻿html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#map-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#map-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

#map-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f0f8ff;
    border-bottom: 1px solid #ccc;
    font-size: 14px;
}

.left-group,
.right-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title {
    font-weight: bold;
    font-size: 16px;
}

.icon-btn {
    background: none;
    border: none;
    color: #003366;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

    .icon-btn i {
        font-size: 16px;
    }

    .icon-btn:hover {
        color: #005b8a;
    }

.link-btn {
    color: #003366;
    text-decoration: underline;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

    .link-btn:hover {
        text-decoration: none;
        color: #005b8a;
    }

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

#map {
    flex: 1;
    width: 100%;
    position: relative;
}

#customPopup {
    position: absolute;
    min-width: 200px;
    max-width: 300px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: none;
    z-index: 9999;
    overflow: hidden;
}

#customPopupHeader {
    background-color: #0079c1;
    color: white;
    padding: 10px 14px;
    cursor: move;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#popupCloseBtn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

    #popupCloseBtn:hover {
        color: #ffcccb;
    }

#customPopupContent {
    padding: 12px 14px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
}


.map-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 555;
    background-color: #f0f8ff;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 360px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

    .map-modal.hidden {
        display: none;
    }

.map-modal-content {
    display: flex;
    flex-direction: column;
}

.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 14px;
    color: black;
    font-weight: bold;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

    .map-modal-header button {
        background: none;
        border: none;
        color: black;
        font-size: 18px;
        cursor: pointer;
    }

        .map-modal-header button:hover {
            color: #ffcccb;
        }

#mapToolPopupBody {
    font-size: 14px;
    line-height: 1.4;
}

.layer-toggle-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
}

.layer-title {
    flex: 1;
    font-size: 0.95rem;
}

.layer-toggle-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
}

.layer-checkbox {
    width: 19px;
    height: 19px;
    accent-color: #063A83;
    cursor: pointer;
}

.layer-title {
    font-size: 0.95rem;
}

.layer-legend {
    background: #f1f5f9;
    border-left: 2px solid #1d4ed8;
    padding: 0.5rem 1rem;
    margin-left: 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #334155;
}


.layer-entry {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.layer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

    .layer-header:hover {
        background: #e2e8f0;
    }


.layerlist-toggle {
    cursor: pointer;
    font-size: 0.9rem;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
    padding: .25rem 0.75rem;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 6px;
    font-weight: 500;
    color: #1e293b;
    flex-grow: 1;
}

/* Hide the search source dropdown arrow */
.esri-search__container .esri-widget--button {
        display: none !important;
}

/* Container layout */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

    /* Each checkbox row */
    .filter-checkboxes label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 14px;
        font-weight: 500;
        color: #344054;
        cursor: pointer;
        user-select: none;
    }

    /* Hide the raw checkbox */
    .filter-checkboxes input[type="checkbox"] {
        appearance: none;
        width: 18px;
        height: 18px;
        border: 2px solid #ccc;
        border-radius: 6px;
        display: inline-block;
        position: relative;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        /* Checked state */
        .filter-checkboxes input[type="checkbox"]:checked {
            background-color: #2d6cdf;
            border-color: #2d6cdf;
        }

            .filter-checkboxes input[type="checkbox"]:checked::after {
                content: "✔";
                position: absolute;
                color: white;
                font-size: 12px;
                left: 2px;
                top: -1px;
            }
