/* Sotis Immobilier - Explorer Styles */

/* Main Container */
.immo-explorer {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-md);
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Header uses global .page-header from style.css */

/* Filters Panel */
.filters-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: flex-end;
}

.filters-selects {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.filters-options {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-xs);
    border-top: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--violet-primary);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-select:hover {
    border-color: var(--violet-dark);
}

.filter-select:focus {
    outline: none;
    border-color: var(--violet-dark);
    box-shadow: 0 0 0 2px rgba(192, 156, 240, 0.3);
}

/* Custom Select Dropdown - Immo specific overrides */
/* Base styles are in sotis_pj1_app1_core/css/style.css */

.filter-group {
    position: relative;
}

/* Immo-specific class aliases for backward compatibility */
.dropdown-search { /* alias for .custom-dropdown-search */ }
.dropdown-options { /* alias for .custom-dropdown-options */ }
.dropdown-option { /* alias for .custom-dropdown-option */ }
.dropdown-option-special { /* alias for .custom-dropdown-option-special */ }
.dropdown-group { /* alias for .custom-dropdown-group */ }
.dropdown-group-header { /* alias for .custom-dropdown-group-header */ }

/* Backward compatibility - map old classes to new ones */
.dropdown-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.dropdown-search svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.dropdown-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

.dropdown-search input::placeholder {
    color: var(--text-secondary);
}

.dropdown-options {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 0.25rem 0;
}

.dropdown-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-option:hover {
    background: rgba(192, 156, 240, 0.15);
}

.dropdown-option.selected {
    background: rgba(192, 156, 240, 0.25);
    font-weight: 500;
    color: var(--violet-dark);
}

.dropdown-option-special {
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--violet-dark);
    padding: 0.6rem 0.75rem;
}

.dropdown-option-special svg {
    width: 16px;
    height: 16px;
}

.dropdown-group {
    padding: 0;
}

.dropdown-group-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--violet-dark);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-group .dropdown-option {
    padding-left: 1.25rem;
}

/* Search Results (flat list when searching) */
.search-results {
    padding: 0.25rem 0;
}

.search-results .dropdown-option {
    justify-content: space-between;
}

.search-results .result-label {
    flex: 1;
}

.search-results .result-region {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(192, 156, 240, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    margin-left: 0.5rem;
    white-space: nowrap;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.filter-checkbox {
    min-width: auto;
    justify-content: flex-end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: rgba(192, 156, 240, 0.08);
    transition: var(--transition-fast);
}

.checkbox-label:hover {
    background: rgba(192, 156, 240, 0.18);
    border-color: var(--violet-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--violet-primary);
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--violet-dark);
    font-weight: 500;
}

/* Info Tooltip */
.checkbox-label.has-tooltip {
    position: relative;
}

.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
}

.info-icon {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    cursor: help;
    transition: var(--transition-fast);
}

.info-tooltip:hover .info-icon {
    color: var(--violet-dark);
}

.info-tooltip-text {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1A1A1A;
    color: #FFFFFF;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    width: 280px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

.info-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1A1A1A transparent transparent transparent;
}

.info-tooltip:hover .info-tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* Responsive tooltip */
@media (max-width: 480px) {
    .info-tooltip-text {
        width: 220px;
        left: auto;
        right: -10px;
        transform: none;
    }

    .info-tooltip-text::after {
        left: auto;
        right: 20px;
        transform: none;
    }
}

.filter-button {
    min-width: auto;
}

.btn-primary {
    background: var(--violet-dark);
    color: var(--white);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background: var(--violet-primary);
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--text-secondary);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--violet-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    text-align: center;
}

/* Stats Summary */
.stats-summary {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.stat-item {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    transition: var(--transition-fast);
}

.stat-item.updating {
    opacity: 0.5;
}

.stat-icon {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--violet-primary);
}

.stat-icon svg {
    vertical-align: middle;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--violet-dark);
    transition: var(--transition-fast);
}

/* Tabs */
.tabs-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 100%;
    width: 100%;
    contain: inline-size;
}

.tab-buttons {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: rgba(192, 156, 240, 0.08);
    border: none;
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(192, 156, 240, 0.2);
}

.tab-btn.active {
    color: var(--violet-dark);
    background: rgba(192, 156, 240, 0.25);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--violet-dark);
}

.tab-count {
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--violet-dark);
    color: var(--white);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    margin-left: 0.35rem;
}

.tab-btn.active .tab-count {
    background: var(--violet-primary);
    color: var(--dark-text);
}

.tab-count:empty {
    display: none;
}

.tab-content {
    display: none;
    padding: var(--space-md);
    max-width: 100%;
    overflow: hidden;
}

.tab-content.active {
    display: block;
}

/* Force content to respect container bounds */
#tab-commune {
    overflow-x: hidden;
}

/* Map */
.map-wrapper {
    position: relative;
}

