/* Search Frame Styles */
#navigationMenu.collapsed {
    display: none;
}

.toggle-nav-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    z-index: 1001;
}

.toggle-nav-button i {
    font-size: 1.2rem;
}
.search-frame-container {
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 15px;
}

.search-frame {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Search Filters */
.search-filters {
    display: flex;
    flex-wrap: wrap;
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    align-items: flex-start;
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px; /* Reduced from 200px for better mobile layout */
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

.filter-group select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    transition: border-color 0.2s;
    width: 100%; /* Ensure select fills container */
}

.filter-group select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.filter-group select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.clear-filters-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: auto; /* Align with the bottom of other filters */
    align-self: flex-end;
}

.clear-filters-btn:hover {
    background-color: #c0392b;
}

/* Unit Grid */
.unit-grid-container {
    padding: 20px;
    overflow: hidden; /* Prevent horizontal overflow */
}

.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.unit-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2/* Modern CSS Reset and Variables */
}
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #ecf0f1;
    --text-color: #2c3e50;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
}

/* Header Styles */
h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

/* Form Container - Updated Styles */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    margin: 2rem 0;
    animation: slideUp 0.5s ease;
}

.form-container h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Unit Marker Styles */
.unit-marker {
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    position: relative;
    transition: opacity 0.3s ease;
}

.unit-label {
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

/* Simplify availability states */
.available {
    background-color: #2ecc71;
}

.not-available {
    background-color: #e74c3c;
}

/* Remove hover animation */
.unit-marker:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Remove unused animations */
@keyframes pulse {
    0%, 100% {
        transform: none;
        opacity: 1;
    }
}

/* Units List - Updated Styles */
.units-section {
    margin: 2rem 0;
}

#unitList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0;
    list-style: none;
}

.unit-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
}

.unit-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.unit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.unit-card-title {
    font-weight: 600;
    stroke-width: 4px;
    color: green;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.unit-card-price {
    color: var(--accent-color);
    font-weight: 500;
}

.unit-card-type {
    color: #666;
    font-size: 0.9rem;
}

.unit-card-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.unit-card-actions button {
    padding: 8px 12px;
    font-size: 0.9rem;
}

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

/* Map Container */
#map-container {
    position: relative;
    margin: 2rem 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease;
}

#map {
    height: 600px;
    width: 100%;
    border: none;
    border-radius: 15px;
}

/* Navigation Menu */
#navigationMenu {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 12px 0 0 12px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    width: 250px;
    overflow-y: auto;
    max-height: 400px;
    transition: transform 0.3s ease;
    transform: translateX(0);
}

#navigationMenu.collapsed {
    display: none; /* Fallback for older browsers */
    transform: translateX(100%);
}

.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 60px;
    padding-top: 10px;
    color: black;
}

.nav-buttons button:not(.add-nav-button) {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
    color: #000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-buttons button:not(.add-nav-button):hover {
    transform: translateX(5px);
    background: var(--secondary-color);
    color: white;
}

/* Units List */
h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 2rem 0 1rem;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    form {
        grid-template-columns: 1fr;
    }
    
    #map {
        height: 400px;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    /* Improved filter responsiveness */
    .search-filters {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .filter-group {
        width: 100%;
        min-width: 100%;
    }
    
    .range-filter {
        width: 100%;
        min-width: 100%;
    }
    
    .range-inputs {
        flex-direction: row;
        width: 100%;
    }
    
    .clear-filters-btn {
        width: 100%;
        margin-top: 10px;
        justify-content: center;
    }
    
    /* Unit grid improvements */
    .unit-grid-container {
        padding: 15px 10px;
    }
    
    .unit-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
    
    /* Building grid popup improvements */
    .building-grid {
        max-height: 60vh;
        overflow-x: auto;
    }
    
    .building-grid-popup .leaflet-popup-content {
        min-width: 300px;
        max-width: 90vw;
    }
    
    .search-frame-container {
        padding: 0 5px;
    }
    
    /* Improved filter elements for mobile */
    .filter-group select,
    .range-inputs input {
        padding: 12px 10px; /* Taller height for better touch */
        font-size: 16px; /* iOS minimum size to prevent zoom */
    }
    
    /* Better spacing */
    .search-filters {
        padding: 12px;
        gap: 15px;
    }
    
    /* Better separation between filters */
    .filter-group {
        margin-bottom: 2px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
    
    .filter-group:last-of-type {
        border-bottom: none;
    }
    
    /* Larger, more visible clear button */
    .clear-filters-btn {
        padding: 12px 15px;
        margin-top: 15px;
        font-size: 16px; 
        font-weight: 600;
    }
    
    /* Make everything more compact */
    .filter-group label {
        margin-bottom: 4px;
    }
    
    /* More descriptive placeholders on small screens */
    #minPrice::placeholder,
    #minArea::placeholder {
        color: #999;
    }
    
    #maxPrice::placeholder,
    #maxArea::placeholder {
        color: #999;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .range-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .range-inputs span {
        text-align: center;
        margin: 5px 0;
    }
    
    .building-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-item {
        justify-content: center;
    }
    
    /* Even more vertical layout */
    .range-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .range-inputs input {
        width: 100%;
    }
    
    .range-inputs span {
        display: none; /* Hide the "to" text on very small screens */
    }
    
    /* Add alternative labels */
    .range-inputs input:first-child::placeholder {
        content: "Min";
    }
    
    .range-inputs input:last-child::placeholder {
        content: "Max";
    }
}

