html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.full-map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
}

/* Navigation Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Mobile responsive navbar */
@media (max-width: 768px) {
    .navbar-nav .nav-link .nav-text {
        display: none; /* Hide text on mobile, show only icons */
    }
    
    .navbar-nav .nav-link {
        margin: 0 0.5rem;
        padding: 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: #1a1a1a;
    text-decoration: none;
}

.brand-text {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    color: #666;
    font-weight: 500;
    margin: 0 1rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .nav-link:hover {
    color: #22c55e;
}

.navbar-nav .nav-link i {
    font-size: 1rem;
}

.navbar-nav .nav-link .nav-text {
    display: inline;
}

.navbar-toggler {
    border: none;
    color: #1a1a1a;
    font-size: 1.2rem;
    background: white;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-toggler:focus {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    outline: none;
}

/* Adjust map top to account for navbar */
.full-map {
    top: 76px; /* Height of navbar */
    height: calc(100vh - 76px);
}

/* Adjust top controls for navbar */
.map-top-controls {
    top: 96px; /* navbar height + 20px margin */
}

.floating-panel {
    position: fixed;
    top: 96px; /* navbar height + 20px margin */
    left: 20px; /* Changed from right to left */
    width: 400px;
    max-height: calc(80vh - 76px); /* Account for navbar */
    min-height: 200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    resize: vertical;
    z-index: 1000;
}

.floating-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Resize handle for desktop */
.floating-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, #9333ea, #7c3aed, #9333ea);
    border-radius: 2px;
    cursor: ns-resize;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.floating-panel:hover::after {
    opacity: 1;
}

.floating-panel.minimized::after {
    display: none;
}

.floating-panel.minimized {
    width: 48px;
    height: 48px;
    max-height: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.95), rgba(75, 85, 99, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 96px; /* navbar height + 20px margin */
    right: 20px; /* Changed from left to right */
    left: auto;
    z-index: 1001;
}

.floating-panel.minimized:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(147, 51, 234, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.floating-panel.minimized .panel-content {
    display: none;
}

.floating-panel.minimized .panel-header {
    display: none;
}

/* Hide panel controls when panel is minimized */
.floating-panel.minimized .panel-controls {
    display: none;
}

/* Home button removed - now in navbar */

.floating-panel.minimized .search-icon-minimized {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
    font-size: 16px;
}

/* Search icon hidden by default */
.search-icon-minimized {
    display: none;
}

/* Panel header - Gen Z friendly */
.panel-header {
    padding: 20px 24px 16px 24px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(124, 58, 237, 0.1));
    border-bottom: 1px solid rgba(147, 51, 234, 0.2);
    position: relative;
}

.panel-content {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    background: transparent;
}

.panel-controls {
    position: absolute;
    top: 80px;
    right: 16px;
    display: flex;
    gap: 4px;
    z-index: 1002;
}

/* Panel buttons - Gen Z friendly */
.panel-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
    opacity: 0.8;
}

.panel-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
    opacity: 1;
}

.panel-btn:active {
    transform: scale(0.95);
}

/* Home button styling */
.panel-btn.home-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.panel-btn.home-btn:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.panel-btn.home-btn:hover {
    transform: scale(1.1);
}

/* Home button removed - now in navbar */

/* Home button hover removed - now in navbar */

.panel-btn:hover {
    background-color: #e8eaed;
    transform: scale(1.05);
}

.panel-btn:active {
    transform: scale(0.95);
}

/* House list container - Gen Z friendly */
.house-list-container {
    max-height: 320px;
    min-height: 80px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 16px;
    scrollbar-width: thin;
    scrollbar-color: #9333ea #f3f4f6;
    margin-bottom: 16px;
    flex-shrink: 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(147, 51, 234, 0.05);
    border: 1px solid rgba(147, 51, 234, 0.1);
}

/* Property info section - Gen Z friendly */
#property-info {
    flex-grow: 1;
    overflow-y: auto;
    margin-top: 16px;
    position: relative;
    max-height: calc(100vh - 450px);
    min-height: 200px;
    border-top: 1px solid rgba(147, 51, 234, 0.2);
    padding-top: 16px;
    background: rgba(147, 51, 234, 0.02);
    border-radius: 16px;
}

