/* ============================================
   ESTILOS FALTANTES PARA FICHA-ANIMAL.JS
   Agregar al final de formulario-recuperacion.css
   ============================================ */

/* ===== CONTEXTO OPERATIVO (Consejo en tiempo real) ===== */
.consejo-operativo-container {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c4dff15, #6366f115);
    border-left: 4px solid #7c4dff;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease;
}

/* ===== BOTONES ACCIÓN MODERNO (para mapa y acciones) ===== */
.btn-accion-moderno {
    transition: var(--luupi-transition, all 0.2s ease);
    cursor: pointer;
}

.btn-accion-moderno:active {
    transform: scale(0.97);
}

.btn-accion-moderno.btn-primario {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
}

.btn-accion-moderno.btn-secundario {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.btn-accion-moderno.btn-whatsapp {
    background: #25D366;
    color: white;
    border: none;
}

/* ===== MAPA CONTAINER ===== */
.mapa-container-moderno {
    margin: 16px 0;
    border-radius: 20px;
    overflow: hidden;
    background: #f8fafc;
}

.mapa-triangulacion-ficha {
    height: 320px;
    width: 100%;
    border-radius: 20px 20px 0 0;
}

.mapa-mini-info-moderno {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    justify-content: space-around;
}

.mapa-mini-info-moderno .info-item {
    text-align: center;
    flex: 1;
}

.mapa-mini-info-moderno .info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
}

.mapa-mini-info-moderno .info-valor {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
}

/* ===== MODAL CONFIRMACIÓN NAVEGACIÓN ===== */
.modal-confirmacion-navegacion {
    position: fixed;
    bottom: 30px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 60px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 1000000;
    animation: slideUp 0.3s ease;
    flex-wrap: wrap;
}

.modal-confirmacion-navegacion span {
    flex: 1;
    font-size: 0.9rem;
    color: #1e293b;
}

.modal-confirmacion-navegacion button {
    background: #10b981;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.modal-confirmacion-navegacion button:last-child {
    background: #e2e8f0;
    color: #475569;
}

