/* =========================
   GLOBAL RESET
========================= */
:root {
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

* {
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    margin: 0;
    padding: 0;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* =========================
   GRID LAYOUT
========================= */
.grid-container {
    display: grid;
    grid-template-columns: 0vw 100vw; /* main map full width initially */
    grid-template-rows: 100vh;
    background-color: grey;
    height: 100%;
    transition: filter 0.3s ease;
}

.grid-container.blurred {
    filter: blur(8px);
    pointer-events: none;
}

.map {
    width: 100%;
    height: 100%;
    background-color: rgb(255, 255, 255);
}

/* =========================
   GLASSMORPHIC SCROLLBAR
========================= */

/* Webkit browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 12px;          /* width of vertical scrollbar */
    height: 12px;         /* height of horizontal scrollbar */
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1); /* transparent track */
    border-radius: 12px;
    backdrop-filter: blur(6px);           /* glass effect */
    -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3); /* semi-transparent thumb */
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2); /* optional border for depth */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5); /* highlight on hover */
    border-color: rgba(255, 255, 255, 0.3);
}

/* Firefox (limited) */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.1);
}

/* =========================
   OPENLAYERS CONTROLS (Zoom & Rotate)
========================= */
.ol-zoom {
    left: auto !important;
    right: 25px;
    top: 70px;
}

.ol-zoom button {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #000;
}

.ol-zoom button:hover {
    background-color: rgba(160, 160, 160, 0.2);
}

/* Position rotation control (north arrow) to the left of zoom controls */
.ol-rotate {
    left: auto !important;
    right: 70px !important;
    top: 70px !important; /* Same vertical position as zoom controls */
}

.ol-rotate button {
    background: rgba(255, 255, 255, 0.2);    
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #000;
}

.ol-rotate button:hover {
    background-color: rgba(160, 160, 160, 0.2);
}

/* =========================
   LOADING INDICATOR (OpenLayers)   
========================= */
.ol-loading-indicator {
    left: auto !important;
    right: 20px;           /* align with zoom */
    margin-top: 130px;       /* push below zoom buttons */

    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);

    padding: 6px;
}

/* spinner itself stays simple */
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(0,0,0,0.25);
    border-top-color: rgba(0,0,0,0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* =========================
   SCALE BAR (OpenLayers)
========================= */
.ol-scale-bar,
.ol-scale-line {
    left: auto !important;
    right: 20px;
    bottom: 30px;
}

/* =========================
   TOP BAR (Glassmorphism)
========================= */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
    gap: 10px;
    margin: 5px;

    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Mobile: Enable horizontal scrolling */
@media (max-width: 768px) {
    #top-bar {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
    
    #top-bar::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
}

/* Top bar buttons (icon + label) */
.topbar-btn {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background-color: transparent;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    min-width: 48px;
    border-radius: 8px;
}

/* Hover & Active state */
.topbar-btn {
    position: relative;
    background: transparent;
    border-radius: 10px;
    transition:
        background 0.25s ease,
        box-shadow 0.25s ease,
        color 0.25s ease;
}

/* Hover */
.topbar-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.45),
        0 6px 18px rgba(0, 0, 0, 0.15);
}

/* Active (selected tool) */
.topbar-btn.active {
    background: rgba(30, 90, 200, 0.45); /* darker, more opaque blue */
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);

    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.7),
        0 8px 24px rgba(30, 90, 200, 0.5);

    color: #000;
}

/* Remove old hard underline */
.topbar-btn.active {
    border-bottom: none;
}

/* Icon inside topbar button */
.btn-icon {
    width: 22px;
    height: 22px;
}

/* Label below icon */
.btn-label {
    font-size: 10px;
    color: #000;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .btn-label {
        display: none;
    }
}

#home {
}