/* Loading Animation for Map */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.loading-overlay p {
    color: white;
    margin-top: 15px;
    font-size: 1.2rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

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

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1002;
}

/* Navigation Form Styles */
.nav-form {
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.nav-form h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.nav-form input {
    width: calc(100% - 30px);
    margin: 10px 0;
}

.nav-instruction {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0;
    font-style: italic;
}

.nav-form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.add-nav-button {
    position: sticky;
    bottom: 0;
    background: #2ecc71;
    width: calc(100% - 2rem);
    margin: 1rem;
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.add-nav-button:hover {
    background: #27ae60;
}

.cancel-button {
    background: #e74c3c;
}

.cancel-button:hover {
    background: #c0392b;
}

.success-message {
    position: sticky;
    bottom: 70px;
    margin: 10px;
    padding: 10px;
    background: #2ecc71;
    color: white;
    border-radius: 8px;
    text-align: center;
    animation: fadeIn 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    margin: 4px 0;
    border: none;
    border-radius: 4px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background: #e9ecef;
}

.nav-button.sector {
    background: #e3f2fd;
}

.nav-button.sector:hover {
    background: #bbdefb;
}

.nav-button i {
    width: 16px;
    text-align: center;
}

/* Navigation Indicator Styles */
.leaflet-interactive {
    animation: pulse 5s infinite;
    stroke-width: 0px;
}

@keyframes pulse {

}

.leaflet-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    padding: 6px 12px;
}

/* Style scrollbar for webkit browsers */
#navigationMenu::-webkit-scrollbar {
    width: 8px;
}

#navigationMenu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

#navigationMenu::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

/* Search Container Styles */
.search-container {
    position: sticky;
    top: 0;
    background: white;
    padding: 10px;
    margin: -1rem -1rem 1rem -1rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    z-index: 3;
}

.search-input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
    background: #f8f9fa;
}

.search-input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

/* Popup Form Styles */
.unit-creation-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

.unit-creation-popup .leaflet-popup-content {
    margin: 0;
    width: 250px !important;
}

.popup-form {
    padding: 15px;
}

.popup-form h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.popup-form-group {
    margin-bottom: 10px;
}

.popup-form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.popup-form-group input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.popup-form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.popup-form-buttons button {
    flex: 1;
    padding: 8px;
    font-size: 0.9rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.create-btn {
    background: var(--secondary-color);
    color: white;
}

.create-btn:hover {
    background: #2980b9;
}

.cancel-btn {
    background: #e74c3c;
    color: white;
}

.cancel-btn:hover {
    background: #c0392b;
}

/* Group Hierarchy Styles */
.group-container {
    margin-bottom: 10px;
}

.main-group {
    background: var(--primary-color) !important;
    color: white !important;
}

.sub-groups {
    margin-left: 20px;
    border-left: 2px solid var(--secondary-color);
    padding-left: 10px;
}

.group-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.group-actions i {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.group-actions i:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Form Styles */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    cursor: pointer;
}

.form-instruction {
    color: #666;
    font-size: 0.9rem;
    margin: 10px 0;
    text-align: center;
    font-style: italic;
}

/* Unit Type Colors */
.residential {
    border-color: #2ecc71;
}

.commercial {
    border-color: #e74c3c;
}

.industrial {
    border-color: #f39c12;
}

/* Popup Styles */
.unit-popup {
    padding: 15px;
}

.unit-popup h3 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
}

