:root {
    --bg-dark: #0f172a;
    --notch-bg: rgba(255, 255, 255, 0.95);
    --blue: #2563EB;
    --red: #E11D48;
    --text-main: #1E293B;
    --border: #E2E8F0;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif; }

body { overflow: hidden; background: #e5e5e5; }

/* EL MAPA OCUPA TODA LA PANTALLA */
#map-container { 
    width: 100vw; 
    height: 100dvh; 
    position: absolute; 
    top: 0; 
    left: 0; 
    z-index: 1; 
}

/* ----------------------------------
   EL NOTCH FLOTANTE (ESTILO APPLE)
   ---------------------------------- */
.notch-header {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 500px; /* En PC no se verá gigante */
    background: var(--notch-bg);
    backdrop-filter: blur(15px);
    border-radius: 28px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 2000;
    border: 1px solid rgba(255,255,255,0.4);
}

.notch-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.logo-text { font-weight: 800; font-size: 18px; color: var(--text-main); }

.btn-add {
    background: var(--bg-dark);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* BUSCADOR Y DROPDOWN */
.search-wrapper { position: relative; margin-bottom: 12px; }

.search-wrapper input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 15px;
    background: #F1F5F9;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
.search-wrapper input:focus { background: #E2E8F0; }

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-top: 8px;
    max-height: 250px;
    overflow-y: auto;
    display: none; /* Oculto por defecto */
    z-index: 3000;
    border: 1px solid var(--border);
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    flex-direction: column;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #F8FAFC; }
.search-result-title { font-weight: 700; color: var(--text-main); }
.search-result-cat { font-size: 12px; color: #64748B; margin-top: 3px; }

/* FILTROS SCROLL */
.filter-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip { white-space: nowrap; padding: 6px 14px; background: white; border: 1px solid var(--border); border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; color: #475569; }
.filter-chip.active { background: var(--bg-dark); color: white; border-color: var(--bg-dark); }
.filter-chip.help-chip { color: var(--blue); background: #EFF6FF; border-color: #BFDBFE;}
.filter-chip.need-chip { color: var(--red); background: #FFF1F2; border-color: #FECDD3;}

/* BOTÓN GPS Y ESTADÍSTICAS */
.btn-locate {
    position: absolute;
    bottom: 30px; /* Lo bajamos porque arriba está el Notch */
    left: 15px;
    background: white;
    width: 50px; height: 50px;
    border-radius: 25px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    cursor: pointer; z-index: 1000; font-size: 22px;
}
.stats-box {
    position: absolute;
    bottom: 30px; right: 15px;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(5px);
    padding: 10px 15px; border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); z-index: 1000; font-size: 13px;
}
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.stat-divider { border: 0; height: 1px; background: var(--border); margin: 5px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot-blue { background: var(--blue); } .dot-red { background: var(--red); }

/* RESTO DEL DISEÑO (MODAL Y PINES) */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(3px); z-index: 4000; display: none; align-items: flex-end; justify-content: center; }
.modal-content { background: white; width: 100%; max-width: 500px; padding: 25px; border-radius: 25px 25px 0 0; animation: slideUp 0.3s ease-out; max-height: 90vh; overflow-y: auto; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-close { background: #F1F5F9; border: none; width: 30px; height: 30px; border-radius: 15px; cursor: pointer; font-weight: bold; }

.type-selector { display: flex; gap: 10px; margin-bottom: 20px; }
.type-selector input { display: none; }
.type-label { flex: 1; text-align: center; padding: 12px; border: 2px solid var(--border); border-radius: 12px; font-weight: bold; font-size: 13px; cursor: pointer; }
#typeHelp:checked + .help-label { background: #EFF6FF; border-color: var(--blue); color: var(--blue); }
#typeNeed:checked + .need-label { background: #FFF1F2; border-color: var(--red); color: var(--red); }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: bold; margin-bottom: 5px; color: #333; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #F8FAFC; outline: none; }
.btn-submit { width: 100%; padding: 15px; background: var(--blue); color: white; border: none; border-radius: 12px; font-weight: bold; font-size: 16px; margin-top: 10px; cursor: pointer; }

.map-picker-banner { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: var(--bg-dark); color: white; padding: 12px 20px; border-radius: 25px; z-index: 5000; display: flex; align-items: center; gap: 15px; }
.map-picker-banner button { background: rgba(255,255,255,0.2); border: none; color: white; padding: 5px 12px; border-radius: 15px; cursor: pointer; }
.map-input-wrapper { display: flex; gap: 10px; }
.btn-map-select { background: var(--bg-dark); color: white; border: none; padding: 0 15px; border-radius: 10px; font-weight: bold; cursor: pointer; }

.custom-pin { 
    width: 36px; 
    height: 36px; 
    border-radius: 50% 50% 50% 0; 
    transform: rotate(-45deg); 
    border: 3px solid white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    /* Le quitamos el position: absolute y los margins que volvían locos a los teléfonos */
}
.pin-blue { background: var(--blue); } .pin-red { background: var(--red); }
.pin-emoji { transform: rotate(45deg); font-size: 18px; margin-top: 2px; margin-left: 2px; }

.popup-buttons { display: flex; gap: 10px; margin-top: 15px; }
.btn-popup { flex: 1; padding: 10px; border-radius: 8px; border: none; font-weight: bold; font-size: 13px; cursor: pointer; text-align: center; text-decoration: none; }
.btn-dir { background: var(--bg-dark); color: white !important; }
.btn-share { background: #F1F5F9; border: 1px solid var(--border); color: #333;}