/* elementos_adicionales.css - Estilos exclusivos de cabecera, menú y footer */

/* CABECERA */
/* ===== CABECERA ===== */
.cabecera {
  background: linear-gradient(135deg, #0a3d4f 0%, #1a7a94 45%, #3db8cc 100%);
  padding: 0;
  position: relative;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  z-index: 10;
}

/* Banda decorativa inferior estática */
.cabecera::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ffd93d, #ff6b6b, #4ecdc4, #45b7d1);
}

/* Fondo con patrón de olas sutil */
.cabecera::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 50%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.cabecera-contenido {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 40px;
  position: relative;
  z-index: 1;
}

/* ===== LOGO ===== */
.cabecera-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 70px;
  width: 70px;
  object-fit: contain;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.25));
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
}

/* ===== TÍTULO CENTRAL MEJORADO ===== */
.cabecera-texto {
  flex: 1;
  text-align: center;
  padding: 0 30px;
}

.cabecera-texto h1 {
  font-size: 40px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 4px;
  text-transform: uppercase;

  /* Gradiente estático en el texto */
  background: linear-gradient(
    135deg,
    #fff7e6 0%,
    #ffd93d 30%,
    #ff6b6b 60%,
    #4ecdc4 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  filter: drop-shadow(0 2px 15px rgba(255, 215, 0, 0.15));
}

.cabecera-texto p {
  font-size: 18px;
  font-weight: 300;
  margin: 8px 0 0 0;
  letter-spacing: 3px;
  color: #e8f4f8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  position: relative;
  display: inline-block;
  padding: 0 25px;
}

/* Líneas decorativas alrededor del subtítulo */
.cabecera-texto p::before,
.cabecera-texto p::after {
  content: "——";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.15);
  font-weight: 100;
  letter-spacing: 2px;
}

.cabecera-texto p::before {
  left: -50px;
}

.cabecera-texto p::after {
  right: -50px;
}

