body {
    padding: 0;
    margin: 0;
}

.map {
    height: 100vh;
    width: 100%;
}

#layer-control {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000; /* Ensure it's above the map */
}

#layer-control-title {
    cursor: pointer; /* Indicates it's clickable */
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

#layer-control-content {
    max-height: 500px; /* Adjust as needed for your content's max height */
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;
}

#layer-control-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Style for the custom control container */
.ol-control.location-control {
    top: 100px; /* Adjust this value to position it below zoom controls */
    left: 8px;
    background-color: white;
    border-radius: 4px;
    padding: 2px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
}
.location-button {
    display: block;
    width: 28px; /* Standard control button size */
    height: 28px; /* Standard control button size */
    cursor: pointer;
    text-align: center;
    line-height: 28px;
    color: #333;
    font-size: 1.2em; /* Adjust icon size */
}
.location-button.active {
    background-color: lightblue; /* Highlight when active */
}
/* SVG icon styling */
.location-button svg {
    width: 20px; /* Adjust SVG size */
    height: 20px; /* Adjust SVG size */
    vertical-align: middle;
    fill: currentColor; /* Use button's text color for the icon */
}
/* CSS for blinking effect */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}
.blinking-dot {
    animation: blink 1s linear infinite;
}

.ol-popup {
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: 150px;
    position: absolute; /* Needed for ol.Overlay */
    bottom: 12px;
    left: -50px;
    /*white-space: nowrap; /* Prevent text wrapping if not desired */*/
    text-wrap: wrap;
}
.ol-popup:after, .ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}
.ol-popup:after {
    border-top-color: white;
    border-width: 10px;
    left: 48px;
    margin-left: -10px;
}
.ol-popup:before {
    border-top-color: #cccccc;
    border-width: 11px;
    left: 48px;
    margin-left: -11px;
}
.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 2px;
    right: 8px;
    cursor: pointer;
    color: #333;
    font-weight: bold;
}
.ol-popup-closer:after {
    content: "×"; /* Unicode 'times' character */
}

#popup-content {
    min-width: 400px;
}

/*CHURCH/STATE FILTER CONTROL*/

#filter-panel {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    max-height: 90vh;
    overflow-y: auto;
    min-width: 250px;
    display: none; /* Initially hidden */
}
#filter-panel-header {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
}
#filter-panel-content {
    /* This div is now always visible when the panel is shown */
}
#state-search {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
    box-sizing: border-box;
}
#state-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 5px;
    margin-bottom: 10px;
}
.state-item {
    margin-bottom: 5px;
}
.state-item label {
    display: block;
    cursor: pointer;
}
.filter-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.filter-buttons button {
    flex-grow: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
#apply-filter {
    background-color: #4CAF50;
    color: white;
}
#apply-filter:hover {
    background-color: #45a049;
}
#clear-filter {
    background-color: #f44336;
    color: white;
}
#clear-filter:hover {
    background-color: #da190b;
}
/* New styles for the filter control */
.ol-control.filter-control {
    top: 138px; /* Position below location control (100px + 28px button + 2px padding + some margin) */
    left: 8px;
    background-color: white;
    border-radius: 4px;
    padding: 2px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
}
.filter-button {
    display: block;
    width: 28px;
    height: 28px;
    cursor: pointer;
    text-align: center;
    line-height: 28px;
    color: #333;
    font-size: 1.2em;
    border: none;
    background: none;
    padding: 0;
}
.filter-button.active {
    background-color: lightblue;
}
.filter-button svg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    fill: currentColor;
}

/* Media query for screens with a maximum width of 768px (common breakpoint for tablets/mobiles) */
@media (max-width: 768px) {
    .ol-popup {
        font-size: 1.25rem; /* Larger font size for mobile devices */
        text-wrap: wrap;
    }
    #popup-content {
        min-width: unset;
    }
    #layer-control {
        font-size: 1.15rem; /* Larger font size for mobile devices */
    }
    #layer-control-title {
        font-size: 1.25rem;
    }
}