﻿html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}


/* Botón flotante */
.btn-float {
    position: fixed;
    bottom: 50px;
    right: 25px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #2563eb;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.3);
    z-index: 1000;
    transition: transform .15s ease;
}

    .btn-float:hover {
        transform: scale(1.1);
    }


/* Botón flotante totalmente redondo */
.btn-donar {
    position: fixed;
    bottom: 50px;
    right: 100px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #2563eb; /* Azul intenso */
    color: white;
    font-size: 28px;
    text-align: center;
    line-height: 56px; /* Centra el emoji/texto verticalmente */
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.15s ease, background 0.3s ease;
    padding: 0; /* Importante para que no crezca */
}

    /* Efecto hover */
    .btn-donar:hover {
        transform: scale(1.1);
        background: #1e40af; /* Azul más oscuro */
    }




.modal-custom {
    background: #fff;
    width: 400px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
    animation: fadeIn .2s ease-out;
    font-family: Arial, sans-serif;
}

    .modal-custom h3 {
        margin-top: 0;
        margin-bottom: 15px;
    }

    .modal-custom label {
        font-weight: bold;
        display: block;
        margin-top: 10px;
    }

    .modal-custom input,
    .modal-custom textarea,
    .modal-custom select {
        width: 100%;
        padding: 8px;
        margin-top: 4px;
        border-radius: 6px;
        border: 1px solid #ccc;
    }

    .modal-custom textarea {
        resize: vertical;
    }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-secondary {
    background: #e5e7eb;
}

.terms {
    font-size: 12px;
    color: #555;
    margin-top: 10px;
}

    .terms input {
        vertical-align: middle;
    }

@keyframes fadeIn {
    from {
        transform: scale(.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}



/* Footer fijo tipo app */
#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 9999;
    background: linear-gradient(90deg, #fbcfe8, #f9a8d4, #f472b6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 -4px 12px rgba(0,0,0,.35);
}

/* Contenido inline */
.footer-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

    .footer-bar a {
        color: #fff;
        text-decoration: underline;
        cursor: pointer;
    }

        .footer-bar a:hover {
            opacity: .8;
        }

.footer-sep {
    opacity: .6;
}



.footer-bar > span {
    color: #6c757d;
}


.footer-legal > span {
    color: #6c757d;
}
  

/* ============================= */
/* SweetAlert2 - Z-index global  */
/* ============================= */

/* Contenedor principal del SweetAlert */
.swal2-container {
    z-index: 5000 !important; /* Siempre encima de cualquier modal */
    pointer-events: auto !important; /* Asegura que se pueda interactuar */
}

/* Popup interno */
.swal2-popup {
    z-index: 5001 !important; /* Encima del overlay */
}

/* Botones de SweetAlert */
.swal2-confirm,
.swal2-cancel {
    z-index: 5002 !important; /* Asegura que los botones sean clicables */
}

/* Loading o alertas especiales */
.swal2-toast {
    z-index: 5005 !important;
}

/* Ajuste de altura para modales flex/transform */
.swal2-popup {
    height: auto !important;
    max-height: 90vh; /* Evita que se corte en pantallas pequeñas */
}




.modal-backdrop-custom {
    display: none; /* oculto por defecto */
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 10000; /* menor que Swal */
}

.modal-custom-centered {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}



    .modal-custom-centered h3 {
        margin-top: 0;
        font-size: 1.5rem;
    }

    .modal-custom-centered label {
        display: block;
        margin: 10px 0 4px;
        font-weight: 500;
    }

    .modal-custom-centered input,
    .modal-custom-centered textarea,
    .modal-custom-centered select {
        width: 100%;
        padding: 8px;
        border-radius: 5px;
        border: 1px solid #ccc;
        box-sizing: border-box;
        margin-bottom: 10px;
    }

.modal-footer {
    text-align: right;
    margin-top: 15px;
}

    .modal-footer button {
        margin-left: 10px;
    }




/* Contenedor del checkbox */
.custom-checkbox {
    display: flex;
    align-items: flex-start;
    margin: 10px 0;
    font-size: 0.95rem;
}

    /* Ocultamos el checkbox real */
    .custom-checkbox input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        cursor: pointer;
    }

    /* Estilo del “check” personalizado */
    .custom-checkbox label {
        position: relative;
        padding-left: 30px; /* espacio para el check */
        cursor: pointer;
        user-select: none;
    }

        /* Caja del check */
        .custom-checkbox label::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            width: 20px;
            height: 20px;
            border: 2px solid #0070BA;
            border-radius: 5px;
            background-color: white;
            transition: 0.2s;
        }

    /* Marca cuando está seleccionado */
    .custom-checkbox input:checked + label::after {
        content: "✔";
        position: absolute;
        left: 2px;
        top: -2px;
        font-size: 18px;
        color: #0070BA;
    }