.topbar-left-buttons {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.topbar-center {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
    min-width: 280px;
}

.topbar-address-search {
    position: relative;
    max-width: 500px;
    width: 100%;
}

@media (max-width: 768px) {
    .topbar-address-search {
        min-width: 250px;
    }
}

.topbar-address-search input {
    width: 100%;
    height: 36px;
    padding: 8px 32px 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    color: #000;
}

.topbar-address-search input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.topbar-address-search input:focus {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(30, 90, 200, 0.5);
    box-shadow: 0 0 0 3px rgba(30, 90, 200, 0.1);
}

.topbar-address-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.topbar-address-clear-btn:hover {
    background: rgba(0, 0, 0, 0.25);
}

.topbar-address-suggestions {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 10000;
}

.topbar-address-suggestions.active {
    display: block;
}

.topbar-address-suggestions li {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
    color: #000;
    transition: background 0.2s ease;
}

.topbar-address-suggestions li:last-child {
    border-bottom: none;
}

.topbar-address-suggestions li:hover {
    background: rgba(30, 90, 200, 0.1);
}

.topbar-right-buttons {
    display: flex;
    gap: 5px;
    margin-left: auto;
    flex-shrink: 0;
}

/* =========================
   PRINT MODAL (Glassmorphism)
========================= */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #000;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.modal-columns {
    display: flex;
    gap: 24px;
}

.modal-preview {
    flex: 1.5;
    display: flex;
    flex-direction: column;
}

.modal-preview h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #000;
}

.preview-page-container {
    width: 100%;
    max-width: 600px;
    max-height: 600px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.preview-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    display: none;
}

.preview-map-container {
    flex: 1;
    width: 100%;
    border-radius: 4px;
    border: 2px solid #333;
    overflow: hidden;
    background: #f0f0f0;
    min-height: 200px;
    position: relative;
}

.preview-scalebar {
    text-align: right;
    font-size: 12px;
    color: #666;
    display: none;
}

.preview-date {
    text-align: left;
    font-size: 12px;
    color: #666;
    display: none;
}

.preview-legend {
    margin-top: 10px;
    padding: 10px;
    font-size: 11px;
    color: #333;
    display: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    position: relative;
}

.preview-page-break {
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        #dc3545,
        #dc3545 10px,
        transparent 10px,
        transparent 20px
    );
    margin: 10px 0;
    position: relative;
}

.preview-page-break::after {
    content: "Page Break";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2px 8px;
    font-size: 10px;
    color: #dc3545;
    font-weight: bold;
    border: 1px solid #dc3545;
    border-radius: 4px;
}

.preview-legend h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: bold;
}

.preview-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    line-height: 1.4;
}

.preview-legend-item img {
    max-width: 25px;
    max-height: 25px;
    margin-right: 8px;
    object-fit: contain;
}

.preview-legend-symbol {
    width: 20px;
    height: 12px;
    margin-right: 8px;
    border: 1px solid #999;
    flex-shrink: 0;
}

.preview-hint {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.modal-settings {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    display: block;
    margin-bottom: 0;
    font-weight: 500;
    color: #000;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    color: #000;
    transition: border-color 0.2s ease;
}

.form-group select:focus,
.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: rgba(42, 124, 255, 0.6);
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dc3545;
    transition: 0.3s;
    border-radius: 26px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #28a745;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: rgba(42, 124, 255, 0.9);
    color: #fff;
}

.btn-primary:hover {
    background: rgba(42, 124, 255, 1);
    box-shadow: 0 4px 12px rgba(42, 124, 255, 0.4);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* =========================
   SIDEBAR (Glassmorphism)
========================= */
.sidebar {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: fixed;
    top: 50px; /* below top bar */
    left: -350px; /* hidden initially */
    width: 300px;
    margin-left: 5px;
    margin-top: 10px;
    margin-bottom: 10px;
    bottom: 0px;

    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);

    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    transition: left 0.5s ease, width 0.5s ease;
    z-index: 999;
}

/* Open state */
.sidebar.open {
    left: 0;
    width: 350px;
}

/* Sidebar columns: basemap + overlays */
.sidebar-columns {
    display: flex;
    flex-direction: row;
    height: 100%;
    gap: 8px;
    align-items: stretch;
}

/* =========================
   PARCEL SIDEBAR CONTAINER
========================= */
.parcel-sidebar-container {
    position: fixed;
    top: 50px; /* below top bar */
    left: -350px; /* hidden initially */
    width: 300px;
    height: auto;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 10px 5px 10px 5px;    

    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    transition: left 0.5s ease, width 0.5s ease;
    z-index: 1000;
}

