/* Dubai Real Estate & Construction Map Style Sheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-blue: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Sidebar Layout (Floating Dashboard Card) */
.sidebar {
    position: absolute;
    left: 24px;
    top: 24px;
    width: 380px;
    height: calc(100% - 48px);
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transition: height var(--transition-normal), max-height var(--transition-normal);
    overflow: hidden;
}

.sidebar.collapsed {
    height: 65px; /* height of header */
}

.sidebar-body-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: calc(100% - 65px);
    overflow: hidden;
}

.sidebar-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

/* Sidebar Toggle inside Header */
.sidebar-toggle-in-header {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-toggle-in-header:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar.collapsed .sidebar-toggle-in-header svg {
    transform: rotate(180deg);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 11px;
    line-height: 1.2;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
}

.metric-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.metric-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 15px;
    font-weight: 700;
    color: white;
}

.metric-value.highlight-green {
    color: var(--accent-emerald);
}

.metric-value.highlight-blue {
    color: var(--accent-blue);
}

/* Search Section (Fixed above filters) */
.search-section {
    padding: 12px 20px 0 20px;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input-wrapper {
    flex-grow: 1;
}

/* Filters Panel Toggle Button (Inline Icon) */
.btn-toggle-filters-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    flex-shrink: 0;
}

.btn-toggle-filters-icon:hover {
    background-color: rgba(15, 23, 42, 0.85);
    color: white;
    border-color: rgba(59, 130, 246, 0.6);
}

.btn-toggle-filters-icon.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