/*#logoFlotante {
    position: fixed;*/ /* Siempre flotando */
    /*top: 15px;*/ /* Distancia desde el top */
    /*right: 15px;*/ /* Distancia desde la derecha */
    /*width: 50px;*/ /* Tamaño del logo */
    /*height: 50px;*/ /* Mantener proporción */
    /*border-radius: 10px;*/ /* Bordes redondeados */
    /*box-shadow: 0 4px 12px rgba(0,0,0,0.3);*/ /* Sombra ligera */
    /*z-index: 5000;*/ /* Muy arriba, sobre modales normales */
    /*cursor: pointer;*/ /* Cambio de cursor al pasar */
    /*transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    #logoFlotante:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    }*/






/* Fondo del modal */
.modal-backdrop-privacidad {
    display: none; /* oculto por defecto */
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0; */
    background: rgba(0,0,0,0.6);
    z-index: 4000; /* más alto que la mayoría de modales */

    display: flex; /* centrado con flex */
    align-items: center; /* vertical */
    justify-content: center; /* horizontal */
    padding: 20px; /* para que no quede pegado a los bordes */
    overflow: auto; /* permite scroll si contenido es alto */
}

/* Contenido del modal */
.modal-privacidad {
    background: #fff;
    max-width: 80vh;
    width: 100%;
    height: 85VH;
    max-height: 85vh; /* nunca demasiado alto */
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto; /* scroll interno si necesario */
    position: relative;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

    /* Botón de cerrar */
    .modal-privacidad .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background: transparent;
        border: none;
        font-size: 22px;
        cursor: pointer;
        color: #333;
    }



    .swal2-container {
    z-index: 999999 !important;
}







#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #fbcfe8, #f9a8d4, #f472b6);
    border-top: 1px solid #ddd;
    padding: 8px 10px;
    z-index: 500;
    text-align: center;
    font-size: 13px;
}

.footer-bar {
    font-weight: 600;
    margin-bottom: 4px;
}

.footer-legal {
    font-size: 12px;
    line-height: 1.4;
}

    .footer-legal a {
        font-weight: 600;
        margin-left: 6px;
        text-decoration: none;
        cursor: pointer;
    }

/* En móvil */
@media (max-width: 600px) {

    #footer {
        font-size: 12px;
        padding: 8px;
    }

    .footer-legal {
        font-size: 11.5px;
    }
}





#logoFlotante {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    background: #fff;
}


#menuMapa {
    display: none;
    margin-top: 30px;
    margin-right: 65px !important;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    overflow: hidden;
    cursor: pointer;
}


#logoWrapper {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1001;
}

#badgeTema {
    position: absolute;
    bottom: -20px;
    right: -2px;
    background: #1e1e1e;
    color: #fff;
    font-size: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer; /* 👈 ahora sí es botón */
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.waze-soft .leaflet-tile {
    filter: hue-rotate(212deg) saturate(135%) brightness(78%) contrast(112%);
}





.mensaje-mapa {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 40px;
    background: rgba(20, 30, 60, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 9999;
}

    .mensaje-mapa.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .mensaje-mapa.valido {
        background: rgba(0, 150, 90, 0.8);
    }

    .mensaje-mapa.error {
        background: rgba(180, 30, 40, 0.85);
    }






/* LAYOUT BASE */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', sans-serif;
    width: 100vw;
}

.contenedor {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 🟢🟢🟢 SIDEBAR - SIN POSITION, SIN Z-INDEX 🟢🟢🟢 */
#sidebarNotas {
    width: 300px;
    height: 93vh !important;
    background: linear-gradient(180deg, #f8faff 0%, #eef2f7 100%);
    border-right: 2px solid #d0d9e4;
    box-shadow: 3px 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    visibility: visible !important;
    /* 🟢 BORRADO: position: fixed; */
    /* 🟢 BORRADO: z-index: 9999 !important; */
}



/* HEADER */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #3498db;
    color: white;
    cursor: pointer;
    user-select: none;
}

