/* =========================================================
   ESTILOS GLOBALES EVENTMAP (OFICIAL)
   ========================================================= */
   
   /* 1. IMPORTAR LA FUENTE POPPINS (IGUAL QUE EN ADMIN) */
   @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

   /* 2. APLICAR LA FUENTE AL BODY */
   body{
       margin:0;
       padding-top:70px;
       overflow-x:hidden;
       font-family: 'Poppins', sans-serif; /* Cambio aquí */
   }

   /* ------- CABECERA ------- */
   #cabecera-principal{height:60px;z-index:1000;padding-left:20px}
   #icono-menu{font-size:28px;cursor:pointer;color:#000;transition:transform .2s}
   #icono-menu:hover{transform:scale(1.1)}
   
   /* ------- MENÚ LATERAL ------- */
   #menu-lateral{position:fixed;top:0;left:-250px;width:250px;height:100vh;background:#15D400;color:#000;
     transition:left .4s;z-index:1500;box-shadow:2px 0 8px rgba(0,0,0,.3);display:flex;flex-direction:column;justify-content:space-between;
     font-weight:500}
   #menu-lateral.abierto{left:0}
   #menu-cabecera{display:flex;align-items:center;justify-content:space-between;padding:15px 20px;border-bottom:1px solid rgba(0,0,0,.2)}
   #menu-cabecera img{height:40px}
   #boton-cerrar{font-size:28px;font-weight:bold;color:#000;cursor:pointer;transition:transform .2s}
   #boton-cerrar:hover{transform:scale(1.2)}
   .menu-opciones{flex:1;display:flex;flex-direction:column;gap:5px;padding-top:10px}
   .menu-opciones a{display:block;padding:15px 25px;text-decoration:none!important;color:#000!important;font-weight:700;
     text-transform:uppercase;letter-spacing:.5px;font-size:15px;transition:background .2s,color .2s}
   .menu-opciones a:hover{background:rgba(0,0,0,.1)}
   #menu-pie {
    background: #15D400;      /* fondo del bloque inferior */
    padding: 15px;
}

#menu-pie a {
    display: block;           /* ocupa todo el ancho */
    width: 100%;              /* asegura cobertura completa */
    padding: 15px;
    color: white;
    font-weight: bold;
}

#menu-pie a:hover {
    background: rgba(0,0,0,0.15); /* hover sobre TODO el bloque */
}

   #fondo-oscuro{position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,.3);opacity:0;visibility:hidden;transition:opacity .3s;z-index:1400}
   #fondo-oscuro.visible{opacity:1;visibility:visible}
   
   /* ------- CALENDARIO (3 meses) ------- */
   #contenedor-calendarios {
    position: fixed;
    top: 80px;
    right: 30px;
    width: 280px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,.25);
    overflow-y: auto;
    z-index: 1200;
  }
  
   .calendario{border-bottom:1px solid rgba(0,0,0,.1);padding:15px}
   .calendario:last-child{border-bottom:none}
   .calendario h6{text-align:center;font-weight:700;text-transform:uppercase;margin-bottom:10px}
   .grid-calendario{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;text-align:center;font-size:14px}
   .grid-calendario div{padding:6px 0;border-radius:5px;font-weight:500}
   .grid-calendario .seleccionado{background:#15D400;color:#fff;font-weight:700}
   .grid-calendario .dia{cursor:pointer;transition:background .2s}
   .grid-calendario .dia:hover{background:rgba(21,212,0,.2)}
   
   /* ------- LEYENDA ------- */
   #leyenda{position:fixed;bottom:30px;left:30px;width:220px;background:#fff;border-radius:12px;
     box-shadow:0 4px 15px rgba(0,0,0,.25);z-index:1200;padding:15px;font-size:14px}
   #leyenda h6{text-align:center;text-transform:uppercase;font-weight:700;margin-bottom:8px}
   #leyenda ul{list-style:none;padding:0;margin:0}
   #leyenda li{display:flex;align-items:center;gap:10px;margin:6px 0;font-weight:600}
   .circulo{width:14px;height:14px;border-radius:50%;display:inline-block}
   
   /* ====================== MAPA ====================== */
   #mapa{position:fixed;top:60px;left:0;width:100%;height:calc(100vh - 60px);z-index:1}
   
   /* Marcadores personalizados (pin animado con círculo blanco) */
   .pin {
     --color: #007bff;
     position: relative;
     width: 24px;
     height: 24px;
     transform: rotate(-45deg);
     background: var(--color);
     border-radius: 50% 50% 50% 0;
     box-shadow: 0 2px 6px rgba(0,0,0,.35);
     animation: pin-bounce .28s ease-out;
   }
   .pin::after {
     content: "";
     position: absolute;
     width: 10px;
     height: 10px;
     left: 50%;
     top: 50%;
     transform: translate(-50%, -50%) rotate(45deg);
     background: #fff;
     border-radius: 50%;
   }
   .pin:hover {
     filter: brightness(1.05);
     transform: rotate(-45deg) scale(1.06);
     transition: transform .12s ease, filter .12s ease;
   }
   @keyframes pin-bounce {
     0%   { transform: translateY(-10px) scale(.85) rotate(-45deg); opacity:0; }
     60%  { transform: translateY(0px)  scale(1.04) rotate(-45deg); opacity:1; }
     100% { transform: translateY(0px)  scale(1.00) rotate(-45deg); }
   }

 /* ==========================
   BOTÓN LOGOUT ANIMADO
   ========================== */