/* Open state */
.parcel-sidebar-container.open {
    left: 0;
    width: 350px;
}



/* =========================
   BASEMAP COLUMN
========================= */
.basemap-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 8px 0;
    min-width: 70px;

    /*background: rgba(255, 255, 255, 0.2);*/
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
}

.basemap-column h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 4px 0 8px;
    text-align: center;
    color: rgba(0, 0, 0, 0.8);
    letter-spacing: 0.3px;
}

/* Basemap container inside column */
#basemap-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual basemap item */
.basemap-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

/* Selected basemap item - same style as active topbar toggle */
.basemap-item.selected {
    background: rgba(30, 90, 200, 0.45); /* darker, more opaque blue */
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.7),
        0 8px 24px rgba(30, 90, 200, 0.5);
}

/* Basemap opacity slider */
.basemap-opacity-slider {
    width: 50px;
    margin-top: 4px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    outline: none;
    display: none;
}

.basemap-opacity-slider.active {
    display: block;
}

.basemap-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: #2a7cff;
    border-radius: 50%;
    cursor: pointer;
}

.basemap-opacity-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: #2a7cff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Basemap icon */
.basemap-icon {
    width: 40px;
    height: 40px;
    /*object-fit: cover;*/
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Basemap label */
.basemap-label {
    font-size: 10px;
    margin-top: 3px;
    text-align: center;
    max-width: 60px;
}

/* =========================
   OVERLAY / GROUP LAYERS
========================= */
.overlay-column {
    flex: 1; /* take remaining width */
    width: 100%;
    min-width: 0; /* allow flex shrinking */
    flex-direction: column;
    padding-left: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    

    /*background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);*/
}

/* Column header */
.overlay-column h3 {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin: 4px 0 8px;
    color: rgba(0, 0, 0, 0.8);
    letter-spacing: 0.3px;
}

/* Group layers */
.group-layer {    
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 30px; /* distinguishable rows */    
    border-bottom: 2px solid rgba(0,0,0,0.2);   
    border-radius: 12px;    
    margin-bottom: 4px;
    overflow: hidden;
}

.group-layer label {    
    font-weight: 600;
    cursor: pointer;
    white-space: normal; /* allow wrapping */
    overflow-wrap: break-word;
    line-height: 1.2;
    flex: 1;
    font-family: inherit;
    letter-spacing: 0.2px;
}

/* Button inside group layer (expand/collapse) */
.group-layer button {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.sub-layers {
    margin-top: 4px;
    display: none; /* collapsed by default */
}

.sub-layers label {
    font-weight: 400;
    cursor: pointer;
    white-space: normal; /* allow wrapping */
    overflow-wrap: break-word;
    line-height: 1.2;
    font-family: inherit;
}

.group-layer.expanded .sub-layers {
    display: block; /* show sub-layers when expanded */
    background-color: transparent;
}

/* Individual overlay/layer buttons */
#overlay-container button {
    padding: 4px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

#overlay-container button img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}


/* =========================
   OVERLAY CHECKBOXES (Glassmorphic like Measure Tool)
========================= */
input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.45),
            rgba(255, 255, 255, 0.15)
        ),
        rgba(80, 160, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow:
        inset 0 1px 1px rgba(255,255,255,0.6),
        inset 0 -1px 1px rgba(255,255,255,0.2),
        0 4px 18px rgba(42,124,255,0.15);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 7px;
    width: 4px;
    height: 8px;
    border: solid rgba(0,32,101,0.9);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* =========================
   OVERLAY OPACITY SLIDER (Glassmorphic)
========================= */
.opacity-slider {
    display: block;
    width: calc(100% - 20px);
    margin-left: 20px;
    margin-top: 4px;
    appearance: none;
    height: 6px; /* thinner track */
    border-radius: 12px;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.2),  /* more transparent left */
        rgba(255, 255, 255, 0.6)   /* more solid right */
    );
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.4),
        0 2px 6px rgba(42,124,255,0.1);
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Webkit thumb */
.opacity-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.9),
            rgba(255, 255, 255, 0.7)
        );
    border: 1px solid rgba(0,32,101,0.8);
    box-shadow: 0 2px 6px rgba(0,32,101,0.25);
    cursor: pointer;
    }