/* ===== ACCIONES MAPA FICHA ===== */
.acciones-mapa-ficha {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

/* ===== BOTÓN VER TRIANGULACIÓN ===== */
.btn-ver-triangulacion {
    width: 100%;
    padding: 14px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-ver-triangulacion:active {
    transform: scale(0.98);
}

/* ===== CONTACTO INFO ===== */
.contacto-info-pantalla-completa {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contacto-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 12px;
}

.contacto-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
}

.contacto-value {
    flex: 1;
    font-weight: 700;
    color: #1e293b;
    font-family: monospace;
    font-size: 1rem;
}

.btn-contacto {
    background: #10b981;
    border: none;
    padding: 8px 12px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
}

/* ===== ACCIONES GRID ===== */
.acciones-grid-moderno {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

/* ===== ESTADO RECUPERADO MODERNO ===== */
.estado-recuperado-moderno {
    text-align: center;
    padding: 32px 20px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 24px;
}

.estado-recuperado-moderno .emoji-grande-moderno {
    font-size: 4rem;
    margin-bottom: 12px;
}

.estado-recuperado-moderno h4 {
    font-size: 1.5rem;
    color: #065f46;
    margin-bottom: 8px;
}

.estado-recuperado-moderno p {
    color: #047857;
}

/* ===== RECOMPENSA INFO ===== */
.recompensa-info {
    background: #fef3c7;
    padding: 12px;
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
}

/* ===== TIMELINE AVISTAMIENTOS ===== */
.timeline-avistamientos {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.timeline-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 16px;
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease backwards;
    animation-delay: calc(var(--item-index, 0) * 0.05s);
}

.timeline-item.destacado {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    border-left: 3px solid #f59e0b;
}

.timeline-item.verificado {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-left: 3px solid #10b981;
}

.timeline-marcador .emoji {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.timeline-contenido {
    flex: 1;
}

.timeline-fecha {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-badge-nuevo {
    background: #f59e0b;
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.timeline-badge-verificado {
    background: #10b981;
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.timeline-ubicacion {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-comentario {
    font-size: 0.85rem;
    color: #475569;
    font-style: italic;
    margin-bottom: 8px;
    padding: 8px 0 0;
}

.timeline-footer {
    display: flex;
    gap: 16px;
    font-size: 0.7rem;
    color: #94a3b8;
}

.timeline-avistamientos-empty {
    text-align: center;
    padding: 40px 20px;
}

.timeline-avistamientos-empty .emoji-grande {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* ===== TARJETA INFO PANTALLA COMPLETA ===== */
.tarjeta-info-pantalla-completa {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tarjeta-titulo-moderno {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ver-todos-link {
    font-size: 0.75rem;
    color: #10b981;
    cursor: pointer;
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlightNew {
    0% {
        background: #fef3c7;
        transform: scale(1.02);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* ===== LIVE UPDATE INDICATOR ===== */
.live-update-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.85rem;
    z-index: 20001;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease;
}

.live-update-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== CARGANDO MODAL ===== */
.luupigo-cargando-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.luupigo-cargando-contenido {
    background: white;
    border-radius: 32px;
    padding: 32px;
    text-align: center;
    animation: scaleIn 0.2s ease;
}

.spinner-ia {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #10b981;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== ERROR MODAL ===== */
.luupigo-error-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.luupigo-error-contenido {
    background: white;
    border-radius: 32px;
    padding: 32px;
    text-align: center;
    max-width: 320px;
    animation: scaleIn 0.2s ease;
}

.luupigo-error-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
}

.luupigo-error-titulo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 8px;
}

.luupigo-error-mensaje {
    color: #475569;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.luupigo-btn-error {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== BOTÓN RECUPERAR FICHA (ya existe, pero aseguramos) ===== */
.btn-recuperar-ficha {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 40px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-recuperar-ficha:active {
    transform: scale(0.98);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .mapa-mini-info-moderno {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .timeline-footer {
        flex-wrap: wrap;
    }
    
    .modal-confirmacion-navegacion {
        flex-direction: column;
        text-align: center;
        border-radius: 24px;
    }
    
    .modal-confirmacion-navegacion button {
        width: 100%;
    }
}


/* ============================================
   LUUPIGO - ESTILOS COMPLETOS
   Incluye: Formulario verificación + Modal éxito (sin donaciones)
   ============================================ */

/* ===== VARIABLES GLOBALES ===== */
:root {
  --recuperacion-exito: #10b981;
  --recuperacion-exito-hover: #059669;
  --recuperacion-pendiente: #f59e0b;
  --recuperacion-error: #ef4444;
  --recuperacion-fondo: #ffffff;
  --recuperacion-sombra: 0 20px 60px rgba(0, 0, 0, 0.3);
  --recuperacion-radio: 16px;
  --bg-primary: #ffffff;
  --bg-secondary: #f1f5f9;
  --border-color: #e2e8f0;
  --border-color-dark: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-white: #ffffff;
  --font-family: system-ui, -apple-system, 'Segoe UI', 'Inter', sans-serif;
  --transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  --touch-target-min: 48px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-xxl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;
  --color-info: #3b82f6;
}

/* ============================================
   PARTE 1: MODAL DE VERIFICACIÓN (formulario-recuperacion)
   ============================================ */

.formulario-recuperacion {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999 !important;
  padding: 20px;
  animation: fadeInRecuperacion 0.3s ease;
  font-family: var(--font-family);
}

.formulario-recuperacion.mostrar {
  display: flex !important;
}

.formulario-recuperacion .recuperacion-contenido {
  background: var(--recuperacion-fondo);
  border-radius: var(--recuperacion-radio);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--recuperacion-sombra);
  animation: slideUpRecuperacion 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes fadeInRecuperacion {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(10px); }
}

@keyframes slideUpRecuperacion {
  0% { opacity: 0; transform: translateY(50px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.formulario-recuperacion .recuperacion-header {
  background: linear-gradient(135deg, var(--recuperacion-exito) 0%, #059669 100%);
  color: var(--text-white);
  padding: 25px 30px;
  border-radius: var(--recuperacion-radio) var(--recuperacion-radio) 0 0;
  position: relative;
  text-align: center;
}

.formulario-recuperacion .recuperacion-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.formulario-recuperacion .cerrar-recuperacion {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--text-white);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.formulario-recuperacion .recuperacion-body {
  padding: 30px;
}

/* Panel IA */
.formulario-recuperacion .panel-ia-recuperacion {
  background: linear-gradient(135deg, var(--bg-secondary), #f1f5f9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
}

.formulario-recuperacion .metricas-ia {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.formulario-recuperacion .metrica-ia {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-primary);
  border-radius: 8px;
}

.formulario-recuperacion .metrica-ia .valor {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--recuperacion-exito);
}

.formulario-recuperacion .metrica-ia .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Formulario código */
.formulario-recuperacion .input-codigo {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1.1rem;
  text-align: center;
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
}

.formulario-recuperacion .input-codigo:focus {
  outline: none;
  border-color: var(--recuperacion-exito);
}

/* Estados verificación */
.formulario-recuperacion .codigo-correcto,
.formulario-recuperacion .estado-verificacion-correcto {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 2px solid var(--recuperacion-exito);
  color: #065f46;
  padding: 15px 20px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
}

.formulario-recuperacion .codigo-incorrecto,
.formulario-recuperacion .estado-verificacion-incorrecto {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border: 2px solid var(--recuperacion-error);
  color: #7f1d1d;
  padding: 15px 20px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
}

/* Botones */
.formulario-recuperacion .botones-recuperacion {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 25px;
}

.formulario-recuperacion .btn-recuperar {
  background: linear-gradient(135deg, var(--recuperacion-exito) 0%, var(--recuperacion-exito-hover) 100%);
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.formulario-recuperacion .btn-recuperar:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.formulario-recuperacion .btn-cancelar-recuperacion {
  background: var(--text-muted);
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================
   PARTE 2: MODAL DE ÉXITO
   ============================================ */

#modal-recuperacion-exitosa {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999 !important;
  padding: 16px;
}

#modal-recuperacion-exitosa.mostrar {
  display: flex !important;
  animation: luupiFadeIn 0.3s ease-out;
}

@keyframes luupiFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(12px); }
}

#modal-recuperacion-exitosa .modal-contenido-exito {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: luupiSlideUp 0.4s cubic-bezier(0.21, 0.98, 0.35, 1.1);
}

@keyframes luupiSlideUp {
  0% { opacity: 0; transform: translateY(40px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

#modal-recuperacion-exitosa .exito-emoji {
  text-align: center;
  font-size: 4rem;
  padding-top: 32px;
  animation: luupiBounce 0.5s ease;
}

@keyframes luupiBounce {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

#modal-recuperacion-exitosa .exito-mensaje {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin: 12px 0 8px;
}

#modal-recuperacion-exitosa .exito-detalle {
  text-align: center;
  color: #475569;
  padding: 0 20px;
  margin-bottom: 20px;
}

/* Estadísticas */
#modal-recuperacion-exitosa .estadisticas-recuperacion {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  margin: 0 20px 24px;
  border-radius: 24px;
  padding: 20px;
  display: flex;
  justify-content: space-around;
  gap: 16px;
  flex-wrap: wrap;
}

#modal-recuperacion-exitosa .estadistica-item {
  text-align: center;
  flex: 1;
}

#modal-recuperacion-exitosa .estadistica-item .numero {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #059669;
}

#modal-recuperacion-exitosa .estadistica-item .label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #065f46;
}

#modal-recuperacion-exitosa .btn-cerrar-exito {
  margin: 8px 20px 28px;
  width: calc(100% - 40px);
  background: #1e293b;
  color: white;
  border: none;
  padding: 16px;
  border-radius: 60px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

/* ============================================
   PARTE 3: NOTIFICACIONES Y UTILIDADES
   ============================================ */

.luupigo-alert {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000001;
  padding: 15px 20px;
  border-radius: 10px;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  font-weight: 600;
  max-width: 400px;
  animation: slideInRight 0.3s ease-out;
  backdrop-filter: blur(10px);
}

.luupigo-alert.alert-success { background: #10b981; }
.luupigo-alert.alert-error { background: #ef4444; }
.luupigo-alert.alert-warning { background: #f59e0b; }
.luupigo-alert.alert-info { background: #3b82f6; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.estado-recuperado-badge {
  background: #10b981;
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  display: inline-block;
  min-width: 120px;
}

.oculto {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .formulario-recuperacion { padding: 10px; }
  .formulario-recuperacion .botones-recuperacion { grid-template-columns: 1fr; }
  .formulario-recuperacion .metricas-ia { grid-template-columns: 1fr; }
  
  .luupigo-alert {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}