.logoutButton {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 2px solid #15D400;
  color: #15D400;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.logoutButton:hover {
  background: #15D400;
  color: white;
}

.logoutButton__svg {
  width: 20px;
  height: 20px;
}

.logoutButton__path,
.logoutButton__path2 {
  stroke-dasharray: 40;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease;
}

.logoutButton.animate .logoutButton__path {
  stroke-dashoffset: 40;
}

.logoutButton.animate .logoutButton__path2 {
  stroke-dashoffset: -40;
}

.logoutButton__text {
  font-size: 14px;
}

/* =========================================================
   ESTILOS POPUP MAPA (Diseño Clean SaaS)
   ========================================================= */

/* Quitar padding por defecto de Leaflet para que la imagen llegue al borde */
.leaflet-popup-content-wrapper {
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  border: none;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 300px !important; /* Ancho fijo para consistencia */
}

/* Contenedor principal */
.card-saas {
  /* Cambio aquí para asegurar consistencia en popups */
  font-family: 'Poppins', sans-serif; 
  background: #fff;
}

/* Imagen de cabecera */
.card-saas-img {
  height: 150px;
  width: 100%;
  background-color: #eee; /* Color de fondo si no carga imagen */
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Etiqueta de categoría flotante */
.card-cat-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--verde, #15D400); /* Usará el color dinámico o verde por defecto */
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Cuerpo de la tarjeta */
.card-body {
  padding: 18px;
}

/* Título */
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #222;
  line-height: 1.3;
}

/* Fecha y Hora */
.card-date {
  color: #666;
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* Descripción */
.card-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 18px;
  
  /* Cortar texto si es muy largo (3 líneas) */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden; 
}

/* Botón de acción */
.btn-saas {
  display: block;
  width: 100%;
  text-align: center;
  background: #f8f9fa;
  color: #333;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-saas:hover {
  background: #15D400; /* Verde corporativo al pasar ratón */
  color: white;
  border-color: #15D400;
}

/* =========================================================
   ESTILOS LOGIN Y REGISTRO
   ========================================================= */

/* Clase específica para el body de login/registro para anular el padding global */
body.login-layout {
  padding-top: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f4f6f9;
}

.login-card {
  background: white;
  width: 100%;
  max-width: 450px; /* Ancho estándar */
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  position: relative;
}