/* Firefox thumb */
.opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.9),
            rgba(255, 255, 255, 0.7)
        );
    border: 1px solid rgba(0,32,101,0.8);
    box-shadow: 0 2px 6px rgba(0,32,101,0.25);
    cursor: pointer;
}


/* =========================
    MEASURE TOOL (Glassmorphism)
========================= */
.measure-sidebar {
    position: fixed;
    top: 50px;               /* below top bar */
    left: -350px;            /* hidden initially */
    width: 320px;
    max-height: calc(100vh - 80px);

    margin-left: 5px;
    margin-top: 10px;
    margin-bottom: 10px;

    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);

    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;

    transition: left 0.5s ease;
    z-index: 2000;
}

/* Open state */
.measure-sidebar.open {
    left: 0;
}

.measure-sidebar .measure-header {
    font-size: 16px;
    margin-bottom: 8px;
    color: #000;
}

.measure-sidebar .measure-modes {
    display: flex;
    position: relative;       /* for pseudo-element positioning */
    gap: 5px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15); /* common background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Glassmorphic highlight */
.measure-sidebar .measure-modes::before {
    content: '';
    position: absolute;
    top: 2px;
    left: calc(var(--active-index, 0) * 50%);
    width: calc(50% - 4px);
    height: calc(100% - 4px);

    border-radius: 10px;

    /* Glass body */
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.5),
            rgba(255, 255, 255, 0.2)
        ),
        rgba(30, 90, 200, 0.5); /* darker, more opaque blue */

    /* Real glass effects */
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);

    /* Glass edges */
    border: 1px solid rgba(255, 255, 255, 0.7);

    /* Depth + light */
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.7),
        inset 0 -1px 1px rgba(255, 255, 255, 0.3),
        0 6px 18px rgba(30, 90, 200, 0.4);

    transition:
        left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s ease;

    z-index: 0;
}

/* Buttons */
.measure-sidebar .measure-modes button {
    position: relative;       /* above pseudo-element */
    flex: 1;
    background: transparent;  /* let highlight show behind */
    border: none;
    padding: 6px 0;
    cursor: pointer;
    color: #000;
    font-weight: bold;
    z-index: 1;               /* above pseudo-element */
    transition: color 0.3s ease;
}

/* Active button text color */
.measure-sidebar .measure-modes button.active {
    color: #2a7cff; /* optional, keep text readable */
}

/* Optional: hover effect */
.measure-sidebar .measure-modes button:hover {
    color: #2a7cff;
}

/* =========================
   SNAP TOGGLE CONTROL
========================= */
.snap-toggle-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin: 12px 0 8px 0;
    padding: 0 4px;
}

.snap-toggle-label span:first-child {
    font-size: 12px;
    font-weight: 400;
    color: #000;
    opacity: 0.8;
}

.snap-toggle-label input[type="checkbox"] {
    display: none;
}

