/* --- PALETA DE COLORES UNICACH GEOMÁTICA --- */
:root {
    --brand-blue: #003399;    
    --brand-yellow: #FFCC00;  
    --brand-green: #009933;
}

/* Ajustes Generales */
body {
    height: 100vh; height: 100dvh; width: 100vw;
    overflow: hidden; font-family: 'Roboto', sans-serif; position: relative; 
}

/* --- ALERTA DE NAVEGADOR (FB/INSTAGRAM) --- */
.browser-alert {
    position: absolute; top: 0; left: 0; width: 100%;
    background-color: #ffc107; color: #333;
    padding: 10px; font-size: 0.9rem; text-align: center;
    z-index: 9999; border-bottom: 1px solid #e0a800;
}

/* --- MAPA --- */
#map {
    height: 100%; width: 100%; z-index: 1;
}

/* --- SIDEBAR COLAPSABLE --- */
#sidebar {
    position: absolute;
    z-index: 1000; 
    background: white;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    display: flex;
    flex-direction: column;
}

/* =========================================
   ESTILOS ESPECÍFICOS ESCRITORIO
   ========================================= */
@media (min-width: 768px) {
    #sidebar { top: 0; left: 0; width: 400px; height: 100%; box-shadow: 2px 0 15px rgba(0,0,0,0.15); border-right: 4px solid var(--brand-yellow); transform: translateX(-100%); }
    #sidebar.active { transform: translateX(0); }
    #sidebarToggle { position: absolute; top: 20px; right: -50px; width: 50px; height: 50px; border-radius: 0 10px 10px 0; background-color: var(--brand-blue); color: white; border: none; border-left: 1px solid rgba(255,255,255,0.2); box-shadow: 4px 0 8px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; }
    .mobile-register-hint { display: none; }
}

/* =========================================
   ESTILOS ESPECÍFICOS MÓVIL
   ========================================= */
@media (max-width: 767px) {
    #sidebar { bottom: 0; left: 0; width: 100%; height: 85dvh; border-radius: 20px 20px 0 0; transform: translateY(100%); box-shadow: 0 -5px 20px rgba(0,0,0,0.15); }
    #sidebar.active { transform: translateY(0); }
    #sidebarToggle { position: absolute; top: -35px; left: 50%; transform: translateX(-50%); width: 80px; height: 35px; border-radius: 12px 12px 0 0; border: none; background-color: var(--brand-blue); color: white; display: flex; align-items: center; justify-content: center; box-shadow: 0 -3px 10px rgba(0,0,0,0.1); font-size: 1.1rem; z-index: 1001; cursor: pointer; }
    #sidebarToggle:active { background-color: #002266; }
    #surveyForm { padding-bottom: 80px; }

    .mobile-register-hint { display: block; position: absolute; top: -80px; left: 50%; transform: translateX(-50%); background-color: white; color: var(--brand-blue); padding: 8px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 1002; white-space: nowrap; animation: bounce 2s infinite; }
    .mobile-register-hint::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid white; }

    /* DISTRIBUCIÓN DE VIÑETAS (SIN TRASLAPE) */
    .layers-hint-box { top: 15px; right: 55px; font-size: 0.75rem; padding: 5px 10px; z-index: 1003; }
    .map-hint-box { top: auto !important; bottom: 150px; left: 10px; transform: none; width: auto; max-width: 220px; font-size: 0.75rem; padding: 8px 12px; text-align: left; z-index: 1003; }
    .map-hint-box::after { display: none; }
    .zoom-hint-box { right: 60px; bottom: 25px; font-size: 0.7rem; padding: 4px 8px; }
    .reset-hint-box { right: 60px; bottom: 95px; font-size: 0.7rem; padding: 4px 8px; } 
}

@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); } 40% { transform: translateX(-50%) translateY(-10px); } 60% { transform: translateX(-50%) translateY(-5px); } }

