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

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 8px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

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

.filter-group select {
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

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

.filter-group input[type="text"] {
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-group input[type="text"]::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a67d8;
}

.btn-primary:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

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

.btn-success:hover {
    background: #38a169;
}

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

.btn-info:hover {
    background: #3182ce;
}

.btn-secondary {
    background: #a0aec0;
    color: white;
}

.btn-secondary:hover {
    background: #718096;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.content-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 600px;
}

.map-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

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

.data-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.data-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #333;
}

.data-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
    cursor: pointer;
}

/* Polygon highlighting styles */
.clickable-area {
    cursor: pointer;
    transition: color 0.2s ease;
}

.clickable-area:hover {
    text-decoration: underline;
}

.clickable-building:hover {
    color: #1d4ed8 !important;
}

.clickable-city:hover {
    color: #047857 !important;
}

.clickable-district:hover {
    color: #b91c1c !important;
}

.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stat-item {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .content-area {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .map-container {
        height: 400px;
    }
    
    .data-panel {
        height: 500px;
    }
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
    font-style: italic;
    text-align: center;
    min-height: 200px;
    flex-direction: column;
    gap: 10px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #667eea;
    transition: width 0.3s ease;
    width: 0%;
}

#progressText {
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

.error-message {
    color: #e53e3e;
    background: #fed7d7;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Footer styles */
footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 14px;
    border-top: 1px solid #e1e5e9;
}

footer p {
    margin: 5px 0;
    opacity: 0.9;
}

footer a {
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.5);
}

footer a:hover {
    opacity: 0.8;
}