/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1rem 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 400;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

nav a:hover {
    color: #a8d0ff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-registro {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-registro:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Hero con mapa */
.hero {
    padding: 2rem;
    position: relative;
}

.hero-content {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* Stats en hero */
.stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.last-update {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 1rem;
}

#map {
    height: 500px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 🔹 Sección de Alertas en Tiempo Real */
#alertas-tiempo-real {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
}

#alertas-tiempo-real h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
}

#alertas-tiempo-real h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: white;
    margin: 0.5rem auto;
    border-radius: 2px;
}

/* Filtros */
.filtros-alertas {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filtro-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.filtro-btn:hover,
.filtro-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Grid de alertas */
.alertas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Tarjetas de alerta */
.alerta-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    color: #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #ccc;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
}

.alerta-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Colores según severidad */
.alerta-card.Extreme {
    border-left-color: #e74c3c;
}

.alerta-card.Severe {
    border-left-color: #e67e22;
}

.alerta-card.Moderate {
    border-left-color: #f39c12;
}

.alerta-card.Minor {
    border-left-color: #f1c40f;
}

.alerta-card.Unknown {
    border-left-color: #95a5a6;
}

/* Header de la alerta */
.alerta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.alerta-titulo {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.alerta-nivel {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.nivel-Extreme {
    background: #e74c3c;
    color: white;
}

.nivel-Severe {
    background: #e67e22;
    color: white;
}

.nivel-Moderate {
    background: #f39c12;
    color: white;
}

.nivel-Minor {
    background: #f1c40f;
    color: #333;
}

.nivel-Unknown {
    background: #95a5a6;
    color: white;
}

/* Cuerpo de la alerta */
.alerta-descripcion {
    margin-bottom: 1rem;
    line-height: 1.5;
    color: #555;
}

.alerta-descripcion p {
    margin-bottom: 0.5rem;
}

.alerta-descripcion strong {
    color: #2c3e50;
}

.alerta-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.alerta-meta span {
    flex: 1;
    min-width: 120px;
}

/* Estados especiales */
.cargando-alertas,
.sin-alertas,
.error-alertas {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    color: #333;
}

.sin-alertas,
.error-alertas {
    backdrop-filter: blur(10px);
}

.cargando-alertas p,
.sin-alertas h3,
.error-alertas h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.sin-alertas .icono,
.error-alertas .icono {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.btn-reintentar {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-reintentar:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #667eea;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Estado y controles */
.estado-alertas {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    flex-wrap: wrap;
    gap: 1rem;
}

.estado-info {
    flex: 1;
}

#contador-alertas {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timestamp {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.controles {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn-actualizar {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.btn-actualizar:hover:not(:disabled) {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-actualizar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.auto-refresh input {
    margin: 0;
}

/* Popup del mapa mejorado */
.popup-alerta {
    min-width: 250px;
}

.popup-alerta h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.popup-alerta .nivel-alerta {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

.popup-alerta p {
    margin: 0.3rem 0;
    line-height: 1.4;
    font-size: 0.9rem;
}

.popup-alerta strong {
    color: #2c3e50;
}

.popup-alerta small {
    color: #7f8c8d;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.5rem;
}

/* Sección de servicios */
#servicios {
    padding: 4rem 0;
    background: white;
}

#servicios h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #1e3c72;
    position: relative;
}

#servicios h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, #1e3c72, #2a5298);
    margin: 0.5rem auto;
    border-radius: 2px;
}

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    border-top: 4px solid #2a5298;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #1e3c72, #2a5298);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    color: #1e3c72;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card p {
    color: #666;
    line-height: 1.6;
    font-size: 1rem;
}

/* Sección de contacto */
#contacto {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#contacto h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

#contacto h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: white;
    margin: 0.5rem auto;
    border-radius: 2px;
}

#formContacto {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

#formContacto input,
#formContacto textarea {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
}

#formContacto input:focus,
#formContacto textarea:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

#formContacto textarea {
    min-height: 120px;
    resize: vertical;
}

#formContacto button {
    background: white;
    color: #2a5298;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

#formContacto button:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    background: #1e3c72;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

.tech-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: #333;
    background: #f5f5f5;
}

.signup-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1e3c72;
    font-size: 1.8rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2a5298, #3a62a8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.4);
}

.login-text {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #666;
}

.login-text a {
    color: #2a5298;
    text-decoration: none;
    font-weight: 600;
}