.snap-toggle-slider {
    position: relative;
    width: 28px;
    height: 16px;
    background: rgba(255, 0, 0, 0.6);
    border-radius: 8px;
    transition: background 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.snap-toggle-slider::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.snap-toggle-label input[type="checkbox"]:checked + .snap-toggle-slider {
    background: rgba(0, 200, 0, 0.6);
}

.snap-toggle-label input[type="checkbox"]:checked + .snap-toggle-slider::before {
    transform: translateX(12px);
    box-shadow: 0 2px 6px rgba(0, 200, 0, 0.4);
}

.snap-toggle-slider:hover {
    background: rgba(255, 0, 0, 0.7);
}

.snap-toggle-label input[type="checkbox"]:checked + .snap-toggle-slider:hover {
    background: rgba(0, 200, 0, 0.7);
}

.snap-toggle-label.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.snap-toggle-label.disabled span:first-child {
    color: #999;
}

.measure-sidebar .measure-points {
    list-style: none;
    padding: 0;
    margin: 5px 0;
}
.measure-sidebar .measure-points li {
    margin: 3px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.measure-sidebar .measure-points li:hover {
    background: rgba(255, 255, 255, 0.25);
}

.measure-sidebar .measure-points .vertex-index {
    font-weight: bold;
    min-width: 20px;
}

.measure-sidebar .measure-points .vertex-distance {
    flex: 1;
    font-weight: 600;
}

.measure-sidebar .measure-points .segment-distance {
    font-size: 11px;
    color: #000000;
    /*opacity: 0.8;*/
    margin-left: 4px;
}


.measure-sidebar .measure-points .remove-vertice {
    background: none;
    border: none;
    cursor: pointer;
    color: red;
    font-weight: bold;
}

.measure-sidebar .measure-total {
    margin-top: 8px;
    font-weight: bold;
    color: #000;
}

/* Vertex and segment markers */
.vertex-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #FF5733;
    border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.vertex-highlight {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: yellow;
    border: 2px solid red;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.segment-label,
.area-label {
    font-size: 12px;
    font-weight: bold;
    color: red;
    text-align: center;

    /* White halo */
    text-shadow:
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff,
         0px  0px 2px #fff; /* softens the halo */
}

/* =========================
   MEASURE CLEAR BUTTON (Enhanced)
========================= */
.measure-sidebar .measure-clear {
    margin-top: 10px;
    width: 100%;
    padding: 6px 8px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);

    color: #d62f32; /* destructive hint */
    font-weight: bold;
    cursor: pointer;    

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    transition:
        background 0.2s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
}

.measure-sidebar .measure-clear:hover:not(:disabled) {
    background: rgba(255, 200, 200, 0.4);
}

.measure-sidebar .measure-clear:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

.measure-clear-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.7;
}

.measure-sidebar .measure-hint {
    margin: 8px 0;
    padding: 6px 8px;

    font-size: 13px;
    text-align: center;
    color: #333;

    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.5);

    pointer-events: none;
}

/* =========================
    PARCEL SEARCH SIDEBAR (Glassmorphism)
========================= */
#parcel-search-sidebar {
    position: fixed;
    top: 50px;               /* below top bar */
    left: -350px;            /* hidden initially */
    width: 320px;
    height: calc(100vh - 70px);

    margin-left: 5px;
    margin-top: 10px;
    margin-bottom: 10px;

    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);

    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;

    transition: left 0.5s ease;
    z-index: 1999;
}

/* Open state */
#parcel-search-sidebar.open {
    left: 0;
}

.search-header {
    font-size: 16px;
    margin-bottom: 4px;
    color: #000;
    flex-shrink: 0;
}

.search-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.8);
    letter-spacing: 0.3px;
}

.search-modes {
    display: flex;
    position: relative;       /* for pseudo-element positioning */
    gap: 5px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15); /* common background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* Glassmorphic highlight for search modes */
.search-modes::before {
    content: '';
    position: absolute;
    top: 2px;
    left: calc(var(--active-index, 0) * 25%);
    width: calc(25% - 4px);
    height: calc(100% - 4px);

    border-radius: 10px;

    /* Glass body */
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.5),
            rgba(255, 255, 255, 0.2)
        ),
        rgba(30, 90, 200, 0.5); /* darker, more opaque blue */

    /* Real glass effects */
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);

    /* Glass edges */
    border: 1px solid rgba(255, 255, 255, 0.7);

    /* Depth + light */
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.7),
        inset 0 -1px 1px rgba(255, 255, 255, 0.3),
        0 6px 18px rgba(30, 90, 200, 0.4);

    transition:
        left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s ease;

    z-index: 0;
}

.search-modes button {
    position: relative;       /* above pseudo-element */
    flex: 1;
    background: transparent;  /* let highlight show behind */
    border: none;
    padding: 6px 4px;
    cursor: pointer;
    color: #000;
    font-weight: bold;
    z-index: 1;               /* above pseudo-element */
    transition: color 0.3s ease;
    font-size: 12px;
}

.search-modes button.active {
    color: #2a7cff;
}

.search-modes button:hover {
    color: #2a7cff;
}

.search-panels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
    overflow-y: auto;
    max-height: fit-content;
    padding-right: 4px;
}

.search-panels::-webkit-scrollbar {
    width: 8px;
}

