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

:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #1e293b;
    --darker-bg: #0f172a;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background: var(--light-bg);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1000;
}

.container {
    max-width: 100%;
    padding: 0 2rem;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-info {
    display: flex;
    gap: 2rem;
    font-size: 0.875rem;
}

.space-count,
.update-date {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

/* Main Container */
.main-container {
    display: flex;
    height: calc(100vh - 80px);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 400px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Search */
.search-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-bg);
}

.filter-tab {
    flex: 1;
    padding: 1rem 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.filter-tab i {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.filter-tab:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
}

.filter-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Filters */
.filters {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    max-height: 400px;
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

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

.filter-select {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.clear-filters-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-filters-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.clear-filters-btn i {
    margin-right: 0.5rem;
}

/* Space List */
.space-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.space-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.space-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.space-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.space-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.space-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.space-type.dedicated {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.space-type.cafe {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.space-type.emerging {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.space-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--warning-color);
}

.space-location {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.space-location i {
    font-size: 0.625rem;
}

.space-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.space-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--light-bg);
    border-radius: 0.25rem;
    font-size: 0.625rem;
    color: var(--text-secondary);
}

.feature-tag i {
    font-size: 0.75rem;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* Map Legend */
.map-legend {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.map-legend h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

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

.legend-marker {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: var(--shadow);
}

.legend-marker.dedicated {
    background: var(--primary-color);
}

.legend-marker.cafe {
    background: var(--warning-color);
}

.legend-marker.emerging {
    background: var(--success-color);
}

/* Stats Panel */
.stats-panel {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 2rem;
    z-index: 1000;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    display: block;
    font-size: 0.625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--light-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.modal-body {
    padding: 2rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-weight: 500;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.amenities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.amenity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.review-box {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.review-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Custom Leaflet Popup */
.custom-popup {
    font-family: 'Inter', sans-serif;
}

.popup-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.popup-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.popup-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.popup-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--warning-color);
    margin-bottom: 0.5rem;
}

.popup-btn {
    display: block;
    width: 100%;
    padding: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.3s;
}

.popup-btn:hover {
    background: var(--secondary-color);
}

/* Scrollbar Styles */
.space-list::-webkit-scrollbar,
.filters::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.space-list::-webkit-scrollbar-track,
.filters::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: var(--light-bg);
}

.space-list::-webkit-scrollbar-thumb,
.filters::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.space-list::-webkit-scrollbar-thumb:hover,
.filters::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 350px;
    }
    
    .header-info {
        gap: 1rem;
        font-size: 0.75rem;
    }
    
    .stats-panel {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 50vh;
    }
    
    .map-container {
        height: 50vh;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .map-legend,
    .stats-panel {
        font-size: 0.75rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
