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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 380px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.sidebar-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* Filters */
.filters {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.filters label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.filters select {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.refresh-btn {
    width: 100%;
    padding: 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s;
}

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

.refresh-icon {
    font-size: 18px;
}

/* Stats */
.stats {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.stat-card {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Earthquake List */
.earthquake-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.earthquake-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.earthquake-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.earthquake-item.selected {
    border-left-color: #3498db;
    background: #f0f8ff;
}

.earthquake-item.magnitude-low {
    border-left-color: #3498db;
}

.earthquake-item.magnitude-medium {
    border-left-color: #f1c40f;
}

.earthquake-item.magnitude-high {
    border-left-color: #e67e22;
}

.earthquake-item.magnitude-severe {
    border-left-color: #e74c3c;
}

.earthquake-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.earthquake-magnitude {
    font-size: 20px;
    font-weight: bold;
}

.earthquake-time {
    font-size: 12px;
    color: #7f8c8d;
}

.earthquake-location {
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

.earthquake-details {
    font-size: 12px;
    color: #7f8c8d;
}

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

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

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.map-legend h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 12px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 50vh;
    }
    
    .map-legend {
        bottom: 10px;
        right: 10px;
        padding: 10px;
    }
}

/* Mapbox Popup Styles */
.mapboxgl-popup-content {
    padding: 15px;
    border-radius: 8px;
    min-width: 200px;
}

.popup-header {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

.popup-details {
    font-size: 14px;
    line-height: 1.5;
}

.popup-details div {
    margin-bottom: 5px;
}

.popup-link {
    display: inline-block;
    margin-top: 10px;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

.popup-link:hover {
    text-decoration: underline;
}