/* ESTILOS GENERALES */
.brand-text-color { color: var(--brand-blue); }
.brand-logo { height: 60px; width: auto; object-fit: contain; }
.btn-primary { background-color: var(--brand-blue) !important; border-color: var(--brand-blue) !important; }
.btn-primary:hover { background-color: #002266 !important; }
.btn-outline-primary { color: var(--brand-blue) !important; border-color: var(--brand-blue) !important; }
.btn-outline-primary:hover { background-color: var(--brand-blue) !important; color: white !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand-yellow); box-shadow: 0 0 0 0.25rem rgba(255, 204, 0, 0.25); }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-btn input[type="checkbox"] { display: none; }
.checkbox-btn span { display: inline-block; padding: 6px 12px; background-color: #f8f9fa; color: #495057; border-radius: 50rem; font-size: 0.85rem; font-weight: 500; cursor: pointer; border: 1px solid #dee2e6; transition: all 0.2s ease; user-select: none; }
.checkbox-btn input[type="checkbox"]:checked + span { background-color: var(--brand-blue); color: white; border-color: var(--brand-blue); box-shadow: 0 2px 5px rgba(0, 51, 153, 0.3); }
.hidden-input { display: none; border-left: 3px solid var(--brand-yellow) !important; }
.show-input { display: block !important; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.leaflet-popup-content-wrapper { border-radius: 8px; }
.leaflet-popup-content h3 { color: var(--brand-blue); font-size: 1rem; font-weight: bold; margin-bottom: 5px; }
.badge-tech { background: #eee; color: #333; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }

/* LEYENDA */
.info.legend { background: white; padding: 10px 15px; font-size: 0.85rem; box-shadow: 0 0 15px rgba(0,0,0,0.2); border-radius: 5px; line-height: 1.5; color: #333; max-width: 200px; border-left: 4px solid var(--brand-yellow); }
.info.legend h4 { margin: 0 0 8px; color: #003399; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.legend-item { display: flex; align-items: center; margin-bottom: 6px; }
.legend-icon { width: 18px; height: auto; margin-right: 10px; display: inline-block; }

/* TOAST */
.map-hint-box { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1002; background-color: rgba(255, 255, 255, 0.95); padding: 10px 20px; border-radius: 50rem; box-shadow: 0 4px 15px rgba(0,0,0,0.2); border: 1px solid #e0e0e0; display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #333; font-weight: 500; width: 90%; max-width: 400px; animation: slideDown 0.5s ease-out; }
.btn-close-hint { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #666; padding: 0; line-height: 1; }
@keyframes slideDown { from { top: -50px; opacity: 0; } to { top: 20px; opacity: 1; } }

/* HINTS FLOTANTES */
.layers-hint-box { position: absolute; top: 12px; right: 60px; z-index: 1002; background-color: white; color: #333; padding: 6px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.2); white-space: nowrap; animation: pulse-right 2s infinite; transition: opacity 0.5s ease; }
.layers-hint-box::after { content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 6px solid white; }
@keyframes pulse-right { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-5px); } }

.zoom-hint-box { position: absolute; bottom: 27px; right: 60px; z-index: 1002; background-color: white; color: #333; padding: 5px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.2); white-space: nowrap; animation: pulse-up 2s infinite; transition: opacity 0.5s ease; }
.zoom-hint-box::after { content: ''; position: absolute; bottom: 10px; right: -6px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 6px solid white; }

.reset-hint-box { position: absolute; bottom: 85px; right: 60px; z-index: 1002; background-color: white; color: #333; padding: 5px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.2); white-space: nowrap; animation: pulse-up 2s infinite; transition: opacity 0.5s ease; }
.reset-hint-box::after { content: ''; position: absolute; bottom: 10px; right: -6px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 6px solid white; }

@keyframes pulse-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* BOTÓN RESET */
.leaflet-control-reset {
    background-color: #fff; width: 30px; height: 30px; border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65); cursor: pointer; text-align: center;
    line-height: 30px; font-size: 18px; color: #333;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px !important; 
}
.leaflet-control-reset:hover { background-color: #f4f4f4; }

/* Sitios */
.sites-section { margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px; }
.sites-grid { display: flex; flex-direction: column; gap: 10px; }
.site-card { display: flex; align-items: center; background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 12px; padding: 12px 15px; text-decoration: none; transition: all 0.2s ease-in-out; position: relative; overflow: hidden; }
.site-card:hover { background-color: white; border-color: var(--brand-blue); box-shadow: 0 4px 12px rgba(0, 51, 153, 0.15); transform: translateY(-2px); }
.site-icon { font-size: 1.5rem; margin-right: 15px; background: white; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.site-info { flex-grow: 1; display: flex; flex-direction: column; }
.site-title { color: #333; font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
.site-card:hover .site-title { color: var(--brand-blue); }
.site-desc { color: #777; font-size: 0.75rem; }
.site-arrow { color: #ccc; font-weight: bold; transition: transform 0.2s ease; }
.site-card:hover .site-arrow { color: var(--brand-yellow); transform: translateX(3px); }
@media (min-width: 992px) { .sites-grid { display: grid; grid-template-columns: 1fr 1fr; } }