/* LISTA DE NOTAS */
#listaNotas {
    list-style: none;
    padding: 15px;
    margin: 0;
    flex: 1; /* 🟢 OCUPA TODO EL ESPACIO QUE SOBRA */
    overflow-y: auto; /* Scroll solo en la lista */
    min-height: 0; /* Importante para flex */
}



    #listaNotas li {
        padding: 12px;
        border-radius: 10px;
        margin-bottom: 10px;
        background: rgba(255,255,255,0.8);
        cursor: pointer;
    }

/* 🟢🟢🟢 MAPA - OCUPA EL RESTO DEL ESPACIO 🟢🟢🟢 */
#map {
    flex: 1 1 auto;
    min-height: 300px; /* previene altura 0 en móviles pequeños */
}


/* COLAPSADO */
#sidebarNotas.collapsed {
    width: 40px;
}

    #sidebarNotas.collapsed .titulo-texto,
    #sidebarNotas.collapsed #listaNotas,
    #sidebarNotas.collapsed #RefrescadorMapaLista{
        display: none; /* 🟢 CAMBIADO: block → none */
    }


    #sidebarNotas.collapsed .sidebar-header {
        justify-content: center;
    }




/* Lista de notas - AHORA CON FONDOS CLAROS */
#listaNotas {
    list-style: none;
    padding: 0;
    margin: 0;
}

    #listaNotas li {
        position: relative;
        padding: 12px 15px;
        border-radius: 12px;
        margin-bottom: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        border-left: 6px solid transparent;
        font-size: 14px;
        color: #2c3e50; /* Texto oscuro */
        background: rgba(255, 255, 255, 0.7); /* Fondo blanco semitransparente */
        box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    }

        /* Colores más suaves para los bordes izquierdos */
        #listaNotas li:nth-child(1) {
            border-left-color: #2ecc71; /* Verde más claro */
            background: rgba(46, 204, 113, 0.08);
        }

        #listaNotas li:nth-child(2) {
            border-left-color: #e67e22; /* Naranja */
            background: rgba(230, 126, 34, 0.08);
        }

        #listaNotas li:nth-child(3) {
            border-left-color: #3498db; /* Azul */
            background: rgba(52, 152, 219, 0.08);
        }

        #listaNotas li:nth-child(4) {
            border-left-color: #f39c12; /* Amarillo/naranja */
            background: rgba(243, 156, 18, 0.08);
        }

        #listaNotas li:nth-child(5) {
            border-left-color: #9b59b6; /* Púrpura */
            background: rgba(155, 89, 182, 0.08);
        }

        #listaNotas li:nth-child(6) {
            border-left-color: #1abc9c; /* Turquesa */
            background: rgba(26, 188, 156, 0.08);
        }

        #listaNotas li:nth-child(7) {
            border-left-color: #e74c3c; /* Rojo */
            background: rgba(231, 76, 60, 0.08);
        }

        #listaNotas li:nth-child(8) {
            border-left-color: #34495e; /* Azul grisáceo */
            background: rgba(52, 73, 94, 0.08);
        }

        #listaNotas li:nth-child(9) {
            border-left-color: #16a085; /* Verde azulado */
            background: rgba(22, 160, 133, 0.08);
        }

        #listaNotas li:nth-child(10) {
            border-left-color: #c0392b; /* Rojo oscuro */
            background: rgba(192, 57, 43, 0.08);
        }

        /* Hover efecto - más visible en fondo claro */
        #listaNotas li:hover {
            transform: translateX(5px);
            background: rgba(52, 152, 219, 0.15);
            box-shadow: 0 5px 15px rgba(0,0,0,0.08);
        }

    /* Títulos y fechas en texto oscuro */
    #listaNotas .tituloNota {
        font-weight: 600;
        font-size: 16px;
        margin-bottom: 4px;
        color: #1e3c5c;
    }

    #listaNotas .fechaCiudad {
        font-size: 12px;
        opacity: 0.7;
        color: #5d6d7e;
    }