.login-logo {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.login-logo i { color: #15D400; }

.login-subtitle {
  color: #888;
  font-size: 14px;
  text-align: center;
  margin-bottom: 30px;
  margin-top: 0;
}

/* Grid y Inputs */
.input-group { position: relative; margin-bottom: 15px; }
.input-group label {
  font-size: 12px; font-weight: 600; color: #666; margin-bottom: 5px; display: block;
}
.input-wrapper { position: relative; }
.input-wrapper i {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #aaa; transition: 0.3s;
}

/* Reutilizamos estilos de form pero aseguramos consistencia */
.login-card .form-control {
  width: 100%; padding: 12px 15px 12px 40px;
  border: 2px solid #eee; border-radius: 8px; font-size: 14px; outline: none; transition: 0.3s; box-sizing: border-box;
  background: white;
}
.login-card .form-control:focus { border-color: #15D400; }
.login-card .form-control:focus + i { color: #15D400; }

/* Botón Principal */
.btn-login {
  background: #15D400; color: white; border: none; width: 100%; padding: 14px;
  border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: 0.3s; margin-top: 20px;
}
.btn-login:hover { 
  background: #12b800; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(21, 212, 0, 0.2); 
}

/* Footer links */
.footer-links { margin-top: 25px; font-size: 13px; color: #666; text-align: center; }
.footer-links a { color: #15D400; text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }

/* Animación campos extra (Solo registro) */
#campos-extra {
  display: none;
  border-top: 1px solid #eee;
  margin-top: 20px;
  padding-top: 20px;
  animation: fadeIn 0.5s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Título de sección en registro */
.titulo-seccion {
  margin: 0 0 15px 0; font-size: 16px; color: #15D400; font-weight: 600;
}
.fila-doble { display: flex; gap: 10px; }
.columna-mitad { flex: 1; }

/* =========================================================
   ESTILOS FAVORITOS (Estrella)
   ========================================================= */
   .btn-favorito {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #ccc; /* Gris por defecto */
    transition: transform 0.2s, color 0.2s;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10; /* Por encima de la imagen */
    padding: 0;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)); /* Sombra para que se vea sobre fotos claras */
}

.btn-favorito:hover {
    transform: scale(1.2);
}

.btn-favorito.es-favorito {
    color: #FFD700; /* Amarillo Oro */
}

/* Ajuste para que la estrella no se solape con el badge de categoría si están muy cerca */
.card-cat-badge {
    z-index: 5;
}

.leaflet-popup-close-button {
  display: none !important;
}

/* =========================================================
   IGUALAR ESTILOS CABECERA (FRONT VS BACK)
   ========================================================= */

/* 1. El nombre del usuario en negro (igual que en admin) */
.usuario-nombre-custom {
  color: #000000 !important; /* Mismo gris oscuro/negro que el back */
  font-weight: 600;
  font-size: 16px;
  margin-right: 15px;
  font-family: 'Poppins', sans-serif; /* Asegurar misma fuente */
}

/* 2. El botón rojo idéntico al del Back */
.btn-logout-custom {
  background-color: #E53935 !important; /* Rojo específico del back */
  color: #ffffff !important;
  padding: 10px 18px !important;       /* Mismo padding */
  border-radius: 12px !important;      /* Mismo borde redondeado */
  font-weight: 600 !important;
  text-decoration: none !important;
  border: none !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.22s ease;
  font-size: 14px; /* Ajuste visual para igualar tamaños */
  font-family: 'Poppins', sans-serif;
}

.btn-logout-custom:hover {
  background-color: #c62828 !important;
  transform: translateY(-2px);
  color: white !important;
}

/* Ajuste de iconos para que pesen lo mismo visualmente */
.btn-logout-custom i {
  font-size: 16px;
}

/* =========================================================
   RESPONSIVE MÓVIL (BOTONES FLOTANTES + PANELES)
   ========================================================= */

/* 1. Ocultar botones en PC */
#controles-movil {
  display: none;
}

/* 2. Media Query para Móviles */
@media (max-width: 768px) {

  /* --- POSICIONAMIENTO DE LOS BOTONES (BOTTOM-RIGHT) --- */
  #controles-movil {
      display: flex !important; /* Forzamos visualización */
      flex-direction: column;   /* Apilados verticalmente */
      gap: 15px;                /* Espacio entre botones */
      
      position: fixed; 
      bottom: 30px;      /* Separación del fondo */
      right: 20px;       /* Separación de la derecha */
      
      z-index: 2001;     /* Por encima del mapa */
  }

  /* Estilo visual de los botones (Redondos tipo FAB) */
  .btn-movil-floating {
      background: #fff;
      color: #15D400;
      border: 2px solid #15D400;
      border-radius: 50%; /* Completamente redondos */
      width: 50px;        /* Más grandes para el dedo */
      height: 50px;
      font-size: 22px;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0,0,0,0.2); /* Sombra para que floten */
      transition: transform 0.2s, background 0.2s;
  }
  
  .btn-movil-floating:active {
      transform: scale(0.90);
      background: #f0f0f0;
  }

  /* --- COMPORTAMIENTO DE PANELES (CALENDARIO/LEYENDA) --- */
  #contenedor-calendarios,
  #leyenda {
      display: none; /* Ocultos por defecto en móvil */
      
      /* Centrados en pantalla */
      position: fixed;
      left: 50%;
      transform: translateX(-50%);
      width: 90%;
      max-width: 350px;
      z-index: 2005; /* Encima de todo */
      
      /* Estilos caja */
      background: #fff;
      box-shadow: 0 10px 40px rgba(0,0,0,0.4);
      border: 1px solid #ddd;
  }

  /* Ajustes específicos Calendario */
  #contenedor-calendarios {
      top: 80px; /* Debajo de cabecera */
      right: auto;
      height: auto;
      max-height: 60vh; /* Que no ocupe toda la pantalla */
  }

  /* Ajustes específicos Leyenda */
  #leyenda {
      bottom: 100px; /* Encima de los botones flotantes */
      left: 50%;
      right: auto;
  }

  /* Clase para mostrarlos (JS toggle) */
  #contenedor-calendarios.activo-movil,
  #leyenda.activo-movil {
      display: block !important;
      animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  @keyframes popIn {
      from { opacity: 0; transform: translate(-50%, 20px) scale(0.9); }
      to { opacity: 1; transform: translate(-50%, 0) scale(1); }
  }
}