/* Compact Filter Row */
.filter-row-compact {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* Filters Panel */
.filters-section {
    padding: 6px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    opacity: 1;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.35s ease;
    overflow: hidden;
}

.filters-section.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 10px 12px 10px 38px;
    color: white;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.select-dropdown {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    color: white;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    transition: border-color var(--transition-fast);
}

.select-dropdown:focus {
    border-color: var(--accent-blue);
}

/* Status Buttons */
.status-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.btn-status {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-status:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-status.active {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Range Slider */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.range-slider {
    width: 100%;
    height: 6px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 3px;
    outline: none;
    appearance: none;
}

.range-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    transition: transform 0.1s;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}



/* Crawler Footer Section */
.crawler-section {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.45);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.crawler-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 6px var(--accent-emerald);
}

.sync-dot.syncing {
    background-color: var(--accent-amber);
    box-shadow: 0 0 6px var(--accent-amber);
    animation: pulse 1s infinite alternate;
}

.crawler-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn-crawl {
    flex: 1;
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    border: none;
    border-radius: 8px;
    padding: 8px;
    color: white;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-crawl:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-crawl:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Map Display Area */
.map-container {
    flex-grow: 1;
    height: 100%;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
}

/* Custom Leaflet Styling */
.leaflet-bar {
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: white !important;
    border-bottom: 1px solid var(--border-color) !important;
    backdrop-filter: blur(8px);
}

.leaflet-bar a:hover {
    background-color: var(--bg-card-hover) !important;
}

/* Details Panel (Slide-out Drawer) */
.details-panel {
    position: absolute;
    right: -420px;
    top: 0;
    width: 400px;
    height: 100%;
    background-color: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.details-panel.open {
    right: 0;
}

.details-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.details-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
}

.details-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.details-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-close-details {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-close-details:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

.details-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Details Section Widgets */
.detail-widget {
    background-color: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-widget-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress circular or bar indicator */
.progress-bar-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-bar-wrapper {
    width: 100%;
    height: 10px;
    background-color: rgba(15, 23, 42, 0.8);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(95deg, var(--accent-blue), var(--accent-emerald));
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-value {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}

.progress-status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-completed {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-construction {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-cancelled {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Info List Grid */
.info-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

/* Transaction List Table */
.transaction-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.transaction-table th {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.transaction-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: white;
}

.transaction-table tr:last-child td {
    border-bottom: none;
}

.txn-type-badge {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.txn-type-sale {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.txn-type-mortgage {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.txn-value {
    font-family: monospace;
    font-weight: 600;
}

/* Custom Leaflet Marker Styles */
.custom-marker {
    background: none;
    border: none;
}

.marker-pin {
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    background: var(--accent-blue);
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.marker-pin::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    position: absolute;
}

.marker-pin.completed {
    background: var(--accent-emerald);
}

.marker-pin.construction {
    background: var(--accent-amber);
}

.marker-pin:hover {
    transform: rotate(-45deg) scale(1.25);
}

/* Cluster markers */
.custom-cluster {
    background-color: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(8px);
    border: 2px solid var(--accent-blue) !important;
    border-radius: 50%;
    color: white !important;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-cluster.completed-heavy {
    border-color: var(--accent-emerald) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 0.4;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.spin {
    animation: rotate 1s linear infinite;
}

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

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Media Carousel styling */
.media-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    margin-top: 4px;
}

.media-carousel-item {
    flex: 0 0 82%;
    scroll-snap-align: start;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    aspect-ratio: 16/10;
    background-color: #000;
}

.media-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.media-carousel-item img:hover {
    transform: scale(1.05);
}

.media-carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 8px 12px;
    font-size: 11px;
    color: white;
    font-weight: 500;
    backdrop-filter: blur(2px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999; /* overlay above everything, Leaflet z-index is up to 1000 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.25s ease;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-modal.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    display: block;
    width: 85vw;
    height: 75vh;
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-modal.show .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    color: #f8fafc;
    font-size: 30px;
    font-weight: 300;
    transition: var(--transition-fast);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close:hover {
    color: var(--accent-rose);
    background-color: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.2);
}

.lightbox-caption {
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
}

/* Sidebar Tabs Navigation */
.sidebar-tabs {
    display: flex;
    background-color: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin: 8px 20px;
    padding: 4px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: 1px solid transparent;
    padding: 10px 4px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 10px;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color var(--transition-normal), transform var(--transition-normal);
}

.tab-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.tab-btn:hover svg {
    color: white;
    transform: translateY(-1px);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.05));
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 12px rgba(59, 130, 246, 0.15);
}

.tab-btn.active svg {
    color: var(--accent-blue);
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.5));
}

/* Sidebar Tab Content panels */
.sidebar-tab-content {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    height: 0;
    min-height: 0;
    overflow: hidden;
}

/* Sidebar Collapse Toggle Button */
.sidebar-toggle {
    position: absolute;
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 60px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 12px 12px 0;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: all var(--transition-normal);
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.3);
    outline: none;
}

.sidebar-toggle:hover {
    color: white;
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 6px 0 15px rgba(59, 130, 246, 0.3);
    right: -26px;
    width: 26px;
}

.sidebar-toggle svg {
    transition: transform var(--transition-normal);
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-tab-content.active {
    display: flex;
}

.tab-scroll-container {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Broker Cards */
.broker-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.broker-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}

.broker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.broker-name-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.broker-license {
    font-size: 10px;
    color: var(--text-muted);
    font-family: monospace;
}

.broker-rating-badge {
    color: var(--accent-amber);
    font-size: 12px;
    font-weight: 600;
}

.broker-company {
    font-size: 12px;
    color: var(--text-secondary);
}

.broker-specialty {
    font-size: 11px;
    color: var(--accent-blue);
    font-style: italic;
}

.broker-contact-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    padding-top: 6px;
}

/* Rental Results Card */
.rental-results-card {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 14px;
    padding: 16px;
    margin-top: 10px;
}

.rental-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.rental-metric-row:last-child {
    margin-bottom: 0;
}

.rental-metric-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.rental-metric-value {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.rental-metric-sub {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

/* No Media Placeholder style */
#widget-no-media {
    border-style: dashed !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    background-color: transparent !important;
    padding: 24px 16px !important;
}

/* Media tabs button active states inside visual showcase */
.media-header-tabs .btn-status {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.media-header-tabs .btn-status.active {
    background-color: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Primary showcase transitions */
.primary-showcase-container {
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.primary-showcase-container:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: var(--shadow-lg);
}

.primary-showcase-container img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-showcase-container:hover img {
    transform: scale(1.03);
}

/* Toast Notifications Container */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 90%;
    width: 380px;
}

.toast {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: toast-fade-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.25s, transform 0.25s;
}

.toast.hide {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
}

.toast-success {
    border-left: 4px solid var(--accent-emerald);
}
.toast-success .toast-icon {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.toast-error {
    border-left: 4px solid var(--accent-rose);
}
.toast-error .toast-icon {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

.toast-warning {
    border-left: 4px solid var(--accent-amber);
}
.toast-warning .toast-icon {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.toast-info {
    border-left: 4px solid var(--accent-blue);
}
.toast-info .toast-icon {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.toast-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.toast-message {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    transition: color var(--transition-fast);
    line-height: 1;
}

.toast-close:hover {
    color: white;
}

@keyframes toast-fade-in {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Map Loader Overlay */
.map-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.map-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid var(--border-color);
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

/* No Image Placeholder */
.no-image-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    aspect-ratio: 16/10;
    background: rgba(15, 23, 42, 0.25);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 24px;
}

.no-image-placeholder svg {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
}

/* Share Button Sizing */
.btn-share-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    padding: 3px 8px;
    color: var(--accent-emerald);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.btn-share-compact:hover {
    background: rgba(16, 185, 129, 0.25);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-share-compact svg {
    fill: currentColor;
}

/* --- MOBILE RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    /* Bottom Sheet Sidebar for Mobile */
    .sidebar {
        position: absolute;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        height: 50vh;
        border-right: none;
        border-top: 1px solid var(--border-color);
        transition: transform var(--transition-normal);
        margin-left: 0 !important;
        transform: translateY(0);
    }

    .sidebar.collapsed {
        transform: translateY(calc(100% - 50px));
    }

    .sidebar.collapsed .sidebar-toggle-in-header svg {
        transform: rotate(0deg) !important;
    }

    .sidebar:not(.collapsed) .sidebar-toggle-in-header svg {
        transform: rotate(180deg) !important;
    }

    /* Compact Layout adjustments */
    .sidebar-header {
        padding: 8px 16px;
    }

    .brand-logo-img {
        width: 32px;
        height: 32px;
    }

    .brand-title {
        font-size: 16px;
    }

    .brand-subtitle {
        font-size: 9px;
    }

    .sidebar-tabs {
        margin: 6px 12px;
        border-radius: 10px;
    }

    .tab-btn {
        padding: 6px 2px;
    }

    .tab-btn svg {
        width: 15px;
        height: 15px;
    }

    .metrics-grid {
        padding: 8px 12px;
        gap: 4px;
    }

    .metric-card {
        padding: 4px 6px;
    }

    .search-section {
        padding: 8px 12px 0 12px;
    }

    .filters-section {
        padding: 4px 12px;
    }

    .crawler-section {
        padding: 8px 12px;
    }

    /* Bottom Sheet Details Panel for Mobile */
    .details-panel {
        position: absolute;
        bottom: 0;
        top: auto;
        right: auto;
        left: 0;
        width: 100%;
        height: 85vh;
        border-left: none;
        border-top: 1px solid var(--border-color);
        transform: translateY(100%);
        transition: transform var(--transition-normal);
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.4);
    }

    .details-panel.open {
        transform: translateY(0);
        right: auto;
    }

    .details-header {
        padding: 16px;
    }

    .details-content {
        padding: 16px;
        gap: 16px;
    }

    /* Map zoom placement shift to prevent overlap */
    .leaflet-top.leaflet-right {
        top: 10px !important;
    }
}

/* --- LOGIN WIDGET AND OVERLAY --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px 30px;
    width: 380px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-logo {
    width: 65px;
    height: 65px;
    margin: 0 auto 5px auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.login-card .form-group {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.login-card .form-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}

.login-card .form-group input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
}

.login-card .form-group input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    transition: all var(--transition-fast);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}

.login-error {
    color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.25);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
}

/* --- CLIENT FEEDBACK WIDGET --- */
.feedback-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    font-family: inherit;
}

.feedback-pulse-btn {
    background: linear-gradient(135deg, var(--accent-amber), #d97706);
    border: none;
    border-radius: 30px;
    color: white;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: transform 0.2s ease;
}

.feedback-pulse-btn:hover {
    transform: translateY(-2px);
}

.feedback-pulse-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.pulse-ring {
    border: 3px solid var(--accent-amber);
    border-radius: 30px;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: pulsate 1.8s ease-out infinite;
    opacity: 0;
    pointer-events: none;
    box-sizing: border-box;
}

@keyframes pulsate {
    0% {
        transform: scale(1, 1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.25, 1.45);
        opacity: 0;
    }
}

.feedback-form-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    width: 280px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feedback-form-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: white;
}

.stars-rating {
    display: flex;
    gap: 6px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    margin: 5px 0;
}

.star-item {
    transition: color 0.15s ease, transform 0.1s ease;
}

.star-item:hover {
    transform: scale(1.15);
}

.star-item.hover,
.star-item.selected {
    color: var(--accent-amber);
}

#feedback-comment {
    width: 100%;
    height: 70px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    resize: none;
    transition: border-color var(--transition-fast);
}

#feedback-comment:focus {
    border-color: var(--accent-amber);
}

.btn-submit-feedback {
    background: var(--accent-amber);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-submit-feedback:hover {
    opacity: 0.9;
}

/* --- LOGOUT BUTTON --- */
.btn-logout {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

/* --- MODAL DIALOGS (MAGIC LINK) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    width: 350px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

/* --- MAGIC LINK REPORT CARDS --- */
.magic-link-report-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.magic-link-report-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- SIDEBAR FOOTER STATUS BAR --- */
.sidebar-footer-status {
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.45);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.status-role {
    font-family: inherit;
    font-weight: 600;
    color: white;
}

.status-actions {
    display: flex;
    gap: 8px;
}

.btn-status-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-status-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-status-action svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.btn-minimal-magic {
    opacity: 0.75;
    transition: all 0.2s ease-in-out;
}

.btn-minimal-magic:hover {
    opacity: 1;
    transform: scale(1.15);
    color: var(--accent-amber, #f59e0b) !important;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
}

.modal-tab-btn {
    background: none !important;
    border: none !important;
    color: var(--text-secondary) !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-tab-btn:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.modal-tab-btn.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