/* ===== PANEL DE USUARIO ===== */
.cabecera-usuario {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 6px 18px 6px 14px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.cabecera-usuario:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.usuario-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usuario-nombre {
  font-size: 15px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

.usuario-acciones {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== BOTONES ===== */
.btn-logout-header,
.btn-delete-account {
  padding: 6px 16px;
  border: none;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  letter-spacing: 0.5px;
}

.btn-logout-header {
  background: rgba(220, 53, 69, 0.85);
}

.btn-logout-header:hover {
  background: #dc3545;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.35);
}

.btn-delete-account {
  background: rgba(220, 53, 69, 0.35);
}

.btn-delete-account:hover {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(200, 35, 51, 0.3);
}

/* MENÚ */
.menu {
  background-color: #2c3e50;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 10px 20px;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  z-index: 9;
}

.menu button {
  background-color: #34495e;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.menu button:hover {
  background-color: #527496;
}

/* FOOTER */
/* ===== FOOTER MEJORADO ===== */
.footer {
  background: linear-gradient(135deg, #0a2d3a 0%, #1a4a5a 50%, #0d3d4f 100%);
  color: #b8d4dc;
  padding: 30px 40px 25px;
  text-align: center;
  border-top: 4px solid #3db8cc;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.2);
  margin-top: 0;
  flex-shrink: 0;
  z-index: 9;
}

.footer p {
  margin: 8px 0;
  font-size: 14px;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.footer p:first-child {
  font-weight: 500;
  color: #e0f0f5;
  font-size: 15px;
}

.footer p:last-child {
  font-size: 13px;
  opacity: 0.8;
  font-style: italic;
  color: #8ab4c4;
}

.footer a {
  color: #4ecdc4;
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
  position: relative;
  padding: 0 4px;
}

.footer a:hover {
  color: #7fd8e6;
  text-decoration: underline;
}

/* Línea decorativa superior del footer */
.footer::before {
  content: "";
  display: block;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, #4ecdc4, #ffd93d);
  margin: -32px auto 20px;
  border-radius: 2px;
}

/* Separador entre enlaces */
.footer .separador {
  color: rgba(255, 255, 255, 0.15);
  margin: 0 6px;
}
/* ============================================ */
/* RESPONSIVE - Cabecera, menú y footer */
/* ============================================ */

@media (max-width: 1024px) {
  .cabecera-contenido {
    padding: 12px 20px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .cabecera-texto h1 {
    font-size: 28px;
    letter-spacing: 2px;
  }

  .cabecera-texto p {
    font-size: 14px;
    letter-spacing: 1px;
  }

  .cabecera-texto p::before,
  .cabecera-texto p::after {
    display: none;
  }

  .logo-img {
    height: 50px;
    width: 50px;
  }

  .menu {
    padding: 8px 12px;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .menu button {
    font-size: 12px;
    padding: 6px 12px;
  }

  .footer {
    padding: 20px 20px 16px;
  }

  .footer p {
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .cabecera-contenido {
    padding: 10px 16px;
    flex-direction: column;
    text-align: center;
  }

  .cabecera-logo {
    order: 1;
  }

  .cabecera-texto {
    order: 2;
    padding: 0 10px;
  }

  .cabecera-texto h1 {
    font-size: 24px;
  }

  .cabecera-texto p {
    font-size: 13px;
    padding: 0 10px;
  }

  .cabecera-usuario {
    order: 3;
    padding: 4px 12px 4px 10px;
    gap: 8px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .usuario-nombre {
    font-size: 13px;
  }

  .btn-logout-header,
  .btn-delete-account {
    font-size: 11px;
    padding: 4px 12px;
  }

  .logo-img {
    height: 40px;
    width: 40px;
  }

  .menu {
    padding: 6px 10px;
    gap: 4px;
  }

  .menu button {
    font-size: 11px;
    padding: 5px 10px;
    flex: 1 1 auto;
    min-width: 60px;
  }

  .footer {
    padding: 16px 16px 12px;
  }

  .footer p {
    font-size: 11px;
  }

  .footer a {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .cabecera-contenido {
    padding: 8px 12px;
  }

  .cabecera-texto h1 {
    font-size: 20px;
    letter-spacing: 1px;
  }

  .cabecera-texto p {
    font-size: 11px;
    padding: 0 5px;
  }

  .logo-img {
    height: 35px;
    width: 35px;
  }

  .cabecera-usuario {
    padding: 4px 8px;
    gap: 4px;
    border-radius: 30px;
  }

  .usuario-nombre {
    font-size: 11px;
  }

  .btn-logout-header,
  .btn-delete-account {
    font-size: 10px;
    padding: 3px 8px;
  }

  .btn-delete-account {
    font-size: 10px;
    padding: 3px 6px;
  }

  .menu {
    padding: 4px 6px;
    gap: 3px;
  }

  .menu button {
    font-size: 10px;
    padding: 4px 8px;
    min-width: 45px;
  }

  .footer {
    padding: 12px 12px 10px;
  }

  .footer p {
    font-size: 10px;
  }

  .footer a {
    font-size: 10px;
  }

  .footer::before {
    width: 50px;
    margin: -24px auto 12px;
  }
}

/* ============================================ */
/* MENÚ HAMBURGUESA */
/* ============================================ */

/* Ocultar menú hamburguesa en desktop */
.menu-mobile {
  display: none;
}

/* Menú desplegable oculto por defecto */
.menu-desplegable {
  display: none;
  flex-direction: column;
  background-color: #2c3e50;
  padding: 10px 20px;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-desplegable.abierto {
  display: flex;
}

.menu-desplegable button {
  background-color: #34495e;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
  text-align: left;
  width: 100%;
}

.menu-desplegable button:hover {
  background-color: #527496;
}

/* ============================================ */
/* RESPONSIVE - Menú hamburguesa */
/* ============================================ */

@media (max-width: 768px) {
  /* Ocultar menú tradicional */
  .menu {
    display: none;
  }

  /* Mostrar menú hamburguesa */
  .menu-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c3e50;
    padding: 10px 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    z-index: 9;
  }

  .menu-mobile-titulo {
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
  }

  /* Botón hamburguesa */
  .menu-hamburguesa {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    width: 36px;
    height: 36px;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    transition: background-color 0.3s;
  }

  .menu-hamburguesa:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .menu-hamburguesa span {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Animación de hamburguesa a X (para cerrar) */
  .menu-hamburguesa.activo span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }

  .menu-hamburguesa.activo span:nth-child(2) {
    opacity: 0;
  }

  .menu-hamburguesa.activo span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  /* CONTROL DE ALTURAS: MAPA, FILTROS Y FORMULARIO */
  /* ============================================ */

  /* Contenedor principal - Ocupa todo el espacio disponible */
  .contenedor-principal {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 350px); /* Ajusta según cabecera+footer */
    position: relative;
  }

  /* Columnas - cada una ocupa el 100% de ancho */
  .columna-centro,
  .columna-derecha,
  .columna-izquierda {
    width: 100% !important;
    min-height: auto;
    flex: 1 1 auto;
    display: block;
  }

  /* MAPA - Ocupa todo el espacio */
  #map {
    height: 100% !important;
    min-height: 350px !important;
    width: 100% !important;
    flex: 1 1 auto;
  }

  .columna-centro {
    min-height: 350px;
    height: 100%;
    flex: 1 1 auto;
  }

  /* FILTROS - Ocupan todo el ancho */
  .filtros-contenedor {
    display: none; /* Oculto por defecto */
    width: 100% !important;
    max-height: 60vh;
    overflow-y: auto;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 15px !important;
    flex: 0 0 auto;
  }

  .filtros-contenedor.mostrar {
    display: block !important;
    height: auto;
    min-height: 200px;
  }

  /* FORMULARIO - Ocupa todo el ancho */
  .columna-derecha {
    display: none; /* Oculto por defecto */
    width: 100% !important;
    max-height: 80vh;
    overflow-y: auto;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 15px !important;
    flex: 0 0 auto;
  }

  .columna-derecha.mostrar {
    display: block !important;
    height: auto;
    min-height: 300px;
  }

  /* Asegurar que el footer no tenga margen extra */
  .footer {
    margin-top: 0;
    flex-shrink: 0;
    position: relative;
    bottom: 0;
  }
}

@media (max-width: 480px) {
  .menu-mobile {
    padding: 8px 12px;
  }

  .menu-mobile-titulo {
    font-size: 14px;
  }

  .menu-hamburguesa {
    width: 32px;
    height: 32px;
  }

  .menu-hamburguesa span {
    width: 20px;
    height: 2px;
  }

  .menu-hamburguesa.activo span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-hamburguesa.activo span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .menu-desplegable {
    padding: 8px 12px;
    gap: 4px;
  }

  .menu-desplegable button {
    font-size: 12px;
    padding: 8px 12px;
  }

  /* ============================================ */
  /* FIX: Ajustes para móvil pequeño */
  /* ============================================ */

  .contenedor-principal {
    flex: 1 1 auto;
  }

  .columna-centro {
    min-height: 250px;
  }

  #map {
    min-height: 250px;
    height: 100%;
  }

  .filtros-contenedor {
    max-height: 50vh;
  }

  .columna-derecha {
    max-height: 50vh;
  }

  .filtros-contenedor.mostrar,
  .columna-derecha.mostrar {
    max-height: 50vh;
  }
}

/* ============================================ */
/* FIX: Asegurar que los menús desplegables se muestren */
/* ============================================ */

.menu-desplegable {
  display: none;
}

.menu-desplegable.abierto {
  display: flex;
}

/* Asegurar que en móvil los menús sean visibles */
@media (max-width: 768px) {
  .menu-desplegable.abierto {
    display: flex;
    position: relative;
    z-index: 1000;
    background-color: #2c3e50;
    padding: 10px 20px;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
  }
}

/* ============================================ */
/* BOTÓN "INSERTAR UBICACIÓN" - SOLO EN MÓVIL   */
/* ============================================ */

/* Oculto por defecto (desktop / tablet grande) */
.solo-movil {
  display: none;
}

/* Estilo base del botón */
.btn-insertar-ubicacion {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a7a94 0%, #3db8cc 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.1s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 3px 10px rgba(26, 122, 148, 0.25);
}

.btn-insertar-ubicacion:hover {
  background: linear-gradient(135deg, #17596f 0%, #2ea0b3 100%);
  box-shadow: 0 5px 14px rgba(26, 122, 148, 0.35);
}

.btn-insertar-ubicacion:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(26, 122, 148, 0.3);
}

/* Mostrar solo en móvil (mismo breakpoint que control-frontend.js) */
@media (max-width: 768px) {
  .solo-movil {
    display: inline-block;
  }

  .btn-insertar-ubicacion {
    font-size: 0.9rem;
    padding: 9px 12px;
    margin-bottom: 10px;
  }
}

/* Ajuste fino para móviles pequeños */
@media (max-width: 480px) {
  .btn-insertar-ubicacion {
    font-size: 0.85rem;
    padding: 8px 10px;
  }
}

/* ============================================ */
/* BOTÓN "INSERTAR UBICACIÓN"                   */
/* ============================================ */

/* Por defecto NUNCA se muestra (desktop y móvil cerrado) */
.btn-insertar-ubicacion {
  display: none;
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a7a94 0%, #3db8cc 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.1s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 3px 10px rgba(26, 122, 148, 0.25);
}

.btn-insertar-ubicacion:hover {
  background: linear-gradient(135deg, #17596f 0%, #2ea0b3 100%);
  box-shadow: 0 5px 14px rgba(26, 122, 148, 0.35);
}

.btn-insertar-ubicacion:active {
  transform: scale(0.98);
}

/* ============================================ */
/* BOTÓN FLOTANTE "VOLVER AL FORMULARIO"        */
/* Solo visible en móvil sobre el mapa cuando   */
/* hay sesión y el formulario está cerrado      */
/* ============================================ */

/* Asegurar que el contenedor del mapa puede posicionar hijos absolutos */
.columna-centro {
  position: relative;
}

.btn-volver-formulario {
  display: none; /* oculto por defecto */
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500; /* por encima del mapa Leaflet (400) y sus controles */
  padding: 10px 16px;
  border: none;
  border-radius: 25px;
  background: rgba(44, 62, 80, 0.95);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  transition:
    background 0.2s ease,
    transform 0.1s ease,
    box-shadow 0.2s ease;
}

.btn-volver-formulario:hover {
  background: rgba(26, 122, 148, 0.98);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.btn-volver-formulario:active {
  transform: scale(0.97);
}

@media (max-width: 480px) {
  .btn-volver-formulario {
    font-size: 0.8rem;
    padding: 8px 12px;
    top: 10px;
    right: 10px;
  }
}