.login-text a:hover {
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #888;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 1rem;
    background: white;
    font-size: 0.9rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #d1d9e6;
    transform: translateY(-1px);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

.mensaje {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Notificaciones */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    #map {
        height: 400px;
    }

    .alertas-grid {
        grid-template-columns: 1fr;
    }

    .filtros-alertas {
        gap: 0.5rem;
    }

    .filtro-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .estado-alertas {
        flex-direction: column;
        text-align: center;
    }

    .controles {
        justify-content: center;
    }

    .servicios-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 1rem;
    }

    .hero {
        padding: 1rem;
    }

    .stats {
        gap: 1rem;
    }

    .stat {
        padding: 0.5rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    #map {
        height: 300px;
    }

    .alertas-grid {
        grid-template-columns: 1fr;
    }

    .alerta-card {
        padding: 1.2rem;
    }

    .alerta-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .alerta-meta {
        flex-direction: column;
    }

    .card {
        padding: 2rem 1.5rem;
    }

    #formContacto {
        padding: 1.5rem;
    }

    .filtro-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Estilos para mensajes de error mejorados */
    .error-alertas .sugerencias {
        text-align: left;
        margin: 1rem 0;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .error-alertas .sugerencias ul {
        margin: 0.5rem 0;
        padding-left: 1.5rem;
    }

    .error-alertas .sugerencias li {
        margin: 0.3rem 0;
        font-size: 0.9rem;
    }

    /* Controles de visualización del mapa */
    .controles-visualizacion {
        display: flex;
        gap: 1rem;
        align-items: center;
    }

    .control-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: white;
        font-size: 0.9rem;
        cursor: pointer;
    }

    .control-toggle input {
        margin: 0;
    }

    /* Leyenda del mapa */
    .leyenda-mapa {
        position: absolute;
        bottom: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.95);
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        backdrop-filter: blur(10px);
    }

    .leyenda-mapa h4 {
        margin: 0 0 0.5rem 0;
        color: #333;
        font-size: 0.9rem;
    }

    .leyenda-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0.3rem 0;
        font-size: 0.8rem;
    }

    .leyenda-color {
        width: 15px;
        height: 15px;
        border-radius: 3px;
        border: 1px solid #333;
    }

    /* Estilos para tooltips de polígonos */
    .tooltip-alerta {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid;
        border-radius: 8px;
        padding: 0.5rem;
        font-weight: 600;
        backdrop-filter: blur(10px);
    }

    .leaflet-tooltip-top::before {
        border-top-color: rgba(255, 255, 255, 0.95);
    }

    .leaflet-tooltip-bottom::before {
        border-bottom-color: rgba(255, 255, 255, 0.95);
    }


    .detalles-header h3 {
        margin: 0;
        color: #2c3e50;
        font-size: 1.5rem;
        flex: 1;
        margin-right: 1rem;
    }


    .detalles-section {
        background: #f8f9fa;
        padding: 1.5rem;
        border-radius: 10px;
        border-left: 4px solid #3498db;
    }

    .detalles-section h4 {
        margin: 0 0 1rem 0;
        color: #2c3e50;
        font-size: 1.1rem;
    }

    .detalles-section p {
        margin: 0.5rem 0;
        line-height: 1.4;
    }

    .area-afectada {
        background: white;
        padding: 0.8rem;
        margin: 0.5rem 0;
        border-radius: 6px;
        border-left: 3px solid #27ae60;
    }

    .detalles-acciones {
        display: flex;
        gap: 1rem;
        justify-content: flex-end;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }

    .btn-cerrar {
        background: #95a5a6;
        color: white;
        border: none;
        padding: 0.75rem 1.5rem;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.3s;
    }

    .btn-cerrar:hover {
        background: #7f8c8d;
        transform: translateY(-2px);
    }

    /* Mejoras para las tarjetas de alerta */
    .alerta-content {
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .alerta-content:hover {
        background-color: rgba(0, 0, 0, 0.02);
        border-radius: 8px;
        padding: 0.5rem;
        margin: -0.5rem;
    }

    .alerta-detalles {
        display: flex;
        justify-content: space-between;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #f0f0f0;
        font-size: 0.85rem;
        color: #666;
    }

    .alerta-acciones {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .btn-detalles {
        background: #3498db;
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.85rem;
        transition: all 0.3s;
    }

    .btn-detalles:hover {
        background: #2980b9;
        transform: translateY(-1px);
    }

    /* Responsive */
    @media (max-width: 768px) {
        .detalles-content {
            grid-template-columns: 1fr;
        }

        .detalles-alerta {
            margin: 1rem;
            padding: 1.5rem;
        }

        .detalles-header {
            flex-direction: column;
            gap: 1rem;
        }

        .alerta-acciones {
            flex-direction: column;
        }
    }

    /* Estilos para tooltips de polígonos */
    .tooltip-alerta {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid;
        border-radius: 8px;
        padding: 0.5rem;
        font-weight: 600;
        backdrop-filter: blur(10px);
    }

    .leaflet-tooltip-top::before {
        border-top-color: rgba(255, 255, 255, 0.95);
    }

    .leaflet-tooltip-bottom::before {
        border-bottom-color: rgba(255, 255, 255, 0.95);
    }

    /* Modal de detalles de alerta */
    .modal-detalles {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 10000;
        overflow-y: auto;
        backdrop-filter: blur(5px);
    }

    .detalles-alerta {
        position: relative;
        background: white;
        margin: 2rem auto;
        padding: 2rem;
        border-radius: 15px;
        max-width: 800px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        animation: modalFadeIn 0.3s;
    }

    .detalles-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #f0f0f0;
    }

    .detalles-header h3 {
        margin: 0;
        color: #2c3e50;
        font-size: 1.5rem;
        flex: 1;
        margin-right: 1rem;
    }

    .detalles-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .detalles-section {
        background: #f8f9fa;
        padding: 1.5rem;
        border-radius: 10px;
        border-left: 4px solid #3498db;
    }

    .detalles-section h4 {
        margin: 0 0 1rem 0;
        color: #2c3e50;
        font-size: 1.1rem;
    }

    .detalles-section p {
        margin: 0.5rem 0;
        line-height: 1.4;
    }

    .area-afectada {
        background: white;
        padding: 0.8rem;
        margin: 0.5rem 0;
        border-radius: 6px;
        border-left: 3px solid #27ae60;
    }

    .detalles-acciones {
        display: flex;
        gap: 1rem;
        justify-content: flex-end;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }

    .btn-cerrar {
        background: #95a5a6;
        color: white;
        border: none;
        padding: 0.75rem 1.5rem;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.3s;
    }

    .btn-cerrar:hover {
        background: #7f8c8d;
        transform: translateY(-2px);
    }

    /* Mejoras para las tarjetas de alerta */
    .alerta-content {
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .alerta-content:hover {
        background-color: rgba(0, 0, 0, 0.02);
        border-radius: 8px;
        padding: 0.5rem;
        margin: -0.5rem;
    }

    .alerta-detalles {
        display: flex;
        justify-content: space-between;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #f0f0f0;
        font-size: 0.85rem;
        color: #666;
    }

    .alerta-acciones {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .btn-detalles {
        background: #3498db;
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.85rem;
        transition: all 0.3s;
    }

    .btn-detalles:hover {
        background: #2980b9;
        transform: translateY(-1px);
    }

    /* Leyenda del mapa */
    .leyenda-mapa {
        background: rgba(255, 255, 255, 0.95);
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px);
        font-size: 0.9rem;
    }

    .leyenda-mapa h4 {
        margin: 0 0 0.5rem 0;
        color: #333;
        font-size: 0.9rem;
        border-bottom: 1px solid #eee;
        padding-bottom: 0.3rem;
    }

    .leyenda-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0.3rem 0;
    }

    .leyenda-color {
        width: 15px;
        height: 15px;
        border-radius: 3px;
        border: 1px solid #333;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .detalles-content {
            grid-template-columns: 1fr;
        }

        .detalles-alerta {
            margin: 1rem;
            padding: 1.5rem;
        }

        .detalles-header {
            flex-direction: column;
            gap: 1rem;
        }

        .alerta-acciones {
            flex-direction: column;
        }

        /* 📱 RESPONSIVE PARA MÓVIL */
        @media (max-width: 768px) {

            /* Header y navegación */
            .header-content {
                flex-direction: column;
                text-align: center;
                padding: 1rem;
            }

            .header-content nav {
                margin-top: 1rem;
                flex-wrap: wrap;
                justify-content: center;
            }

            .header-content nav a {
                margin: 0.25rem;
                font-size: 0.9rem;
            }

            /* Hero section */
            .hero {
                flex-direction: column;
                padding: 1rem;
            }

            #map {
                height: 300px !important;
                width: 100% !important;
                margin-top: 1rem;
            }

            /* Stats */
            .stats {
                flex-direction: column;
                gap: 0.5rem;
            }

            .stat {
                margin: 0.5rem 0;
            }

            /* Filtros de alertas */
            .filtros-alertas {
                flex-wrap: wrap;
                gap: 0.5rem;
            }

            .filtro-btn {
                flex: 1 1 calc(50% - 0.5rem);
                min-width: 120px;
                font-size: 0.8rem;
                padding: 0.5rem;
            }

            /* Grid de alertas */
            .alertas-grid {
                grid-template-columns: 1fr !important;
                gap: 1rem;
            }

            .alerta-item {
                margin: 0.5rem 0;
                padding: 1rem;
            }

            /* Controles */
            .controles {
                flex-direction: column;
                gap: 1rem;
            }

            .controles-visualizacion {
                flex-wrap: wrap;
                justify-content: center;
            }

            /* Servicios grid */
            .servicios-grid {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            /* Formularios */
            .form-group input,
            .form-group textarea {
                font-size: 16px;
                /* Evita zoom en iOS */
            }

            /* Modal */
            .modal-content {
                margin: 5% 10px;
                width: auto;
            }
        }

        /* 📱 Para móviles muy pequeños */
        @media (max-width: 480px) {
            .logo h1 {
                font-size: 1.5rem;
            }

            .filtro-btn {
                flex: 1 1 100%;
            }

            .hero-content h2 {
                font-size: 1.5rem;
            }

            .container {
                padding: 0 15px;
            }
        }

        /* 🔧 Asegurar que todo sea responsive */
        img,
        video,
        iframe,
        #map {
            max-width: 100%;
            height: auto;
        }

        /* Mejorar legibilidad en móvil */
        body {
            font-size: 16px;
            line-height: 1.5;
        }

        h1 {
            font-size: 2rem;
        }

        h2 {
            font-size: 1.5rem;
        }

        h3 {
            font-size: 1.25rem;
        }
    }

    .leaflet-container {
        width: 100%;
        height: 100%;
    }
}