.search-panels::-webkit-scrollbar-track {
    background: transparent;
}

.search-panels::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.search-panels::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.search-panel {
    display: none;
    flex-direction: column;
    gap: 6px;
}

.search-panel.active {
    display: flex;
}

.search-panel select,
.search-panel input[type="text"] {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #000;
    font-size: 13px;
    transition: all 0.2s ease;
}

/* Cadastral search button should feel static even when filled */
#cadastral-search-btn:hover:not(:disabled) {
    background: linear-gradient(
        135deg,
        rgba(42, 124, 255, 0.7),
        rgba(42, 124, 255, 0.5)
    ) !important;
    box-shadow: none;
    cursor: default;
}

.search-panel select:hover,
.search-panel input[type="text"]:hover {
    background: rgba(255, 255, 255, 0.35);
}

.search-panel select:focus,
.search-panel input[type="text"]:focus {
    outline: none;
    border-color: #2a7cff;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 8px rgba(42, 124, 255, 0.3);
}

.search-panel button {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #000;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
    letter-spacing: 0.2px;
}

.search-panel button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.search-panel button:active {
    transform: translateY(1px);
}

.zoom-btn {
    padding: 4px 6px !important;
    font-size: 11px !important;
    min-width: fit-content;
}

/* =========================
   CADASTRAL ROWS LAYOUT
========================= */
.cadastral-row {
    display: flex;
    gap: 6px;
    align-items: center;
    position: relative;
}

.cadastral-row label {
    display: none;
}

/* Wrapper for select with label overlay */
.select-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

/* Inline loading spinner inside selects */
.select-loading-spinner {
    position: absolute;
    right: 8px;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    pointer-events: none;
}

.select-wrapper.loading .select-loading-spinner {
    opacity: 1;
}

/* Clear button for selects */
.select-clear-btn {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: color 0.2s ease, opacity 0.2s ease;
    z-index: 3;
}

.select-wrapper.has-value .select-clear-btn {
    opacity: 1;
    pointer-events: auto;
}

.select-clear-btn:hover {
    color: #000;
}

.select-label-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: rgba(0, 0, 0, 0.6);
    font-size: 12px;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
    max-width: calc(100% - 36px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.cadastral-row select,
.cadastral-row input[type="text"] {
    flex: 1;
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #000;
    font-size: 12px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.cadastral-row input[type="text"]::placeholder,
.search-panel input[type="text"]::placeholder {
    color: rgba(0, 0, 0, 0.6);
    opacity: 1;
}

.cadastral-row input[type="text"]:not(:placeholder-shown),
.search-panel input[type="text"]:not(:placeholder-shown) {
    color: #000;
}

.cadastral-row input[type="text"]:not(:placeholder-shown)::placeholder,
.search-panel input[type="text"]:not(:placeholder-shown)::placeholder {
    color: transparent;
}

.cadastral-row select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    padding-right: 28px;
}

/* Hide arrow when select has value (clear button is shown instead) */
.select-wrapper.has-value select {
    background-image: none;
}

.cadastral-row select option {
    color: #000;
}

.cadastral-row select:invalid {
    color: rgba(0, 0, 0, 0.6);
}

.cadastral-row select:invalid option {
    color: rgba(0, 0, 0, 0.6);
}

.cadastral-row select:valid {
    color: #000;
}

.cadastral-row select:hover {
    background-color: rgba(255, 255, 255, 0.35);
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
}

.select-wrapper.has-value select:hover {
    background-image: none;
}

.cadastral-row input[type="text"]:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

.cadastral-row select:focus {
    outline: none;
    border-color: #2a7cff;
    background-color: rgba(255, 255, 255, 0.4);
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    box-shadow: 0 0 8px rgba(42, 124, 255, 0.3);
}

.select-wrapper.has-value select:focus {
    background-image: none;
}

.cadastral-row input[type="text"]:focus {
    outline: none;
    border-color: #2a7cff;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 8px rgba(42, 124, 255, 0.3);
}

.cadastral-row .zoom-btn {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    transition: opacity 0.2s ease;
    min-width: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
}

.cadastral-row .zoom-btn:disabled {
    cursor: not-allowed;
    display: none !important;
    pointer-events: none;
}

.cadastral-row .zoom-btn:focus,
.cadastral-row .zoom-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.cadastral-row .zoom-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.7;
}

