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

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

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #1976D2;
    transform: translateY(-2px);
}

.btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.status {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    font-weight: 500;
    min-width: 200px;
    text-align: center;
}

.status.loading {
    background: #FFF3CD;
    color: #856404;
}

.status.success {
    background: #D4EDDA;
    color: #155724;
}

.status.error {
    background: #F8D7DA;
    color: #721c24;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.map-container, .list-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.map-container h2, .list-container h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

#map {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.earthquake-list {
    display: grid;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.earthquake-list::-webkit-scrollbar {
    width: 8px;
}

.earthquake-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.earthquake-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.earthquake-list::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* Estilos para popups del mapa */
.popup-content {
    min-width: 250px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.popup-magnitude {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 50%;
    color: white;
    min-width: 40px;
    text-align: center;
    background: #4CAF50;
}

.popup-magnitude.high {
    background: #f44336;
}

.popup-magnitude.medium {
    background: #ff9800;
}

.popup-location {
    font-weight: 600;
    color: #333;
    flex: 1;
    font-size: 0.9rem;
}

.popup-details {
    margin: 10px 0;
}

.popup-details div {
    margin: 5px 0;
    font-size: 0.85rem;
    color: #666;
}

.popup-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 10px;
    width: 100%;
    transition: background 0.3s ease;
}

.popup-button:hover {
    background: #5a6fd8;
}

/* Efecto highlight para elementos destacados */
.earthquake-item.highlighted {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border-left-color: #667eea !important;
    animation: pulse 2s ease-in-out;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    50% { 
        box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
    }
}

/* Personalizar controles de Leaflet */
.leaflet-control-zoom a {
    color: #667eea !important;
}

.leaflet-control-zoom a:hover {
    background: #667eea !important;
    color: white !important;
}

.earthquake-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 5px solid #4CAF50;
}

.earthquake-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

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

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

.magnitude {
    font-size: 2rem;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 50%;
    color: white;
    background: #4CAF50;
    min-width: 60px;
    text-align: center;
}

.magnitude.high {
    background: #f44336;
}

.magnitude.medium {
    background: #ff9800;
}

.earthquake-info {
    flex: 1;
    margin-left: 20px;
}

.location {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.datetime {
    color: #666;
    font-size: 1.4rem;
}

.earthquake-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.detail-item {
    text-align: center;
}

.detail-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .map-container, .list-container {
        padding: 15px;
    }
    
    #map {
        height: 300px;
    }
    
    .earthquake-list {
        max-height: 400px;
    }
    
    .earthquake-header {
        flex-direction: column;
        text-align: center;
    }
    
    .earthquake-info {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .earthquake-details {
        grid-template-columns: 1fr 1fr;
    }
}

/* Footer Styles */
footer {
    margin-top: 40px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    text-align: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

footer p {
    margin-bottom: 10px;
    opacity: 0.9;
}

footer a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Subtitle in header */
.subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states for keyboard navigation */
button:focus,
a:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .container {
        background: #000;
        color: #fff;
    }
    
    .map-container, .list-container {
        background: #222;
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .controls {
        display: none;
    }
    
    #map {
        border: 1px solid #000;
    }
    
    .earthquake-item {
        break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 10px;
    }
}