/* ============================================ */
/* PROPERTY MAP PAGE - CUSTOM STYLES            */
/* ============================================ */

:root {
    --primary-color: #ff6b35;
    --secondary-color: #2c6e91;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --info-color: #2196F3;
    --danger-color: #f44336;
    --light-bg: #f8f9fa;
    --dark-text: #1a1a1a;
    --text-muted: #6c757d;
    --border-light: #dee2e6;
    --white: #ffffff;
}

/* ============================================ */
/* BODY & GENERAL STYLES                       */
/* ============================================ */

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

body {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

html,
body.property-map-page {
    height: 100%;
}

body.property-map-page {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.property-map-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================ */
/* NAVBAR STYLES                               */
/* ============================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--white) !important;
}

.navbar .container-fluid {
    position: relative;
}

.map-nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin-left: 10px;
}

.navbar-brand:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

.brand-logo {
    width: 148px;
    max-width: 100%;
    height: auto;
    display: block;
}

.map-nav-actions {
    margin-right: 12px;
}

.map-nav-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 700;
    color: #f64b07;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.back-home-link {
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 14px !important;
    font-weight: 600;
    color: #4a4a4a !important;
    background: var(--white);
}

.back-home-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color) !important;
}

/* ============================================ */
/* SEARCH SECTION STYLES                       */
/* ============================================ */

.search-section {
    position: relative;
    z-index: 250;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.5rem 0.75rem 0.35rem !important;
    border-bottom: 2px solid var(--border-light);
    flex: 0 0 auto;
}

.search-controls-row .form-label {
    margin-bottom: 0.2rem !important;
    font-size: 0.8rem;
}

.search-controls-row .form-control,
.search-controls-row .form-select {
    min-height: 40px;
}

.filter-reset-inline {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.filter-reset-inline .form-select {
    flex: 1;
}

#resetFiltersBtn {
    min-height: 40px;
    min-width: 96px;
}

#resetFiltersBtn.is-hidden {
    display: none;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: var(--primary-color);
    font-size: 1rem;
    z-index: 10;
    pointer-events: none;
}

.search-input-wrapper .form-control {
    padding-left: 38px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input-wrapper .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    outline: none;
}

.search-feedback {
    display: block;
    min-height: 12px;
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-feedback.success {
    color: var(--success-color);
}

.search-feedback.error {
    color: var(--danger-color);
}

/* Location Suggestions Dropdown */
.location-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.location-suggestions .suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-light);
}

.location-suggestions .suggestion-item:last-child {
    border-bottom: none;
}

.location-suggestions .suggestion-item:hover {
    background-color: var(--light-bg);
    padding-left: 16px;
}

/* Property Type Filter */
#propertyTypeFilter {
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

#propertyTypeFilter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Legend Styles */
.legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    padding: 10px 16px;
    min-height: 48px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.legend-title {
    font-size: 0.9rem;
    line-height: 1;
    color: var(--dark-text);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1;
    color: var(--text-muted);
    font-weight: 500;
}

.legend-marker {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================ */
/* MAP CONTAINER STYLES                        */
/* ============================================ */

.map-container-section {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--light-bg);
}

.map-full-height {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--light-bg);
}

.map-legend-control {
    position: absolute;
    top: 66px;
    right: 14px;
    z-index: 30;
}

.map-legend-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-light);
    border-radius: 2px;
    background: var(--white);
    color: #364152;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    line-height: 1;
}

.map-legend-toggle:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.map-legend-panel {
    position: absolute;
    top: 50px;
    right: 0;
    width: 220px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.map-legend-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.map-legend-panel .legend-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: auto;
    padding: 12px;
    border: 1px solid var(--border-light);
}

/* Leaflet Map Controls Styling */
.leaflet-control {
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-control-zoom {
    background-color: var(--white) !important;
    border: 2px solid var(--border-light) !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    color: var(--primary-color) !important;
    font-weight: bold;
    font-size: 20px !important;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    background-color: var(--light-bg) !important;
    color: var(--secondary-color) !important;
}

/* Custom Map Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px;
}

.leaflet-popup-tip-container {
    display: none;
}

.leaflet-popup-tip {
    display: none;
}

/* ============================================ */
/* PROPERTY INFO SECTION STYLES                */
/* ============================================ */

.property-info-section {
    background: var(--light-bg);
    padding: 0.95rem 0 0.75rem !important;
    flex: 0 0 auto;
}

.info-card {
    background: var(--white) !important;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    padding: 0.9rem !important;
}

.info-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

.info-card h6 {
    color: var(--dark-text);
    font-size: 0.95rem;
    margin-bottom: 0.45rem !important;
}

.info-card p {
    font-size: 0.84rem;
}

/* ============================================ */
/* MARKER POPUP STYLES                         */
/* ============================================ */

.marker-popup {
    padding: 8px;
    text-align: center;
}

.marker-popup h6 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 4px 0;
    color: var(--dark-text);
}

.marker-popup p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.marker-popup .badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
}

.marker-popup .marker-popup-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.marker-popup .marker-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.marker-popup .marker-detail-btn:hover {
    color: var(--white);
    opacity: 0.95;
}

/* ============================================ */
/* RESPONSIVE DESIGN                           */
/* ============================================ */

/* Tablet (768px and below) */
@media (max-width: 991px) {
    .search-section {
        padding: 0.45rem 0.65rem 0.25rem !important;
    }

    .map-container-section {
        min-height: 0;
    }

    .navbar-brand {
        transform-origin: left center;
    }

    .filter-reset-inline {
        flex-direction: row;
    }

    .map-legend-control {
        top: 62px;
        right: 10px;
    }

    .map-nav-actions {
        margin-right: 8px;
    }
}

/* Mobile (576px and below) */
@media (max-width: 576px) {
    .map-container-section {
        min-height: 0;
    }

    .map-legend-panel {
        width: 190px;
    }

    .navbar {
        padding: 0.75rem 0 !important;
    }

    .navbar-brand {
        margin-left: 12px;
    }

    .brand-logo {
        width: 132px;
    }

    .back-home-link {
        padding: 4px 10px !important;
        font-size: 0.86rem;
    }

    .map-nav-actions {
        margin-right: 6px;
    }

    .search-section {
        padding: 0.35rem 0.5rem 0.2rem !important;
    }

    .search-input-wrapper .form-control {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem 0.5rem 32px;
    }

    .search-input-wrapper .search-icon {
        left: 10px;
        font-size: 0.9rem;
    }

    #propertyTypeFilter {
        font-size: 0.9rem;
    }

    .legend-container {
        padding: 8px 12px;
        gap: 10px;
        font-size: 0.75rem;
    }

    .legend-marker {
        width: 12px;
        height: 12px;
    }

    .info-card {
        padding: 0.7rem !important;
    }

    .info-card h6 {
        font-size: 0.82rem;
    }

    .info-card p {
        font-size: 0.76rem;
    }
}

/* ============================================ */
/* UTILITY CLASSES                             */
/* ============================================ */

/* Loading Animation */
.loading {
    animation: spin 1s linear infinite;
}

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

/* Smooth Transitions */
* {
    transition: all 0.3s ease;
}

/* Focus States */
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