.cadastral-row .zoom-btn:hover:not(:disabled) img {
    opacity: 1;
}

.cadastral-row .zoom-btn:active {
    transform: none;
}

/* =========================
   PRIMARY SEARCH BUTTON
========================= */
.search-btn-primary {
    width: 100%;
    padding: 8px 12px !important;
    margin-top: 4px;
    background: linear-gradient(
        135deg,
        rgba(42, 124, 255, 0.7),
        rgba(42, 124, 255, 0.5)
    ) !important;
    border: 1px solid rgba(42, 124, 255, 0.8) !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-weight: bold !important;
    font-size: 13px !important;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(42, 124, 255, 0.3);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-btn-primary:hover {
    background: linear-gradient(
        135deg,
        rgba(42, 124, 255, 0.85),
        rgba(42, 124, 255, 0.65)
    ) !important;
    box-shadow: 0 6px 16px rgba(42, 124, 255, 0.4);
}

/* Cadastral search button should look static even when enabled */
#cadastral-search-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(42, 124, 255, 0.7),
        rgba(42, 124, 255, 0.5)
    ) !important;
    box-shadow: 0 4px 12px rgba(42, 124, 255, 0.3) !important;
    cursor: default !important;
    transform: none !important;
}

    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.search-btn-primary:disabled {
    background: rgba(150, 150, 150, 0.3) !important;
    border: 1px solid rgba(150, 150, 150, 0.4) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 0.6;
    pointer-events: none;
    transition: none !important;
}

.search-btn-primary:disabled:hover {
    background: rgba(150, 150, 150, 0.3) !important;
    box-shadow: none !important;
    transform: none !important;
}

.search-btn-primary:disabled:active {
    transform: none !important;
    box-shadow: none !important;
}

.search-warning-message {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(220, 50, 50, 0.6);
    color: #1a1a1a;
    font-size: 13px;
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 8px;
}

.search-results-loading {
    display: none;
    text-align: center;
    padding: 12px 8px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-results-loading.active {
    display: flex;
}

.search-results-loading .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.search-results ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

.search-results ul::-webkit-scrollbar {
    width: 8px;
}

.search-results ul::-webkit-scrollbar-track {
    background: transparent;
}

.search-results ul::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.search-results ul::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.search-results li {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-results li:hover {
    background: rgba(173, 216, 230, 0.5);
}

.search-results li.hovered {
    background: rgba(80, 160, 255, 0.3);
    border-color: #2a7cff;
}

#clear-parcel-results {
    padding: 6px 8px !important;
    width: 100%;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #d62f32;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#clear-parcel-results img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.8;
}

#clear-parcel-results:hover {
    background: rgba(255, 200, 200, 0.4) !important;
}

#clear-parcel-results:hover img {
    opacity: 1;
}

/* Address autocomplete suggestions */
.address-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    width: 100%;
}

#address-input {
    flex: 1;
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #000;
    font-size: 13px;
    transition: all 0.2s ease;
}

#address-input:hover {
    background: rgba(255, 255, 255, 0.35);
}

#address-input:focus {
    outline: none;
    border-color: #2a7cff;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 8px rgba(42, 124, 255, 0.3);
}

.address-clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.4);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.address-clear-btn:hover {
    color: rgba(0, 0, 0, 0.7);
}

.address-suggestions {
    list-style: none;
    padding: 0;
    margin: 0 !important;
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0 0 8px 8px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    max-height: 250px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    min-width: 300px;
}

.address-suggestions.active {
    display: block;
}

.address-suggestions li {
    padding: 10px 12px;
    cursor: pointer;
    color: #000;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-suggestions li:last-child {
    border-bottom: none;
}

.address-suggestions li:hover {
    background: rgba(42, 124, 255, 0.15);
}
}

.search-results-info {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(128, 128, 128, 0.2);
    border: 1px solid rgba(128, 128, 128, 0.4);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
}

.results-icon {
    margin-right: 4px;
    font-style: normal;
}

.results-message {
    margin: 0;
}