#property-map {
    height: 500px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.map-legend {
    position: absolute;
    bottom: 20px;
    left: 15%;
    right: 15%;
    padding: 0.5rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.map-legend .legend-gradient {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.legend-bar {
    flex: 1;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, hsl(240, 70%, 50%), hsl(180, 70%, 50%), hsl(120, 70%, 50%), hsl(60, 70%, 50%), hsl(0, 70%, 50%));
}

.legend-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 60px;
}

.legend-label.min { text-align: left; }
.legend-label.max { text-align: right; }

/* Charts */
.chart-container {
    margin-bottom: var(--space-lg);
    max-width: 100%;
    overflow: hidden;
}

.chart-container h3 {
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 350px;
}

/* Data Table */
.stats-table-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.stats-table-container h3 {
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.table-wrapper {
    display: block;
    width: 100%;
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.data-table {
    min-width: 700px;
    width: max-content;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(192, 156, 240, 0.05);
}

.data-table td {
    color: var(--text-primary);
}

.data-table .price-cell {
    font-weight: 500;
}

.loading-cell {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--space-lg) !important;
}

/* Price gradient colors */
.price-low { background: rgba(0, 100, 255, 0.15); }
.price-medium { background: rgba(0, 200, 100, 0.15); }
.price-high { background: rgba(255, 100, 0, 0.15); }
.price-very-high { background: rgba(255, 0, 0, 0.15); }

/* Cluster Icons - colored by median price */
.price-cluster {
    background: transparent !important;
}

.cluster-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-weight: 600;
    font-size: 12px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.7;
}

.cluster-icon span {
    line-height: 1;
}

.cluster-default {
    background: var(--violet-primary);
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm);
}

.leaflet-popup-content {
    margin: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.leaflet-popup-content strong {
    color: var(--violet-dark);
}

/* Budget Calculator Panel */
.budget-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.budget-header h3 {
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.budget-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 var(--space-sm) 0;
}

.budget-info {
    display: block;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--gray-medium);
    margin-top: 0.25rem;
}

.budget-inputs {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
    flex-wrap: wrap;
}

.budget-input-group {
    flex: 1;
    min-width: 200px;
}

.budget-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.budget-field {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--violet-primary);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.budget-field:focus {
    outline: none;
    border-color: var(--violet-dark);
    box-shadow: 0 0 0 2px rgba(192, 156, 240, 0.3);
}

.input-with-unit .unit {
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-calculate {
    white-space: nowrap;
}

.budget-result {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.budget-result-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.budget-result-main .result-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.budget-result-main .result-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--violet-dark);
}

.budget-result-details h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: var(--space-sm) 0;
}

.budget-communes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.budget-commune-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(192, 156, 240, 0.08);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.budget-commune-item .commune-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.budget-commune-item .commune-surface {
    color: var(--violet-dark);
    font-weight: 600;
    margin: 0 var(--space-sm);
}

.budget-commune-item .commune-price-sqm {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Price Evolution */
.evolution-summary {
    margin-bottom: var(--space-sm);
}

.evolution-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.evolution-badge.evolution-up {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.evolution-badge.evolution-down {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

/* Top Communes */
.top-communes-container {
    margin-bottom: var(--space-lg);
}

.top-communes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.top-commune-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
}

.top-commune-card h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--violet-primary);
}

.top-cheapest h4 {
    border-bottom-color: #28a745;
}

.top-expensive h4 {
    border-bottom-color: #dc3545;
}