.popup-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.popup-details p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-btn {
    width: 100%;
    padding: 8px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.details-btn:hover {
    background: #2980b9;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #2ecc71;
}

.notification.error {
    border-left: 4px solid #e74c3c;
}

.notification i {
    font-size: 1.2em;
}

.notification.success i {
    color: #2ecc71;
}

.notification.error i {
    color: #e74c3c;
}

/* Modal Styles */
.unit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-header button:hover {
    color: var(--accent-color);
}

.modal-body {
    padding: 20px;
}

.unit-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.unit-info p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit-actions {
    display: flex;
    gap: 10px;
}

.unit-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.edit-btn {
    background: var(--secondary-color);
    color: white;
}

.delete-btn {
    background: var(--accent-color);
    color: white;
}

/* Selection Popup Styles */
.selection-form {
    padding: 15px;
}

.selection-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.select-btn {
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.select-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateX(5px);
}

/* Form Group Styles */
.popup-form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.popup-form-group select:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Enhanced Availability Status Styles */
.status-available {
    color: #2ecc71;
    font-weight: bold;
}

.status-pending {
    color: #f39c12;
    font-weight: bold;
}

.status-sold {
    color: #e74c3c;
    font-weight: bold;
}

/* Improved Unit Card Styles */
.unit-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border-top: 4px solid #3498db;
    position: relative;
}

.unit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.unit-card.available {
    border-top-color: #2ecc71;
}

.unit-card.pending {
    border-top-color: #f39c12;
}

.unit-card.sold {
    border-top-color: #e74c3c;
}

.unit-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unit-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.unit-type {
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: #f8f9fa;
    color: #6c757d;
}

.unit-card-body {
    padding: 15px 20px;
}

.unit-card-body p {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit-card-body p i {
    width: 20px;
    color: #3498db;
}

.unit-card-footer {
    padding: 15px 20px;
    border-top: 1px solid #f1f1f1;
    display: flex;
    gap: 10px;
}

.unit-card-footer button {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.view-details-btn {
    background: #f8f9fa;
    color: #2c3e50;
}

.view-details-btn:hover {
    background: #e9ecef;
}

.navigate-btn {
    background: #3498db;
    color: white;
}

.navigate-btn:hover {
    background: #2980b9;
}

/* Enhanced Filter Styles */
.search-filters {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    padding: 20px;
    border-radius: 12px 12px 0 0;
}

.filter-group label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 8px;
}

.filter-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    color: #2c3e50;
}

.filter-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

.filter-group select:disabled {
    background-color: #f8f9fa;
    border-color: #e0e0e0;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.7;
}

.clear-filters-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
    margin-top: 25px;
}

.clear-filters-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

/* Enhanced No Units Message */
.no-units-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.no-units-message i {
    font-size: 3rem;
    color: #ced4da;
    margin-bottom: 15px;
}

.no-units-message p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

/* Availability Toggle in Form */
.availability-toggle {
    margin-top: 10px;
}

.availability-toggle label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.availability-toggle select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    transition: all 0.3s ease;
}

/* Updated Unit Marker Animations */
.unit-marker:before {
    display: none;
}

.unit-marker:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.question-mark {
    color: white;
    font-size: 14px;
    font-weight: bold;
    z-index: 2;
}

/* Enhanced Modal Animation */
.unit-modal {
    animation: fadeIn 0.4s ease;
}

.modal-content {
    animation: modalSlideUp 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

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

/* Improved Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Range Filter Styles */
.range-filter {
    flex: 2;
    min-width: 250px; /* Reduced from 300px for better mobile layout */
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping on very small screens */
}

.range-inputs input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 80px; /* Ensure inputs don't get too small */
}

.range-inputs input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.range-inputs span {
    color: #666;
    font-size: 0.9rem;
}

/* Enhanced Group Summary Marker Styles */
.group-summary-marker {
    background: white;
    border-radius: 8px;
    padding: 6px 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid #3498db;
    min-width: 90px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    pointer-events: auto;
}

.group-summary-marker:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.group-summary-header {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-summary-counts {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 0.8rem;
}

.available-count {
    color: #2ecc71;
    font-weight: bold;
}

.not-available-count {
    color: #e74c3c;
    font-weight: bold;
}

/* Force proper styling on custom markers */
.custom-marker {
    transition: opacity 0.3s ease !important;
}

/* Ensure group summary icons are always visible and clickable */
.group-summary-icon {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Data Management Styles */
.data-management {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.export-btn, .import-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--shadow-md);
}

.export-btn {
    background-color: #3498db;
    color: white;
}

.export-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.import-btn {
    background-color: #2ecc71;
    color: white;
}

.import-btn:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}

/* Building Grid Popup Styles - enhanced */
.building-grid-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 90vw; /* Responsive sizing */
}

.building-grid-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
    min-width: 400px;
    max-width: 90vw; /* Responsive sizing */
}

.building-popup {
    padding: 20px;
}

.building-popup h3 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

.building-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
}

.stat-item i {
    font-size: 1.2rem;
}

.stat-item i.available {
    color: #2ecc71;
}

.stat-item i.not-available {
    color: #e74c3c;
}

.building-grid {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 10px;
}

.grid-header {
    display: flex;
    background: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 2;
}

