/* Mapa grande para elegir la ubicación de un avistamiento (js/mapa_ubicacion.js) */

/* ---------- Botón sobre el mini mapa ---------- */
.mini-mapa { position: relative; }
.mini-mapa__ampliar {
    position: absolute;
    z-index: 500;
    right: 10px;
    top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid rgba(74, 222, 128, 0.45);
    border-radius: 8px;
    background: rgba(15, 15, 15, 0.82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #4ade80;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}
.mini-mapa__ampliar:hover { background: rgba(5, 150, 105, 0.95); color: #fff; transform: scale(1.04); }
.mini-mapa__ampliar:active { transform: scale(0.97); }
.mini-mapa__ampliar:focus-visible { outline: 2px solid #4ade80; outline-offset: 2px; }
.mini-mapa__pista { margin: 5px 0 0; font-size: 11px; color: #8b95a3; }

/* ---------- Ventana a pantalla completa ---------- */
body.mg-abierto { overflow: hidden; }
.mapa-grande {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    background: #0f0f0f;
    opacity: 0;
    transform: scale(0.985);
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}
.mapa-grande[hidden] { display: none; }
.mapa-grande.is-open { opacity: 1; transform: none; }

.mapa-grande__bar { display: flex; align-items: center; gap: 16px; padding: 14px 20px; background: #141414; border-bottom: 1px solid #262626; }
.mapa-grande__titulo { flex: none; line-height: 1.25; }
.mapa-grande__titulo strong { display: block; font-size: 15px; color: #f7fafc; }
.mapa-grande__titulo small { font-size: 12px; color: #8b95a3; }
.mapa-grande__buscar { flex: 1; display: flex; gap: 8px; max-width: 520px; margin-left: auto; }
.mapa-grande__buscar input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 10px; border: 1px solid #333; background: #0f0f0f; color: #fff; font: inherit; font-size: 14px; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.mapa-grande__buscar input:focus { border-color: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15); }
.mg-btn { padding: 10px 16px; border-radius: 10px; border: 1px solid #333; background: #1c1c1c; color: #e5e7eb; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease; }
.mg-btn:hover:not(:disabled) { background: #262626; border-color: #4a4a4a; }
.mg-btn:active:not(:disabled) { transform: scale(0.97); }
.mg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.mg-btn:focus-visible { outline: 2px solid #4ade80; outline-offset: 2px; }
.mg-btn--primario { background: #059669; border-color: #059669; color: #fff; }
.mg-btn--primario:hover:not(:disabled) { background: #047857; border-color: #047857; }
.mg-cerrar { width: 40px; height: 40px; padding: 0; font-size: 22px; line-height: 1; }

.mapa-grande__cuerpo { position: relative; flex: 1; min-height: 0; }
#mapaGrandeMapa { position: absolute; inset: 0; cursor: crosshair; background: #1a1a1a; }
#mapaGrandeMapa.leaflet-dragging { cursor: grabbing; }

/* Herramientas flotantes */
.mapa-grande__tools { position: absolute; z-index: 1000; left: 14px; bottom: 28px; display: flex; flex-direction: column; gap: 8px; }
.mg-tool { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 1px solid #333; background: rgba(15, 15, 15, 0.9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #e5e7eb; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease; }
.mg-tool:hover { background: rgba(38, 38, 38, 0.95); border-color: #4ade80; }
.mg-tool:active { transform: scale(0.97); }
.mg-tool:focus-visible { outline: 2px solid #4ade80; outline-offset: 2px; }
.mg-tool[aria-pressed="true"] { border-color: #4ade80; color: #4ade80; }
.mg-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Mensajes sobre el mapa */
.mg-vacio { position: absolute; z-index: 1000; left: 50%; top: 22px; transform: translateX(-50%); padding: 10px 18px; border-radius: 50px; background: rgba(15, 15, 15, 0.92); border: 1px solid rgba(74, 222, 128, 0.4); color: #d1fae5; font-size: 13px; font-weight: 500; pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.mg-vacio[hidden] { display: none; }
.mg-aviso { position: absolute; z-index: 1000; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 13px; color: #fecaca; text-shadow: 0 1px 4px #000; pointer-events: none; }
.mg-aviso:empty { display: none; }

.mapa-grande__pie { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; background: #141414; border-top: 1px solid #262626; }
.mg-coords { font-size: 13px; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.mapa-grande__acciones { display: flex; gap: 10px; }

@media (max-width: 720px) {
    .mapa-grande__bar { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
    .mapa-grande__titulo { order: 1; flex: 1; }
    .mg-cerrar { order: 2; }
    .mapa-grande__buscar { order: 3; flex: 1 1 100%; max-width: none; margin-left: 0; }
    .mapa-grande__titulo small { display: none; }
    .mapa-grande__pie { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
    .mg-coords { text-align: center; font-size: 12px; }
    .mapa-grande__acciones .mg-btn { flex: 1; }
    .mapa-grande__tools { bottom: 18px; left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .mapa-grande, .mini-mapa__ampliar, .mg-btn, .mg-tool { transition: none; }
}