.top-commune-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.top-commune-item {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.top-commune-item:hover {
    background: rgba(192, 156, 240, 0.1);
}

.top-commune-item .rank {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--violet-primary);
    color: var(--dark-text);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.top-commune-item .commune-info {
    flex: 1;
    min-width: 0;
}

.top-commune-item .commune-name {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-commune-item .commune-postal {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.top-commune-item .commune-price {
    text-align: right;
    flex-shrink: 0;
}

.top-commune-item .price-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--violet-dark);
}

.top-commune-item .transaction-count {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.loading-text,
.no-data {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: var(--space-sm);
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .immo-explorer {
        padding: var(--space-sm);
    }

    .filters-selects {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-options {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .stats-summary {
        flex-direction: column;
        gap: var(--space-sm);
    }

    #property-map {
        height: 350px;
    }

    .map-legend {
        left: 10%;
        right: 10%;
        padding: 0.4rem 1rem;
        bottom: 10px;
    }

    .legend-label {
        min-width: 50px;
        font-size: 0.7rem;
    }

    .tab-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.85rem;
    }

    .tab-count {
        display: none;
    }

    .tab-content {
        padding: var(--space-sm);
    }

    .chart-container canvas {
        max-height: 250px;
    }

    /* Budget panel responsive */
    .budget-inputs {
        flex-direction: column;
    }

    .budget-input-group {
        width: 100%;
    }

    .btn-calculate {
        width: 100%;
    }

    /* Top communes responsive */
    .top-communes-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .immo-explorer {
        padding: var(--space-xs);
        max-width: 100vw;
        overflow-x: hidden;
    }

    .filters-panel {
        padding: var(--space-sm);
    }

    .filters-selects {
        grid-template-columns: 1fr;
    }

    .filter-select {
        font-size: 0.85rem;
    }

    .explorer-header h1 {
        font-size: 1.5rem;
    }

    .explorer-description {
        font-size: 0.95rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    #property-map {
        height: 300px;
    }

    .map-legend {
        left: 10px;
        right: 10px;
        padding: 0.4rem 0.75rem;
    }

    /* Table mobile fix */
    .tabs-container {
        max-width: calc(100vw - var(--space-xs) * 2);
    }

    .tab-content {
        padding: var(--space-sm);
    }

    .stats-table-container {
        max-width: 100%;
    }

    .table-wrapper {
        max-width: 100%;
        overflow-x: scroll;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

/* Leaflet Layer Control - Custom styling (fixed light mode) */
.leaflet-control-layers {
    border: 2px solid #E0E0E0 !important;
    border-radius: var(--radius-sm) !important;
    background: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(155, 122, 196, 0.15) !important;
    z-index: 400 !important; /* Below navbar dropdown (z-index: 1000+) */
}

.leaflet-control-layers-toggle {
    background-color: #FFFFFF !important;
    border-radius: var(--radius-sm) !important;
    width: 40px !important;
    height: 40px !important;
}

.leaflet-control-layers:hover {
    border-color: #9B7AC4 !important;
}

.leaflet-control-layers-expanded {
    padding: 0.5rem 0.75rem !important;
    min-width: 160px;
}

.leaflet-control-layers-list {
    margin: 0;
}

.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    margin: 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1A1A1A;
    transition: var(--transition-fast);
}

.leaflet-control-layers-base label:hover,
.leaflet-control-layers-overlays label:hover {
    color: #9B7AC4;
}

.leaflet-control-layers-base input,
.leaflet-control-layers-overlays input {
    accent-color: #C09CF0;
    width: 1rem;
    height: 1rem;
}

.leaflet-control-layers-separator {
    border-top: 1px solid #E0E0E0;
    margin: 0.5rem 0;
}

/* Leaflet Fullscreen Control */
.leaflet-control-fullscreen {
    z-index: 400 !important;
}

.leaflet-control-fullscreen.leaflet-bar {
    border: none !important;
    box-shadow: none !important;
}

.leaflet-control-fullscreen-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    background: #FFFFFF !important;
    border: 2px solid #E0E0E0 !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px rgba(155, 122, 196, 0.15);
}

.leaflet-control-fullscreen-button:hover {
    background: #9B7AC4 !important;
    border-color: #9B7AC4 !important;
}

.leaflet-control-fullscreen-button svg {
    width: 20px;
    height: 20px;
    stroke: #6B6B6B;
    transition: var(--transition-fast);
}

.leaflet-control-fullscreen-button:hover svg {
    stroke: #FFFFFF;
}

/* Fullscreen map styles - Native API */
#property-map:fullscreen,
#property-map:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
}

#property-map:fullscreen .map-legend,
#property-map:-webkit-full-screen .map-legend {
    bottom: 30px;
}

/* Fullscreen map styles - CSS Fallback for iOS/mobile */
body.fullscreen-active {
    overflow: hidden !important;
}

.map-fullscreen-fallback {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: var(--bg-primary);
}

.map-fullscreen-fallback #property-map {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
}

.map-fullscreen-fallback .map-legend {
    bottom: 30px;
}

/* Leaflet Clustering Toggle Control */
.leaflet-control-clustering {
    z-index: 400 !important;
}

.leaflet-control-clustering.leaflet-bar {
    border: none !important;
    box-shadow: none !important;
}

.leaflet-control-clustering-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    background: #FFFFFF !important;
    border: 2px solid #E0E0E0 !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px rgba(155, 122, 196, 0.15);
    position: relative;
}

.leaflet-control-clustering-button:hover {
    background: #9B7AC4 !important;
    border-color: #9B7AC4 !important;
}

.leaflet-control-clustering-button:hover svg {
    stroke: #FFFFFF;
}

.leaflet-control-clustering-button svg {
    width: 20px;
    height: 20px;
    stroke: #6B6B6B;
    transition: var(--transition-fast);
}

/* Active state - clustering enabled */
.leaflet-control-clustering-button.active {
    background: #9B7AC4 !important;
    border-color: #9B7AC4 !important;
}

.leaflet-control-clustering-button.active svg {
    stroke: #FFFFFF;
}

.leaflet-control-clustering-button.active:hover {
    background: #FFFFFF !important;
    border-color: #9B7AC4 !important;
}

.leaflet-control-clustering-button.active:hover svg {
    stroke: #9B7AC4;
}

/* Clustering Tooltip */
.clustering-tooltip {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: #1A1A1A;
    color: #FFFFFF;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.clustering-tooltip::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #1A1A1A;
}

/* Tooltip visible state */
.clustering-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* Tooltip on hover */
.leaflet-control-clustering:hover .clustering-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Auto-show animation for first appearance */
.clustering-tooltip.auto-show {
    animation: tooltipPulse 2s ease-in-out;
}

@keyframes tooltipPulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.02); }
}
