html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Splash screen */
#splash-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    pointer-events: all;
}
#splash-modal.hidden {
    opacity: 0;
    pointer-events: none;
}
.splash-content {
    animation: fadeInUp 2s ease-out;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    max-width: 550px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.splash-content h1 {
    color: #3b82f6;
    margin-bottom: 1rem;
    font-family: "Lexend Exa", sans-serif;
}
.splash-text {
    text-align: left;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-family: "Lexend", sans-serif;
    font-size: 14px;
}
#accept-splash {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: "Lexend", sans-serif;
}
#accept-splash:hover {
    background-color: #2563eb;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: lightgray;
    border: solid white 5px;
    box-sizing: border-box;
    transition: width 0.3s ease;
}

.leaflet-control-attribution {
    max-width: 85vw;
}

.map-title {
    position: absolute;
    top: 13.5px;
    left: 58px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    background-clip: padding-box;
    padding: 5px 15px;
    border-radius: 5px;
    border: solid rgba(0, 0, 0, 0.2) 2px;
    font-family: "Lexend Exa", sans-serif;
}

.map-title h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.24;
    color: #333;
}

/* For all hyperlinks */
.geojson-control a,
.geojson-control .layer-label {
    text-decoration: underline;
    cursor: pointer;
}
.geojson-control a:hover,
.geojson-control .layer-label:hover {
    text-decoration: none;
}

/* Reset view button */
.custom-button {
    background-color: rgba(255, 255, 255);
    background-image: url("Images/globe_icon.png");
    background-size: 72%;
    background-repeat: no-repeat;
    background-position: center;
    background-clip: padding-box;
    opacity: 85%;
    border: solid rgba(0, 0, 0, 0.2) 2px;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    top: 72px;
    left: 0;
    cursor: pointer;
}

/* Leaflet zoom controls */
.leaflet-control-zoom {
    position: fixed;
    left: 4px;
    top: 4px;
    width: 30px;
    opacity: 85%;
}

/* Measurement tool styling */
.leaflet-control-measure {
    font-family: "Lexend", sans-serif;
    opacity: 85%;
}

/* Draw tool styling */
.leaflet-draw-toolbar a {
    font-family: "Lexend", sans-serif;
    opacity: 85%;
}

/* Export tool styling */
.leaflet-control-easyPrint a {
    font-family: "Lexend", sans-serif;
    opacity: 85%;
}

/* Custom text tool styling */
.leaflet-control-text button {
    background: white;
    background-clip: padding-box;
    opacity: 85%;
    border: solid rgba(0, 0, 0, 0.2) 2px;
    border-radius: 4px;
}
.text-annotation {
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 4px;
    font-family: "Lexend", sans-serif;
}
.text-annotation div {
    display: inline-block;
    min-width: 10px;
    width: max-content;
    max-width: 200px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    padding: 2px 4px;
    cursor: text;
    line-height: 1.2;
}
.text-annotation div[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.8);
    outline: 2px solid #3388ff;
}

/* Basemap control */
.leaflet-control-layers,
.leaflet-control-layers-overlays {
    font-family: "Lexend", sans-serif;
    color: #333;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
}

/* GeoJSON Control Panel */
.geojson-control {
    top: 73px;
    background-color: rgba(255, 255, 255, 0.9);
    background-clip: padding-box;
    border-radius: 5px;
    padding: 5px 5px;
    font-family: "Lexend", sans-serif;
    border: solid rgba(0, 0, 0, 0.2) 2px;
    max-height: 72vh;
    overflow-y: auto;
    pointer-events: auto;
}
.geojson-control h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}
.layer-item {
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.layer-checkbox {
    margin-right: -4px;
}
.layer-color {
    height: 20px;
    width: 20px;
    padding: 0;
    border: 1px solid #ccc;
    cursor: pointer;
}
.opacity-container {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 100px;
}
.opacity-slider {
    flex-grow: 1;
    max-width: 100px;
    min-width: 80px;
}
.layer-divider {
    margin: 5px 0;
    border: 0;
    border-top: 1px solid #eee;
}
.leaflet-control-multi {
    z-index: 1000 !important;
}

/* Image viewer styles */
#image-viewer {
    position: fixed;
    top: 0;
    right: 0;
    width: 35%;
    height: 100vh;
    background: white;
    z-index: 1000;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
#close-image-viewer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    color: #333;
}
#viewer-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    box-sizing: border-box;
}
/* Layer label styles */
.layer-label {
    cursor: pointer;
    text-decoration: underline;
    margin-left: 5px;
    flex-grow: 1;
    min-width: 120px;
}

.layer-label:hover {
    text-decoration: none;
}

/* Leaflet popup styling */
.leaflet-popup-content {
    font-family: "Lexend", sans-serif !important;
    font-size: 14px;
    line-height: 1.4;
    margin: 12px 15px;
}

.leaflet-popup-content-wrapper {
    border-radius: 5px !important;
    font-family: "Lexend", sans-serif !important;
}

.leaflet-popup-tip-container {
    font-family: "Lexend", sans-serif !important;
}