/* Botón refrescar mapa - mantiene el verde pero más vibrante */
#sidebarNotas button {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-radius: 12px;
    background: #2ecc71;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.2);
}

    #sidebarNotas button:hover {
        background: #27ae60;
        transform: scale(1.02);
        box-shadow: 0 6px 15px rgba(46, 204, 113, 0.3);
    }

/* LOADER - adaptado para fondo claro */
.loader-container {
    padding: 30px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loader-text {
    color: #5d6d7e;
    font-size: 14px;
    margin: 0;
}

/* Mensaje de error */
.error-message {
    color: #e74c3c;
    padding: 20px;
    text-align: center;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 12px;
}

/* Sin notas */
.empty-message {
    color: #7f8c8d;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}



/* ===== ORIENTACIÓN HORIZONTAL EN MÓVIL ===== */
@media screen and (max-width: 768px) and (orientation: landscape) {
  /*  #sidebarNotas {
        max-height: 30vh;
    }
*/
    #map {
        height: 70vh !important;
        flex: 1 1 auto;
        min-height: 300px; /* nunca demasiado pequeño */
    }

/*    #listaNotas {
        max-height: calc(30vh - 60px);
    }*/
}







/* 🟢 ANIMACIÓN DEL SPINNER 🟢 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 🟢 ESTILOS DEL LOADER 🟢 */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52,152,219,0.2);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* 🟢 MODO OSCURO 🟢 */
#sidebarNotas.modo-oscuro .loader-text {
    color: #ddd;
}

#sidebarNotas.modo-oscuro .loader-spinner {
    border: 4px solid rgba(255,255,255,0.2);
    border-top: 4px solid #fff;
}





/* EN TU CSS */
#sidebarNotas.modo-oscuro {
    /*background: linear-gradient(180deg, #4a5c6e 0%, #3a4c5e 100%) !important;*/
    background: #314158;
    border-right: 2px solid #5a6c7e !important;
    color: white !important;
}

#sidebarNotas.modo-claro {
    background: linear-gradient(180deg, #f8faff 0%, #eef2f7 100%) !important;
    border-right: 2px solid #d0d9e4 !important;
    color: #2c3e50 !important;
}

#sidebarNotas.modo-oscuro .sidebar-header {
    background: #2c3e50 !important;
}

#sidebarNotas.modo-claro .sidebar-header {
    background: #3498db !important;
}


.leaflet-marker-icon,
.leaflet-marker-shadow {
    z-index: 1100 !important; /* sobre tus botones flotantes */
}

.leaflet-popup {
    z-index: 1200 !important;
}






.mini-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(52,152,219,0.2);
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spinMini 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes spinMini {
    to {
        transform: rotate(360deg);
    }
}







/* Lista de notas */
#listaNotas {
    list-style: none;
    padding: 0;
    margin: 0;
}

    /* Cada nota */
    #listaNotas li {
        padding: 10px 12px;
        margin-bottom: 8px;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s, color 0.2s;
        display: flex;
        flex-direction: column;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

        /* Título de la nota */
        #listaNotas li .tituloNota {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 4px;
            color: #FFA500;
        }

        /* Fecha y estado */
        #listaNotas li .fechaCiudad {
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 5px;
        }

/* Spinner mini */
.mini-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #ccc;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* Animación del spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 🔹 Modo claro */
#sidebarNotas.modo-claro #listaNotas li {
    background-color: #F3F2F2;
    color: #222;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

    #sidebarNotas.modo-claro #listaNotas li:hover {
        background-color: #e6f0ff;
    }

    #sidebarNotas.modo-claro #listaNotas li .fechaCiudad {
        color: #555;
    }

#sidebarNotas.modo-claro .mini-spinner {
    border: 2px solid #ccc;
    border-top: 2px solid #666;
}

/* 🔹 Modo oscuro */
#sidebarNotas.modo-oscuro #listaNotas li {
    background-color: #1f1f1f;
    color: #fff;
    box-shadow: 0 1px 3px rgba(255,255,255,0.05);
}

    #sidebarNotas.modo-oscuro #listaNotas li:hover {
        background-color: #333;
    }

    #sidebarNotas.modo-oscuro #listaNotas li .fechaCiudad {
        color: #aaa;
    }

#sidebarNotas.modo-oscuro .mini-spinner {
    border: 2px solid #555;
    border-top: 2px solid #ddd;
}