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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 8px;
}

header p {
    color: #718096;
    font-size: 1.1rem;
}

.controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.control-group label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.export-btn, .refresh-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.export-btn {
    background: #48bb78;
    color: white;
}

.export-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.refresh-btn {
    background: #4299e1;
    color: white;
}

.refresh-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.stats {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.stats span {
    font-weight: 600;
    color: #2d3748;
}

#map {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    background: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        min-width: auto;
    }
    
    .export-btn, .refresh-btn {
        width: 100%;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Popup styling */
.leaflet-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 12px;
    min-width: 250px;
}

.popup-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 8px;
}

.popup-address {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.popup-stats {
    font-weight: 600;
    color: #48bb78;
    margin-bottom: 12px;
}

.popup-apartments {
    max-height: 150px;
    overflow-y: auto;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
}

.popup-apartments ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popup-apartments li {
    padding: 4px 0;
    font-size: 0.85rem;
    color: #4a5568;
    border-bottom: 1px solid #f7fafc;
}

.popup-apartments li:last-child {
    border-bottom: none;
}
