/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}


#app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}

/* Map Container */
#map-container {
    flex: 1;
    height: 100%;
    position: relative;
}

/* Hide map during initial load to prevent flash before state is restored */
#map-container.loading {
    visibility: hidden;
}

#map-container.loaded {
    visibility: visible;
}

#map {
    width: 100%;
    height: 100%;
    /* GRADIENT FOR BACKGROUND  --- is this too cpu intensive */
    /*background: linear-gradient(to top, #97bddd, #ffffff);*/
    background-color: #97bddd !important;
}



/* Map Controls Override */
.ol-zoom {
    right: 0;
    left: auto;
    top: 38px;
}

.ol-attribution {
    right: 10px;
    bottom: 10px;
}

/* Layer Switcher Control */
.ol-tileSet-switcher {
    top: 108px;
    right: 0;
    left: auto;
}

.ol-tileSet-switcher-button {
    display: block;
    width: 1.375em;
    height: 1.375em;
    font-size: 1.14em;
    background-color: rgba(0, 60, 136, 0.5);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    margin: 1px;
    line-height: 1.375em;
    text-align: center;
}

.ol-tileSet-switcher-button:hover {
    background-color: rgba(0, 60, 136, 0.7);
}

.ol-tileSet-switcher-button:focus {
    outline: 1px solid rgba(0, 60, 136, 1);
}

/* Reset View Control */
.ol-reset-view {
    top: 154px;
    right: 0;
    left: auto;
}

.ol-reset-view-button {
    display: block;
    width: 1.375em;
    height: 1.375em;
    font-size: 1.14em;
    background-color: rgba(0, 60, 136, 0.5);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    margin: 1px;
    line-height: 1.375em;
    text-align: center;
}

.ol-reset-view-button:hover {
    background-color: rgba(0, 60, 136, 0.7);
}

.ol-reset-view-button:focus {
    outline: 1px solid rgba(0, 60, 136, 1);
}

/* Fit Extent Control */
.ol-fit-extent {
    top: 177px;
    right: 0;
    left: auto;
}

.ol-fit-extent-button {
    display: block;
    width: 1.375em;
    height: 1.375em;
    font-size: 1.14em;
    background-color: rgba(0, 60, 136, 0.5);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    margin: 1px;
    line-height: 1.375em;
    text-align: center;
}

.ol-fit-extent-button:hover {
    background-color: rgba(0, 60, 136, 0.7);
}

.ol-fit-extent-button:focus {
    outline: 1px solid rgba(0, 60, 136, 1);
}

.tileSet-switcher-dropdown {
    position: absolute;
    top: 0;
    right: 40px;
    left: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
}

.tileSet-switcher-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.tileSet-switcher-item:last-child {
    border-bottom: none;
}

.tileSet-switcher-item:hover {
    background-color: #f5f5f5;
}

.tileSet-switcher-item.active {
    background-color: #e3f2fd;
    color: #0d6efd;
    font-weight: 500;
}

.tileSet-switcher-title {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

/* Overlay Control */
.ol-overlay-control {
    top: 200px;
    right: 0;
    left: auto;
}

.ol-overlay-control-button {
    display: block;
    width: 1.375em;
    height: 1.375em;
    font-size: 1.14em;
    background-color: rgba(0, 60, 136, 0.5);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    margin: 1px;
    line-height: 1.375em;
    text-align: center;
}

.ol-overlay-control-button:hover {
    background-color: rgba(0, 60, 136, 0.7);
}

.ol-overlay-control-button:focus {
    outline: 1px solid rgba(0, 60, 136, 1);
}

.overlay-control-dropdown {
    position: absolute;
    top: 0;
    right: 40px;
    left: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    padding: 8px 0;
}

.overlay-control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.overlay-control-item:hover {
    background-color: #f5f5f5;
}

.overlay-control-title {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 4px;
}

.overlay-control-toggle-all {
    font-weight: 500;
}

.overlay-control-separator {
    height: 1px;
    background-color: #e0e0e0;
    margin: 6px 0;
}

.overlay-control-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0d6efd;
}

.overlay-control-label {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
    margin: 0;
}

/* Region Control */
.ol-region-control {
    top: 223px;
    right: 0;
    left: auto;
}

.ol-region-control-button {
    display: block;
    width: 1.375em;
    height: 1.375em;
    font-size: 1.14em;
    background-color: rgba(0, 60, 136, 0.5);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    margin: 1px;
    line-height: 1.375em;
    text-align: center;
}

.ol-region-control-button:hover {
    background-color: rgba(0, 60, 136, 0.7);
}

.ol-region-control-button:focus {
    outline: 1px solid rgba(0, 60, 136, 1);
}

.ol-region-control-button.active-filter {
    color: rgba(220, 53, 69, 0.8);
    /*background-color: rgba(220, 53, 69, 0.8);*/
}

.ol-region-control-button.active-filter:hover {
    background-color: rgba(220, 53, 69, 1);
    background-color: rgba(220, 53, 69, 1);
}

.region-control-dropdown {
    position: absolute;
    top: -180px;
    right: 40px;
    left: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 1000;
    padding: 8px 0;
}

.region-control-title {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 4px;
}

.region-control-item {
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.region-control-item:hover {
    background-color: #f5f5f5;
}

.region-control-item.active {
    background-color: #e3f2fd;
    color: #0d6efd;
    font-weight: 500;
}

.region-control-separator {
    height: 1px;
    background-color: #e0e0e0;
    margin: 6px 0;
}

/* Map Effect Control */
.ol-map-effect {
    top: 131px;
    right: 0;
    left: auto;
}

.ol-map-effect-button {
    display: block;
    width: 1.375em;
    height: 1.375em;
    font-size: 1.14em;
    background-color: rgba(0, 60, 136, 0.5);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    margin: 1px;
    line-height: 1.375em;
    text-align: center;
}

.ol-map-effect-button:hover {
    background-color: rgba(0, 60, 136, 0.7);
}

.ol-map-effect-button:focus {
    outline: 1px solid rgba(0, 60, 136, 1);
}

.map-effect-dropdown {
    position: absolute;
    top: 0;
    right: 40px;
    left: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
}

.map-effect-title {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.map-effect-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.map-effect-item:last-child {
    border-bottom: none;
}

.map-effect-item:hover {
    background-color: #f5f5f5;
}

.map-effect-item.active {
    background-color: #e3f2fd;
    color: #0d6efd;
    font-weight: 500;
}

/* Tile layer effect filter via CSS custom property */
.ol-tile-layer canvas {
    filter: var(--tile-filter, none);
}

/* Popup Tooltip */
.ol-popup {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.70);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ol-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}



/* hover stuff */
.hover-dName {
    font-weight: bold;
}
.hover-address {
    font-size: small;
}

.hover-lead {
    font-size: small;
}


.howfind {
	font-family: monospace;
	font-size: 0.75em;
}