#property-info::before {
    content: 'Property Details';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

/* Property sections - Gen Z friendly */
.property-section {
    margin-bottom: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(147, 51, 234, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.property-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.1);
    border-color: rgba(147, 51, 234, 0.2);
}

.property-section:first-child {
    border-top: 3px solid #9333ea;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.05), rgba(124, 58, 237, 0.05));
}

.property-section h4 {
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(147, 51, 234, 0.2);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

@media (max-width: 768px) {
    .floating-panel {
        position: fixed;
        top: 96px; /* navbar height + 20px margin */
        left: 10px;
        right: 10px;
        width: auto;
        height: calc(100vh - 116px); /* Fill full height minus navbar and margins */
        max-height: calc(100vh - 116px); /* Fill full height */
        min-height: 400px;  /* Increased minimum height for mobile */
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        background-color: white;
        resize: none;  /* Disable resize on mobile */
    }
    
    /* Hide resize handle on mobile */
    .floating-panel::after {
        display: none;
    }

    .floating-panel.minimized {
        width: 64px;
        height: 64px;
        max-height: 64px;
        min-height: 64px;  /* Override min-height for minimized state */
        top: 96px; /* navbar height + 20px margin */
        right: 10px; /* Changed from left to right */
        left: auto;
        border-radius: 32px;
    }

    .panel-header {
        padding: 8px 15px 0 15px;
    }

    .panel-controls {
        top: 8px;
        right: 8px;
    }

    .panel-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .panel-content {
        padding: 0 15px 12px 15px;
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .mapboxgl-ctrl-geocoder {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        min-width: auto;
        max-width: 100%;
        font-size: 16px;
        height: 44px;
    }

    .mapboxgl-ctrl-geocoder--input {
        height: 44px;
        font-size: 16px;
        padding: 8px 12px;
    }

    .house-list-container {
        max-height: 40vh;  /* Use viewport height instead of fixed pixels */
        min-height: 80px;   /* Minimum height for 1 entry on mobile */
        margin-bottom: 10px;
        transition: height 0.3s ease;  /* Smooth height transitions */
        flex-shrink: 0; /* Prevent shrinking */
    }

    .house-list-item {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 8px;
    }

    .house-address {
        font-size: 14px;
        line-height: 1.3;
    }

    .house-details {
        font-size: 12px;
        margin-top: 8px;
    }

    .house-details .price {
        font-size: 16px;
        font-weight: 600;
    }

    .house-details .property-type {
        font-size: 14px;
    }

    .house-details .date {
        font-size: 12px;
    }

    .house-details .source-db {
        font-size: 12px;
    }

    #property-info {
        max-height: calc(100vh - 450px); /* Use more of the available height */
        margin-top: 10px;
        padding-top: 10px;
        flex: 1; /* Allow it to grow and fill available space */
    }

    #property-info::before {
        font-size: 11px;
        padding: 1px 12px;
    }

    .property-section {
        margin-bottom: 15px;
        padding: 12px;
        border-radius: 8px;
        background-color: #f8f9fa;
        border: 1px solid #e0e0e0;
    }
    
    .property-section:first-child {
        border-top: 2px solid #22c55e;
    }

    .property-section h4 {
        font-size: 16px;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .property-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 0;
    }

    .property-label {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .property-value {
        font-size: 14px;
        text-align: left;
        margin-top: 2px;
    }

    .mapboxgl-popup {
        max-width: 280px !important;
    }

    .mapboxgl-popup-content {
        padding: 15px;
        border-radius: 12px;
    }

    .popup-content h5 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .popup-buttons {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }

    .analysis-btn, .epc-btn, .download-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
        justify-content: center;
        background-color: #22c55e;
        color: white;
    }
    
    .analysis-btn:hover, .epc-btn:hover, .download-btn:hover {
        background-color: #16a34a;
    }

    .popup-details {
        margin-top: 10px;
    }

    .popup-section {
        margin-bottom: 10px;
        font-size: 13px;
    }

    .custom-marker {
        transform: scale(0.9);
    }

    .marker-price {
        font-size: 11px;
        padding: 4px 6px;
        border-radius: 6px;
    }

    .analysis-popup-content {
        width: 90%;
        max-width: 350px;
        max-height: 80vh;
        padding: 20px;
        border-radius: 16px;
    }

    .analysis-popup-content h4 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .analysis-section {
        margin-bottom: 15px;
    }

    .analysis-section h5 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .analysis-item {
        padding: 8px 0;
        font-size: 14px;
    }

    .analysis-item .label {
        font-size: 13px;
    }

    .analysis-item .value {
        font-size: 14px;
    }

    .property-popup-content {
        width: 95%;
        max-width: 400px;
        max-height: 85vh;
        padding: 20px;
        border-radius: 16px;
    }

    .price-legend {
        bottom: 10px;
        left: 10px;
        padding: 8px;
        border-radius: 8px;
    }

    .price-legend-title {
        font-size: 12px;
    }

    .price-legend-gradient {
        width: 150px;
        height: 15px;
    }

    .price-legend-labels {
        font-size: 10px;
    }

    .spinner-border {
        width: 2rem;
        height: 2rem;
    }

    #postcode-loading {
        padding: 20px;
    }

    .analysis-loading {
        padding: 20px;
        text-align: center;
    }

    .analysis-loading p {
        font-size: 14px;
        margin: 10px 0;
    }

    .alert {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 8px;
        font-size: 14px;
    }

    .map-loading-overlay {
        padding: 20px;
    }

    .map-loading-content {
        padding: 20px;
        border-radius: 16px;
        max-width: 300px;
    }

    .map-loading-text {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .map-loading-subtext {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .map-loading-progress {
        margin-top: 15px;
    }

    .map-loading-progress-bar {
        height: 6px;
        border-radius: 3px;
    }

    .chart-bar {
        width: 15px;
        min-height: 20px;
    }

    .chart-bar-container {
        width: 30px;
    }

    .chart-price-label {
        font-size: 9px;
        transform: rotate(-45deg);
        transform-origin: top left;
    }

    .chart-date-label {
        font-size: 10px;
    }

    .price-history-table {
        font-size: 12px;
    }

    .price-history-table th,
    .price-history-table td {
        padding: 6px 4px;
    }

    .recommendations-list {
        margin-top: 15px;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    .floating-panel {
        top: 5px;
        left: 5px;
        right: 5px;
        height: calc(100vh - 10px); /* Fill full height minus margins */
        max-height: calc(100vh - 10px); /* Fill full height */
        resize: none;  /* Disable resize on extra small mobile */
    }
    
    /* Hide resize handle on extra small mobile */
    .floating-panel::after {
        display: none;
    }
    .panel-header h1 {
        font-size: 1.3rem;
    }
    .house-list-container {
        max-height: 35vh;  /* Use viewport height for extra small mobile */
        flex-shrink: 0; /* Prevent shrinking */
    }
    .house-list-item {
        padding: 10px;
    }
    .house-address {
        font-size: 13px;
    }
    .house-details .price {
        font-size: 15px;
    }
    .mapboxgl-popup {
        max-width: 250px !important;
    }
    .mapboxgl-popup-content {
        padding: 12px;
    }
    .analysis-popup-content,
    .property-popup-content {
        width: 95%;
        padding: 15px;
    }
    .price-legend {
        bottom: 5px;
        left: 5px;
        right: auto;
        padding: 4px;
        font-size: 10px;
        min-width: 0;
        max-width: 90vw;
    }
    .price-legend-gradient {
        width: 100px;
        height: 10px;
    }
    .price-legend-labels {
        font-size: 9px;
    }
    .price-legend-title {
        font-size: 11px;
    }
    
    /* Extra small mobile home button */
    /* Home button removed - now in navbar */
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .floating-panel {
        top: 96px; /* navbar height + 20px margin */
        height: calc(100vh - 116px); /* Fill full height minus navbar and margins */
        max-height: calc(100vh - 116px); /* Fill full height */
        resize: none;  /* Disable resize on landscape mobile */
    }
    
    /* Hide resize handle on landscape mobile */
    .floating-panel::after {
        display: none;
    }
    .house-list-container {
        max-height: 30vh;  /* Use viewport height for landscape */
        flex-shrink: 0; /* Prevent shrinking */
    }
    #property-info {
        max-height: calc(100vh - 350px); /* Use more of the available height in landscape */
        flex: 1; /* Allow it to grow and fill available space */
    }
    .analysis-popup-content,
    .property-popup-content {
        max-height: 70vh;
    }
    
    /* Home button removed - now in navbar */
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .panel-btn:hover {
        transform: none;
    }
    .analysis-btn:hover,
    .epc-btn:hover,
    .download-btn:hover {
        transform: none;
    }
    .house-list-item:hover {
        background-color: #f8f9fa;
    }
    .custom-marker:hover .marker-price {
        transform: none;
    }
    /* Increase touch targets */
    .panel-btn {
        min-width: 44px;
        min-height: 44px;
    }
    .analysis-btn,
    .epc-btn,
    .download-btn {
        min-height: 44px;
    }
    .house-list-item {
        min-height: 60px;
    }
    /* Home button removed - now in navbar */
    /* Improve scrolling */
    .house-list-container,
    #property-info,
    .analysis-popup-content,
    .property-popup-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* High DPI Mobile Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .marker-price {
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    .floating-panel {
        border: 1px solid rgba(0, 0, 0, 0.05);
    }
}

/* Smooth scrolling for property info */
#property-info {
    scroll-behavior: smooth;
}

/* Add a subtle animation when property details appear */
#property-info:not(.d-none) {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    background-color: #f5f7fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.container {
    max-width: 1200px;
    padding: 0 15px;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.card-body {
    padding: 25px;
}

h1 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 30px;
}

