/* ==========================
   GLOBAL LAYOUT
========================== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fa;
    height: 100vh;
    overflow: hidden;
}

/* Main wrapper for side-by-side panels */
.main-wrapper {
    display: flex;
    height: calc(100vh - 60px); /* Subtract header height */
}

/* Map panel on RIGHT side */
#mapPanel {
    flex: 2;
    background: #ffffff;
    height: 100%;
    position: relative;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* ==========================
   CONTROL PANEL (LEFT SIDE)
========================== */
#controls {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    background: #ffffff;
    border-right: 1px solid #ddd;
    height: 100%;
}

/* ==========================
   TOP HEADER (Spans both panels)
========================== */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 2px solid #ddd;
    gap: 20px;
    height: 60px;
}

.header-brand {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    white-space: nowrap;
}

.header-brand img {
    width: 40px;
    margin-right: 10px;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 600px;
}

.header-search input {
    flex: 1;
    min-width: 200px;
}

.header-search button {
    flex-shrink: 0;
}

/* ==========================
   CARD
========================== */
.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-title {
    font-weight: bold;
    margin-bottom: 8px;
}

/* ==========================
   ROW
========================== */
.row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ==========================
   INPUTS
========================== */
input, select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

/* ==========================
   BUTTONS
========================== */
button {
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
    padding: 5px 10px;
}

button:hover {
    background: #e0e0e0;
}

/* ==========================
   FILTER CONTAINER
========================== */
#filtersContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================
   FILTER ROW
========================== */
.filter-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fafafa;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* top row */
.filter-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.filter-top > div {
    flex: 1;
}

/* bottom row */
.filter-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* label */
.filter-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

/* value label */
.filter-value {
    min-width: 60px;
    text-align: right;
    font-size: 12px;
    color: #666;
}

/* select fix */
.filter-row select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* delete button */
.filter-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
    padding: 0;
}

/* slider */
.slider-container {
    flex: 1;
}

/* Modern slider styling */
.noUi-target {
    background: #e8e8e8 !important;
    border: none !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !important;
    height: 6px !important;
}

.noUi-connect {
    background: linear-gradient(90deg, #4a90e2, #357abd) !important;
    box-shadow: none !important;
}

.noUi-handle {
    width: 16px !important;
    height: 16px !important;
    right: -8px !important;
    top: -5px !important;
    border-radius: 50% !important;
    background: #4a90e2 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    cursor: grab !important;
}

.noUi-handle:active {
    cursor: grabbing !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none !important;
}

/* Clear × button */
.clear-x-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 20px;
    border-radius: 3px;
    transition: all 0.2s;
}

.clear-x-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* results */
#resultSelect {
    width: 100%;
    height: 90px;
    border: none;
    background: transparent;
    padding: 0;
    outline: none;
}

/* Selected property panel */
#selectedPropertyCard {
    background: #f0f8ff;
    border-color: #4a90e2;
}

#selectedPropertyContent {
    padding: 8px 0;
}

/* Search status */
#searchStatus {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    min-width: 100px;
}

/* Browse status */
#browseStatus {
    font-style: italic;
}

/* footer */
.footer-controls {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

/* ==========================
   CLUSTER ICONS
========================== */
.custom-cluster-icon {
    background: transparent !important;
    border: none !important;
}

.cluster-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3388ff;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cluster-count {
    color: white;
    font-weight: bold;
    font-size: 14px;
    transition: font-size 0.2s ease;
}

/* Hover effects */
.custom-cluster-icon:hover .cluster-icon {
    background: #5fa3ff;
    box-shadow: 0 3px 12px rgba(51, 136, 255, 0.5);
    transform: scale(1.1);
}

.custom-cluster-icon:hover .cluster-count {
    font-size: 16.8px; /* 20% bigger: 14 * 1.2 = 16.8 */
}