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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #334155;
    overflow-x: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #0080FF 0%, #0066CC 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Map Container */
#map {
    width: 100%;
    height: calc(100vh - 120px);
    position: relative;
    z-index: 1;
}

/* Custom Leaflet Marker Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-family: 'Inter', sans-serif;
}

/* Event Details Sidebar */
#event-details {
    position: fixed;
    top: 140px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 160px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

#event-details:not(.hidden) {
    transform: translateX(0);
}

.detail-container {
    padding: 1.5rem;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ef4444;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.close-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

#event-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-right: 2rem;
    line-height: 1.3;
}

.event-info {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #0080FF;
}

.event-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.event-info p:last-child {
    margin-bottom: 0;
}

.risk-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.risk-alto {
    background: #fee2e2;
    color: #dc2626;
}

.risk-moderado {
    background: #fef3c7;
    color: #d97706;
}

.risk-bajo {
    background: #dcfce7;
    color: #16a34a;
}

.image-section {
    margin: 1.5rem 0;
}

.image-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

#event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: transform 0.2s ease;
}

#event-image:hover {
    transform: scale(1.02);
}

#event-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* Button Styles */
.buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

button {
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #00CC66 0%, #00AA55 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 204, 102, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00AA55 0%, #009944 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(0, 204, 102, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #0080FF 0%, #0066CC 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 128, 255, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(0, 128, 255, 0.3);
}

/* Loading Indicator */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
    z-index: 2000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #0080FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .header-content p {
        font-size: 0.9rem;
    }
    
    #event-details {
        top: 120px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .detail-container {
        padding: 1rem;
    }
    
    .buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    #map {
        height: calc(100vh - 100px);
    }
    
    #event-details {
        top: 110px;
        bottom: 10px;
        max-height: none;
    }
}

/* Custom scrollbar for sidebar */
#event-details::-webkit-scrollbar {
    width: 6px;
}

#event-details::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#event-details::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#event-details::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