.form-control {
    height: 50px;
    border-radius: 8px;
    padding-left: 15px;
    border-color: #e1e5eb;
    font-size: 16px;
    box-shadow: none;
}

.form-control:focus {
    border-color: #4a89dc;
    box-shadow: 0 0 0 3px rgba(74, 137, 220, 0.15);
}

.btn-primary {
    background-color: #4a89dc;
    border-color: #4a89dc;
    height: 50px;
    border-radius: 8px;
    font-weight: 500;
    padding: 0 20px;
}

.btn-primary:hover {
    background-color: #3d7bd0;
    border-color: #3d7bd0;
}

.map-container {
    width: 100%;
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.property-details {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.property-details h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

#property-data {
    font-size: 16px;
    line-height: 1.6;
}

.property-item {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

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

.property-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 3px;
}

.property-value {
    font-size: 1.1em;
    color: #2c3e50;
}

.form-select {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.house-list-container::-webkit-scrollbar {
    width: 8px;
}

.house-list-container::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.house-list-container::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 10px;
}

/* House list items - Gen Z friendly */
.house-list-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(147, 51, 234, 0.1);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.house-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.15);
    border-color: rgba(147, 51, 234, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.house-list-item.active {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(124, 58, 237, 0.1));
    border-color: #9333ea;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.2);
}