/* =========================
   INFO SIDEBAR STYLES
========================= */
.info-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50px;
    left: -450px;
    width: 400px;
    margin-left: 5px;
    margin-top: 10px;
    margin-bottom: 10px;
    bottom: 0px;

    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);

    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    transition: left 0.5s ease, width 0.5s ease;
    z-index: 2000;
}

.info-sidebar.open {
    left: 0;
    width: 450px;
}

.info-header {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
}

.info-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.info-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

.info-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px 8px;
}

.info-loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(0, 0, 0, 0.8);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    margin: 10px;
}

.info-loading p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.8);
}

.info-feature-loading {
    text-align: center;
    padding: 30px 20px;
    color: rgba(0, 0, 0, 0.8);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    margin: 10px 0;
}

.info-feature-loading p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.8);
}

.info-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 123, 255, 0.2);
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: info-spin 0.8s linear infinite;
}

@keyframes info-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info-prompt-message {
    text-align: center;
    padding: 60px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.info-prompt-message .info-prompt-icon {
    margin-bottom: 10px;
}

.info-prompt-message h3 {
    margin: 0;
    color: rgba(0, 0, 0, 0.8);
    font-size: 20px;
    font-weight: 600;
}

.info-prompt-message p {
    margin: 0;
    color: rgba(0, 0, 0, 0.7);
    font-size: 15px;
    line-height: 1.5;
    max-width: 350px;
}

.info-no-results,
.info-error {
    text-align: center;
    padding: 40px 20px;
    color: rgba(0, 0, 0, 0.6);
    font-size: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
}

.info-error {
    color: #d62f32;
    background: rgba(255, 200, 200, 0.3);
}

.info-layer-section {
    margin-bottom: 20px;
}

.info-layer-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.85);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(42, 124, 255, 0.15);
    border-radius: 8px;
    border-left: 3px solid rgba(42, 124, 255, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s ease;
}

.info-layer-title:hover {
    background: rgba(42, 124, 255, 0.25);
}

.info-layer-title-text {
    flex: 1;
}

.info-layer-collapse-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.info-layer-section.collapsed .info-layer-collapse-arrow {
    transform: rotate(-90deg);
}

.info-layer-section.collapsed .info-feature {
    display: none;
}

.info-feature {
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.info-feature-header {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.info-table th {
    text-align: left;
    padding: 6px 8px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.75);
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    width: 40%;
}

.info-table td {
    padding: 6px 8px;
    color: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 0;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

.info-table tr:hover {
    background: rgba(42, 124, 255, 0.08);
}

.info-template-content {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.8);
}

.info-template-content table {
    width: 100%;
    border-collapse: collapse;
}

.info-template-content table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-template-content table tr:last-child td {
    border-bottom: none;
}

.info-template-content strong {
    color: rgba(0, 0, 0, 0.85);
}

/* =========================
   MOBILE RESPONSIVE STYLES
========================= */
@media (max-width: 768px) {
    /* Info sidebar takes full width on mobile */
    .info-sidebar {
        left: -100%;
        width: 90%;
        max-width: 100vw;
        margin-left: 0;
        margin-right: 0;
        top: 50px;
        border-radius: 0;
    }
    
    .info-sidebar.open {
        left: 0;
        width: 90%;
    }
    
    /* Adjust info tables for mobile */
    .info-template-content table {
        font-size: 12px;
    }
    
    .info-template-content table td {
        padding: 4px 6px;
    }
    
    /* Make fiscal info tables scrollable horizontally if needed */
    .fiscal-section {
        overflow-x: auto;
    }
    
    /* Stack buttons vertically on very small screens */
    @media (max-width: 480px) {
        #top-bar {
            /* Keep consistent height */
            height: 50px;
        }
        
        .topbar-left-buttons,
        .topbar-right-buttons {
            flex-wrap: nowrap;
        }
        
        /* Make buttons touch-friendly */
        #top-bar button {
            min-width: 44px;
            min-height: 44px;
        }
        
        /* Info sidebar full width on very small screens */
        .info-sidebar {
            width: 100%;
            max-width: 100vw;
        }
        
        .info-sidebar.open {
            width: 100%;
        }
    }
}