.grid-row {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.grid-row:last-child {
    border-bottom: none;
}

.grid-row:nth-child(even) {
    background-color: #fafafa;
}

.grid-cell {
    padding: 10px;
    text-align: center;
    flex: 1;
    border-right: 1px solid #e0e0e0;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-cell:last-child {
    border-right: none;
}

.floor-label, .section-label {
    font-weight: 600;
    background: #f8f9fa;
}

.floor-label {
    min-width: 80px;
    max-width: 80px;
    background: var(--primary-color);
    color: white;
    position: sticky;
    left: 0;
    z-index: 1;
}

.section-label {
    background: var(--secondary-color);
    color: white;
}

.unit-cell {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
}

.unit-cell:hover {
    transform: scale(0.97);
    box-shadow: inset 0 0 0 2px rgba(52, 152, 219, 0.5);
}

.unit-cell.available {
    background-color: rgba(46, 204, 113, 0.1);
    border-left: 4px solid #2ecc71;
}

.unit-cell.not-available {
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 4px solid #e74c3c;
}

.cell-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.unit-name {
    font-weight: 600;
    color: var(--primary-color);
}

.unit-price {
    color: var(--accent-color);
    font-weight: 500;
}

.unit-area {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.empty-cell {
    cursor: pointer;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.empty-cell:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.add-unit-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
}

.add-unit-btn:hover {
    color: var(--secondary-color);
}

.add-unit-btn i {
    font-size: 1.2rem;
}

.add-unit-btn span {
    font-size: 0.8rem;
}

/* Building edit popup styles */
.building-edit-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

.building-edit-popup .leaflet-popup-content {
    margin: 0;
    width: 350px !important;
}

/* Make popups scrollable on small screens */
@media (max-width: 768px) {
    .building-grid {
        max-height: 60vh;
        overflow-x: auto;
    }
    
    .building-grid-popup .leaflet-popup-content {
        min-width: 300px;
    }
}

.building-grid-popup .unit-cell:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: scale(1.03);
    transition: all 0.2s ease;
}

.building-grid-popup .highlighted-unit {
    background-color: rgba(52, 152, 219, 0.3);
    border: 1px solid #3498db;
    animation: pulse-highlight 2s infinite;
}

@keyframes pulse-highlight {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    70% { box-shadow: 0 0 0 5px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

/* Villa markers */
.villa-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ff7043;
    border: 2px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.villa-marker.available {
    background-color: #4CAF50;
}

.villa-marker.not-available {
    background-color: #F44336;
}

.villa-marker:hover {
    transform: scale(1.1);
    cursor: pointer;
    z-index: 1000;
}

.villa-label {
    font-size: 10px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 25px;
    white-space: nowrap;
}

/* Villa popup */
.villa-popup {
    min-width: 250px;
    padding: 10px;
}

.villa-popup h3 {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    font-size: 18px;
}

.villa-popup .popup-details {
    margin-bottom: 10px;
}

.villa-popup .popup-details p {
    margin: 5px 0;
    display: flex;
    align-items: center;
}

.villa-popup .popup-details i {
    margin-right: 8px;
    width: 20px;
}

.villa-image {
    margin: 10px 0;
    text-align: center;
}

.villa-image img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 5px;
}

/* Villa image in details view */
.villa-image-large {
    text-align: center;
    margin-bottom: 15px;
}

.villa-image-large img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Villa type preview */
.villa-preview {
    text-align: center;
    margin: 10px 0;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.villa-preview-image {
    max-width: 100%;
    max-height: 120px;
    border-radius: 5px;
    margin-bottom: 5px;
}

/* Villa modal */
.villa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.villa-modal .modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.villa-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #ff7043;
    color: white;
}

.villa-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.villa-modal .modal-header button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.villa-modal .modal-body {
    padding: 20px;
}

.villa-info {
    margin-bottom: 20px;
}

.villa-info p {
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.villa-info i {
    margin-right: 10px;
    width: 20px;
}

.villa-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.villa-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.villa-actions i {
    margin-right: 5px;
}

.edit-btn {
    background-color: #2196F3;
    color: white;
}

.delete-btn {
    background-color: #F44336;
    color: white;
}

/* Villa creation form */
.villa-creation-popup .popup-form {
    min-width: 300px;
}

/* Villa card in search results */
.villa-card {
    background-color: #fff8e1;
    border-color: #ff7043;
}

.villa-card.available {
    border-left: 5px solid #4CAF50;
}

.villa-card.not-available {
    border-left: 5px solid #F44336;
}

.villa-card-image {
    text-align: center;
    margin: 5px 0 10px 0;
    border-radius: 5px;
    overflow: hidden;
}

.villa-card-image img {
    max-width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.villa-card:hover .villa-card-image img {
    transform: scale(1.05);
}