/* House address styling */
.house-address {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
    letter-spacing: 0.2px;
}

/* House details styling */
.house-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.house-details .price {
    font-size: 18px;
    font-weight: 700;
    color: #9333ea;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(124, 58, 237, 0.1));
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(147, 51, 234, 0.2);
}

.house-details .price:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.2);
}

.house-details .property-type {
    font-size: 13px;
    color: #666;
    background: rgba(147, 51, 234, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.house-details .date {
    font-size: 12px;
    color: #888;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

.house-details .source-db {
    font-size: 12px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Geocoder styles - Updated for new design */
.mapboxgl-ctrl-geocoder {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    min-width: auto;
    max-width: 100%;
    font-size: 16px;
    line-height: 22px;
    margin-top: 0;
    box-shadow: none !important;
    border-radius: 8px !important;
    border: none;
    background: transparent;
    height: 44px;
}

.mapboxgl-ctrl-geocoder--input {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    color: #222;
    font-weight: 500;
    border-radius: 25px 0 0 25px;
    padding-left: 20px;
    padding-right: 56px;
    height: 56px;
    font-size: 16px;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.mapboxgl-ctrl-geocoder--input:focus {
    border: 1.5px solid #9333ea;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.08);
    background: #fff;
}

.mapboxgl-ctrl-geocoder--input::placeholder {
    color: #666;
    font-weight: 400;
}

.mapboxgl-ctrl-geocoder--input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.2);
}

.mapboxgl-ctrl-geocoder--icon {
    top: 18px;
    color: #9333ea;
    right: 12px !important;
    left: auto !important;
}

.mapboxgl-ctrl-geocoder--button {
    display: none !important;
}

/* Clear button styles - No longer needed, using dynamic search/cancel button */
.clear-search-btn {
    display: none; /* Hide old clear button */
}

/* Loading indicator */
.spinner-border {
    width: 40px;
    height: 40px;
    border-width: 3px;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-name: spinner-border;
}

/* Enhanced loading animation */
@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Make loading more visible */
#postcode-loading {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
}

.analysis-loading {
    text-align: center;
    padding: 32px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.analysis-loading p {
    margin-top: 16px;
    color: #666;
    font-weight: 500;
}

/* House details */
.house-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.house-details span {
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #495057;
}

.house-details .price {
    background-color: #e6f2ff;
    color: #0067c9;
    font-weight: 600;
}

.house-details .energy-rating {
    background-color: #ddf5e3;
    color: #0a7a28;
}

.house-details .rooms {
    background-color: #f5f5f5;
    color: #555;
}

/* Property details */
.property-item {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.property-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.property-label {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.property-value {
    color: #2c3e50;
    font-weight: 500;
}

.property-value.source-db {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9em;
}

.popup-content {
    padding: 15px;
    max-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.popup-content h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.popup-details {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.popup-details .source-db {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9em;
}

.popup-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 50px; /* Ensure minimum height for content */
}

.popup-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popup-details strong {
    color: #2c3e50;
    font-weight: 600;
    display: inline-block;
    min-width: 140px;
}

.popup-details .price {
    color: #4a89dc;
    font-weight: bold;
    font-size: 1.1em;
}

.energy-rating {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    margin-right: 8px;
}

.energy-rating-a {
    background-color: #00A651;
}

.energy-rating-b {
    background-color: #8DC63F;
}

.energy-rating-c {
    background-color: #FFF200;
    color: #333;
}

.energy-rating-d {
    background-color: #FBB03B;
}

.energy-rating-e {
    background-color: #F15A24;
}

.energy-rating-f {
    background-color: #ED1C24;
}

.energy-rating-g {
    background-color: #A0A0A0;
}

.energy-rating-na {
    background-color: #666666;
}

.property-type {
    color: #6c757d;
    font-size: 0.9em;
}

.house-list-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.house-list-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

.house-address {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

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

/* Scrollbar styling */
.property-info {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

.property-info::-webkit-scrollbar {
    width: 8px;
}

.property-info::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.property-info::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 10px;
}

/* Custom marker styling */
.custom-marker {
    width: 60px;
    height: 60px;
    cursor: pointer;
    animation: markerPop 0.3s ease-out;
}

.marker-price {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, filter 0.2s ease;
    text-align: center;
    padding: 5px;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

@keyframes markerPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.custom-marker:hover .marker-price {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Popup styles */
.mapboxgl-popup {
    z-index: 3;
    max-width: 350px !important;
}

.mapboxgl-popup-content {
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: none;
    background-color: white;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-content {
    padding: 15px;
    max-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Add scrollbar styling for popup content */
.popup-content::-webkit-scrollbar {
    width: 8px;
    display: block;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
    margin: 4px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
    border: 2px solid #f1f1f1;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.popup-content h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.popup-details {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.popup-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.popup-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popup-details strong {
    color: #333;
    font-weight: 600;
    display: inline-block;
    min-width: 140px;
}

.popup-details .energy-rating {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    margin-left: 5px;
    min-width: 30px;
    text-align: center;
}

.btn-primary {
    background-color: #22c55e;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: #16a34a;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.property-section {
    animation: fadeIn 0.3s ease-out;
}

.house-list-item {
    animation: fadeIn 0.2s ease-out;
}

.price-growth-visualization {
    animation: fadeIn 0.4s ease-out;
}

/* Add these styles for property boundaries */
.mapboxgl-popup.boundary-popup {
    max-width: 300px;
}

.boundary-popup .mapboxgl-popup-content {
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Price history */
.price-history-description {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
}

.price-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.price-history-table th, 
.price-history-table td {
    padding: 12px 15px;
    text-align: left;
}

.price-history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #eee;
}

.price-history-table td {
    border-bottom: 1px solid #eee;
}

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

.price-history-table tr:hover {
    background-color: #f8fafd;
}

/* Price growth visualization */
.price-growth-visualization {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.growth-chart {
    height: 200px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 10px;
    margin-bottom: 30px;
    position: relative;
}

.growth-chart::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background-color: #dee2e6;
}

.chart-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}

.chart-bar {
    width: 30px;
    background-color: #22c55e;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.5s;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-date-label {
    margin-top: 10px;
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.chart-price-label {
    font-size: 12px;
    color: white;
    position: absolute;
    top: -25px;
    white-space: nowrap;
    font-weight: 600;
    background-color: #2c3e50;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chart-price-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

.appreciation-summary {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
}

.appreciation-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.appreciation-value {
    margin-bottom: 10px;
}

.appreciation-percent {
    font-size: 24px;
    font-weight: 700;
    color: #22c55e;
}

.appreciation-period {
    font-size: 14px;
    color: #6c757d;
    margin-left: 5px;
}

.appreciation-annual {
    font-size: 14px;
    color: #6c757d;
}

.appreciation-annual-value {
    font-weight: 600;
    color: #2c3e50;
}

/* Media queries */
@media (max-width: 768px) {
    .property-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .property-value {
        text-align: left;
        margin-top: 5px;
    }
    
    .chart-bar {
        width: 20px;
        background-color: #22c55e;
    }
    
    .chart-bar-container {
        width: 40px;
    }
    
    .chart-price-label {
        font-size: 10px;
    }
}

/* Property Details Popup */
.property-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.property-popup-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-button:hover {
    background-color: #f0f0f0;
    color: #333;
}

.property-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.property-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.property-label {
    font-weight: 600;
    color: #555;
}

.property-value {
    color: #333;
    text-align: right;
}

/* Scrollbar styling for popup */
.property-popup-content::-webkit-scrollbar {
    width: 8px;
}

.property-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.property-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.property-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Add a legend for price colors */
.price-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.price-legend-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.price-legend-gradient {
    height: 20px;
    width: 200px;
    background: linear-gradient(to right, rgb(0, 255, 0), rgb(255, 0, 0));
    border-radius: 4px;
    margin: 5px 0;
}

.price-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* Analysis Button Styles */
.analysis-btn {
    background-color: #22c55e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.analysis-btn:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analysis-btn i {
    font-size: 14px;
}

/* Analysis Popup Styles */
.analysis-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.analysis-popup-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.analysis-section {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.analysis-section h5 {
    margin-bottom: 16px;
    color: #333;
    font-size: 18px;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.analysis-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.analysis-item .label {
    color: #666;
    font-weight: 500;
}

.analysis-item .value {
    font-weight: 600;
    color: #333;
}

.analysis-item .value.positive {
    color: #28a745;
}

.analysis-item .value.negative {
    color: #dc3545;
}

.analysis-loading {
    text-align: center;
    padding: 32px;
}

.analysis-loading p {
    margin-top: 16px;
    color: #666;
}

/* Close button styles */
.analysis-popup .close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    z-index: 2;
}

.analysis-popup .close-button:hover {
    background: #e0e0e0;
    color: #333;
    transform: scale(1.1);
}

.analysis-popup-content h4 {
    margin: 0 0 20px 0;
    padding-right: 40px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.popup-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.popup-buttons {
    display: flex;
    gap: 8px;
}

.epc-btn {
    background-color: #22c55e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.epc-btn:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.epc-btn i {
    font-size: 14px;
}

/* EPC Recommendations */
.recommendations-list {
    margin-top: 15px;
}

.recommendation-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
}

.recommendation-item:last-child {
    margin-bottom: 0;
}

.recommendation-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 15px;
}

.recommendation-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.recommendation-cost,
.recommendation-savings {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.recommendation-cost {
    color: #dc3545;
}

.recommendation-savings {
    color: #28a745;
}

/* Alert styles */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-info {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #0d47a1;
}

.alert-danger {
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/* Map loading overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.map-loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 300px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: map-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes map-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.map-loading-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.map-loading-subtext {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

.map-loading-progress {
    width: 100%;
    height: 4px;
    background-color: #f0f0f0;
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.map-loading-progress-bar {
    height: 100%;
    background-color: #007bff;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Home button removed - now in navbar */

/* Map home button positioned at top left */
.map-home-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    flex-shrink: 0;
}

/* Map zoom controls positioned at bottom right */
.mapboxgl-ctrl-zoom-in,
.mapboxgl-ctrl-zoom-out {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    color: #1a1a1a !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mapboxgl-ctrl-zoom-in:hover,
.mapboxgl-ctrl-zoom-out:hover {
    background: rgba(255, 255, 255, 0.98) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

.mapboxgl-ctrl-zoom-in:active,
.mapboxgl-ctrl-zoom-out:active {
    transform: scale(0.95) !important;
}

/* Position zoom controls at bottom right */
.mapboxgl-ctrl-group {
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    z-index: 1000 !important;
}

.map-home-btn:hover {
    background-color: #16a34a;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Mobile styles for map home button */
@media (max-width: 768px) {
    .map-home-btn {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }
    
    .map-top-controls {
        top: 96px; /* navbar height + 20px margin */
        left: 15px;
        right: 15px;
        gap: 12px;
    }
}

/* Extra small mobile home button */
@media (max-width: 480px) {
    .map-home-btn {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
    
    .map-top-controls {
        top: 96px; /* navbar height + 20px margin */
        left: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .floating-panel.minimized {
        top: 10px;
        right: 10px;
    }
    
    .mapboxgl-ctrl-group {
        bottom: 10px !important;
        right: 10px !important;
        z-index: 1000 !important;
    }
    
    .mapboxgl-ctrl-zoom-in,
    .mapboxgl-ctrl-zoom-out {
        width: 32px !important;
        height: 32px !important;
    }
}

/* Top controls container */
.map-top-controls {
    position: absolute;
    top: 96px; /* navbar height + 20px margin */
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Align to right end */
    gap: 8px; /* Reduced gap for less spacing */
    z-index: 1000;
}

/* Map search container positioned at top right - Gen Z friendly */
.map-search-container {
    flex: 1 1 auto;
    max-width: 450px;
    overflow: visible;
    position: relative;
    /* margin: 0 auto;  Removed to align right */
}

.map-geocoder {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: visible;
    transition: none;
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.map-geocoder:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.map-geocoder .mapboxgl-ctrl-geocoder {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border: none;
    background: transparent;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    height: 100%;
    border-radius: 8px;
}

.map-geocoder .mapboxgl-ctrl-geocoder--input {
    width: 100%;
    padding: 8px 44px 8px 12px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #222;
    font-weight: 400;
    letter-spacing: 0.1px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    box-shadow: none;
}

.map-geocoder .mapboxgl-ctrl-geocoder--input:focus {
    outline: none;
    border: 1.5px solid #22c55e;
    box-shadow: 0 2px 8px rgba(34,197,94,0.08);
    background: #fff;
}

.map-geocoder .mapboxgl-ctrl-geocoder--input::placeholder {
    color: #888;
    font-weight: 400;
}

.map-geocoder .mapboxgl-ctrl-geocoder--icon {
    display: block !important;
    color: #888;
    right: 12px !important;
    left: auto !important;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.map-geocoder .mapboxgl-ctrl-geocoder--button {
    display: none !important;
}

/* Suggestions dropdown */
.map-geocoder .mapboxgl-ctrl-geocoder--suggestions {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
    margin-top: 4px;
    overflow: hidden;
    max-height: 250px;
    z-index: 1002;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 14px;
    color: #222;
    font-weight: 400;
    background: #fff;
    transition: background 0.2s;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion:hover,
.map-geocoder .mapboxgl-ctrl-geocoder--suggestion-active {
    background: #f3f4f6;
    color: #22c55e;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion-title {
    font-weight: 500;
    color: #222;
    margin-bottom: 2px;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion-address {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

@media (max-width: 768px) {
    .map-geocoder {
        width: 100%;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    .map-geocoder .mapboxgl-ctrl-geocoder--input {
        width: 100%;
        padding: 8px 40px 8px 10px;
        font-size: 15px;
        border-radius: 8px;
    }
    .map-geocoder .mapboxgl-ctrl-geocoder--suggestions {
        border-radius: 8px;
        max-height: 180px;
    }
}

/* Clear button styles - No longer needed, using dynamic search/cancel button */
.map-search-container .clear-search-btn {
    display: none; /* Hide old clear button */
}



/* Geocoder suggestions dropdown - Gen Z friendly */
.map-geocoder .mapboxgl-ctrl-geocoder--suggestions {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(147, 51, 234, 0.1);
    margin-top: 8px;
    overflow: hidden;
    max-height: 300px;
    z-index: 1002;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 16px;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion {
    border-bottom: 1px solid rgba(147, 51, 234, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(124, 58, 237, 0.1));
    color: #9333ea;
    transform: translateX(4px);
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion:last-child {
    border-bottom: none;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion-active {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(124, 58, 237, 0.15));
    color: #9333ea;
    font-weight: 600;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion-address {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

/* Extra small mobile geocoder suggestions */
.map-geocoder .mapboxgl-ctrl-geocoder--suggestions {
    margin-top: 4px;
    max-height: 200px;
    border-radius: 12px;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion {
    padding: 8px 12px;
    font-size: 12px;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion-title {
    font-size: 12px;
    margin-bottom: 1px;
}

.map-geocoder .mapboxgl-ctrl-geocoder--suggestion-address {
    font-size: 10px;
} 

/* --- Ensure geocoder button is always inside the geocoder --- */
.map-geocoder {
    position: relative;
    overflow: visible;
}

.map-geocoder .mapboxgl-ctrl-geocoder {
    position: relative;
    overflow: visible;
}

.map-geocoder .mapboxgl-ctrl-geocoder--button {
    display: none !important;
}

/* Force icon to be on the right side */
.map-geocoder .mapboxgl-ctrl-geocoder--icon,
.mapboxgl-ctrl-geocoder--icon {
    right: 12px !important;
    left: auto !important;
    position: absolute !important;
}

.map-geocoder .mapboxgl-ctrl-geocoder--input {
    height: 56px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font-weight: 400;
    letter-spacing: 0.1px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    padding-right: 44px !important;
    padding-left: 12px !important;
}

@media (max-width: 768px) {
    .map-geocoder .mapboxgl-ctrl-geocoder--input {
        height: 48px;
        font-size: 15px;
        padding-right: 40px !important;
        padding-left: 10px !important;
    }
}
/* Mobile styles are now handled in the main mobile media queries above */

/* Map menu control styles */
.map-menu-control {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important;
}

.map-menu-btn {
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    color: #333 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.map-menu-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.map-menu-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    min-width: 200px !important;
    z-index: 1001 !important;
}

.map-menu-item {
    padding: 12px 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    color: #333 !important;
    font-size: 14px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    transition: background-color 0.2s ease !important;
}

.map-menu-item:hover {
    background-color: rgba(34, 197, 94, 0.1) !important;
}

.map-menu-item:last-child {
    border-bottom: none !important;
}

/* Mobile responsive for map menu */
@media (max-width: 768px) {
    .map-menu-control {
        top: 10px !important;
        right: 10px !important;
    }
    
    .map-menu-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }
    
    .map-menu-dropdown {
        min-width: 180px !important;
        margin-top: 6px !important;
    }
    
    .map-menu-item {
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
}