/* === Variables Bootstrap Personalizadas === */
:root {
  --bs-primary: #ffffff;
  --bs-secondary: #6c757d;
  --bs-success: #28a745;
  --bs-font-sans-serif: Work Sans, sans-serif;
}

/* === Estilos Globales === */
body {
  background-color: #ebebf0;
}

/* === Hero Sections === */
.hero-section,
.hero-section1 {
  font-family: var(--bs-font-sans-serif);
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

.hero-section {
  background-image: url('/static/img/banner (1).jpg');
  background-position: center;
  height: 400px;
}

.hero-section1 {
  background-image: url('/static/img/banner (8).jpg');
  background-position: 50% 15%;
  height: 225px;
  text-shadow: 1px 1px 4px rgba(60, 60, 60, 0.6);
}
.hero-section2 {
  background-image: url('/static/img/banner (12).png');
  background-position: 60% 50%;
  height: 180px;
  text-shadow: 1px 1px 4px rgba(60, 60, 60, 0.6);

  display: flex;
  justify-content: center;  /* centra horizontal */
  align-items: center;      /* centra vertical */
}


.hero-section1 h1,
.hero-section1 p,
.hero-section1 a {
  color: white !important;
}

.hero-section2 h1,
.hero-section2 p,
.hero-section2 a {
  color: white !important;
}

/* === Botones personalizados === */

.opacity-control {
  display: none;
}

.custom-btn,
.btn-error404 {
  border: none;
  padding: 12px 30px;
  font-size: 1.2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, transform 0.2s;
  text-decoration: none;
}

.custom-btn {
  background-color: #818283;
}

.custom-btn:hover {
  background-color: #1a1919;
  transform: translateY(-2px);
}

.btn-error404 {
  background-color: #ffffff;
  color: #444647;
  font-size: 1.1rem;
}

.btn-error404:hover {
  background-color: #1a1919;
  color: white;
}






/* Botones pequeños dentro de la tabla */
.btn-custom-table {
  background-color: #374151; /* Gris carbón */
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-custom-table:hover {
  background-color: #1f2937;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-custom-table.minus {
  background-color: #4c1d95; /* Morado oscuro */
}

.btn-custom-table.minus:hover {
  background-color: #3b0764;
}

/* === Tarjetas (cards) === */
.card {
  border: none;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.card-link:hover {
  text-decoration: none;
}

.card-link .card,
.card-link .tarjeta-2 {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s;
}

.card-link .card:hover {
  transform: scale(1.02);
}

.tarjeta-1 {
  background-image: url('/static/img/data (4).jpg');
}

.tarjeta-2 {
  background-image: url('/static/img/banner (6).jpg');
  background-position: 50% 85%;
}

.tarjeta-3 {
  background-image: url('/static/img/banner (4).jpg');
}

.tarjeta-4 {
  background-image: url('/static/img/banner (13).jpg');
}

/* === Error Box === */
.error {
  font-family: var(--bs-font-sans-serif);
  text-align: center;
  background-color: #6c757d;
  color: #ffffff;
  padding: 20px;
  border-radius: 5px;
  margin: 100px auto;
  max-width: 700px;
  font-size: 1rem;
  line-height: 2.5;
  border: 1px solid #6c757d;
  transition: background-color 0.3s, color 0.3s;
}

/* === Estilos del Mapa === */
#map-container {
  height: 80vh;
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
}

#map {
  height: 100%;
  z-index: 0;
}

/* === Controles del Mapa === */
.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-controls button {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  background: white;
  border: none;
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-controls .btn-group {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 0.5rem;
  padding: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.map-controls .btn {
  font-family: var(--bs-font-sans-serif);
  font-weight: 400;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 0.6rem;
  transition: all 0.3s ease;
}

.map-controls .btn:hover {
  background-color: #656565;
  color: white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.map-controls .btn.active {
  background-color: hwb(210 28% 71%);
  color: #fff;
}

.map-controls .btn-outline-primary {
  border-color: #656565;
  color: #656565;
}

/* === Navbar === */
.navbar-toggler {
  border-radius: 0;
  border: none;
  background-color: transparent;
  box-shadow: none;
}

.navbar .dropdown-menu {
  background-color: #f8f9fa;
  border: none;
}

.navbar .dropdown-item {
  font-size: 1rem;
  padding: 0.5rem 1.25rem;
  color: #212529;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background-color: #e9ecef;
  color: #000;
}

/* === Leyendas y Scroll === */
.legend-color {
  display: inline-block;
  width: 20px;
  height: 10px;
  margin-right: 5px;
}

.card-body.scrollable {
  max-height: 600px;
  overflow-y: auto;
}

.legend-container {
  max-height: 70vh;
  overflow-y: auto;
  padding: 0 5px;
  box-sizing: border-box;
}

.legend-container img[src=""] {
  display: none;
}

.legend-item:empty {
  display: none;
}

/* === Otros === */

.zoom-info {
  position: absolute;
  top: 0px;       /* misma altura que los botones de zoom */
  left: 40px;      /* espacio para no superponer el botón "+" */
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.8rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  font-weight: 500;
}


.user-location-marker {
  width: 20px;
  height: 20px;
  z-index: 1000;
}

.pulse-marker {
  width: 15px;
  height: 15px;
  background-color: #3388ff;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(51, 136, 255, 0.7);
  animation: pulse 1.5s infinite;
}

.leaflet-control-layers-toggle {
  width: 6px;
  height: 6px;
  background-size: 8px 8px;
}

.TextLogo {
  font-family: var(--bs-font-sans-serif);
  line-height: 1;
  font-weight: 400;
  font-size: 1rem;
}

/* === Responsive (pantallas pequeñas) === */
@media (max-width: 768px) {
  .legend-container {
    max-height: 150px;
  }
}

#periodo-control {
  background: white;
  padding: 3px 6px;
  display: flex;
  gap: 10px;
  position: absolute;
  bottom: 6px;
  left: 1%;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#periodo-control button {
  background: #f8f9fa;
  border: 1px solid #ccc;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}


#periodo-control button:hover {
  background: #e2e6ea;
}












/* === Tarjetas Colapsables === */
  /* 🔹 Tarjetas con FADE (texto con fondo difuminado inferior) */
  .expandable-card {
    position: relative;
    max-height: 200px;
    overflow: hidden;
    cursor: pointer;
    transition: max-height 0.5s ease;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
  }

  /* Fade inferior oscuro */
  .expandable-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    pointer-events: none;
    transition: opacity 0.4 ease;
  }

  .expandable-card.expanded {
    max-height: 85vh;
    overflow-y: auto;
  }

  .expandable-card.expanded::after {
    opacity: 0;
  }

  /* 🔹 Tarjetas con PORTADA (imagen + título superpuesto) */
  .expandable-card-cover {
    position: relative;
    max-height: 200px;
    overflow: hidden;
    cursor: pointer;
    transition: max-height 0.5s ease;
    border-radius: 8px;
    padding: 0;
  }

  /* Contenedor de la imagen de portada */
  .expandable-card-cover .card-cover {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
  }

  .expandable-card-cover .card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
  }

  /* Título superpuesto sobre la portada */
  .expandable-card-cover .cover-title {
    position: absolute;
    top: 55px;
    left: 25px;
    right: 15px;
    z-index: 10;
    pointer-events: none;
  }

  .expandable-card-cover .cover-title h5 {
    color: white;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
    font-size: 1.6rem;
    margin: 0;
  }

  /* Al expandir: ocultar portada y título */
  .expandable-card-cover.expanded .card-cover {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: none;
  }

  /* Contenido que aparece al expandir */
  .expandable-card-cover .card-content {
    padding: 15px;
    background: #fff;
  }


/* 🔹 Segunda tarjeta SIN comportamiento colapsable */
.expandable-card1 {
  position: relative;
  max-height: none !important;   /* ❌ elimina límite de altura */
  overflow: visible !important;  /* ❌ evita que esconda contenido */
  cursor: default;               /* no parece clickeable */
  border-radius: 8px;
  padding: 20px;
  background: #fff;              /* fondo base */
}

/* Opcional: si quieres un fondo con color suave */
.expandable-card1 .card-background {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(240,240,240,0.6); /* gris claro semitransparente */
  border-radius: 8px;
  z-index: -1; /* queda detrás del contenido */
}

/* 🔹 Tabla controlada */
.tabla-wrapper {
  width: 100%;           /* ocupa todo el ancho del contenedor */
  overflow-x: auto;      /* scroll si se desborda */
  margin-bottom: 10px;   /* espacio debajo */
}

.tabla-wrapper table {
  width: 100%;           /* que llene horizontalmente */
  max-width: 700px;      /* pero no más grande que esto */
  margin: 0 auto;        /* centrada */
  border-collapse: collapse;
  font-size: 0.7rem;     /* hacerla más compacta */
}

/* 🔹 Layout de texto + imágenes */
.contenido {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.texto {
  flex: 2;
}

.imagenes {
  flex: 1;
}

.imagenes img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}



/* Por defecto la tabla está oculta */
.tabla-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

/* Cuando se expande */
.tabla-collapse.active {
  max-height: 1000px; /* ajusta según la altura de tu tabla */
}



/* Tarjeta grande cerrada */
.expandable-card-cover.tarjeta-grande {
  max-height: 200px;  /* igual que las demás cerradas */
}

/* Tarjeta grande expandida */
.expandable-card-cover.tarjeta-grande.expanded {
  max-height: 220vh;  /* más grande que las demás al expandir */
}




  .subtitulo {
  font-weight: bold;
  font-size: 1.2em;
  color: #2c3e50; /* azul sobrio */
  display: block; /* para que se vean en línea nueva */
  margin-top: 20px;
}
h5 i {
  margin-left: 5px;
  color: #ffffff; /* color sobrio */
}

h4 i {
  margin-left: 5px;
  color: #000000; /* color sobrio */
}


/* Estilo para el formulario */
.form-custom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.form-custom input,
.form-custom select {
  padding: 10px;
  border: 1px solid #d1d5db; /* gris claro */
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-custom input:focus,
.form-custom select:focus {
  outline: none;
  border-color: #767676; /* morado oscuro como tus botones */
  box-shadow: 0 0 0 2px rgba(76, 29, 149, 0.2);
}

.form-custom label {
  font-weight: 600;
  margin-top: 4px;
  font-size: 0.95rem;
}

.btn-submit {
  background-color: #767676;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-submit:hover {
  background-color: #242424;
  transform: translateY(-2px);
}

.resultado-section {
  display: flex;
  justify-content: center; /* centrado horizontal */
  margin-top: 20px;
}

.resultado-card {
  width: 100%; /* puedes ajustar el tamaño */
  text-align: center;
  margin-top: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  background: #ffffff;
  padding: 15px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resultado-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.resultado-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #374151; /* gris oscuro */
}

.valor-estimado {
  font-size: 1.3rem;
  font-weight: bold;
  color: #4d4d4f; /* morado oscuro de tu paleta */
  margin: 0;
}



/* Estilos generales */
.valuacion-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Columna del formulario */
.form-box {
  flex: 1;            /* toma el espacio que necesita */
  max-width: 400px;   /* no demasiado ancho */
}

/* Columna del mapa */
.map-box {
  flex: 2;            /* más ancho que el formulario */
}

#map {
  width: 100%;
  height: 600px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

h2 {
  margin-bottom: 40px;
}

/* Estilos del formulario */
.form-custom input,
.form-custom select,
.form-custom label,
.btn-submit {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.form-custom label {
  background: none;
  border: none;
  padding: 5px 0;
  margin-bottom: 5px;
  font-weight: bold;
}

.btn-submit {
  background-color: #777777;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.btn-submit:hover {
  background-color: #343434;
}

/* Responsividad */
@media (max-width: 768px) {
  .valuacion-container {
    flex-direction: column;
    align-items: center; /* Centra los elementos hijos */
  }

  .form-box, .map-box {
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px 0;
  }
  
  .form-box {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra el contenido interno */
  }
  
  .form-custom {
    width: 90%; /* Ocupa el 90% del ancho disponible */
    max-width: 400px; /* Pero no más de 400px */
  }

  #map {
    height: 300px;
  }
  
  h2 {
    text-align: center;
    margin-bottom: 20px;
  }
  
  /* Mejora la legibilidad en móviles */
  .form-custom input,
  .form-custom select,
  .btn-submit {
    font-size: 14px; /* Tamaño de fuente ligeramente menor para móviles */
    padding: 10px;
  }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
  .form-custom {
    width: 95%; /* Ocupa casi todo el ancho */
  }
  
  .form-custom input,
  .form-custom select,
  .btn-submit {
    padding: 8px;
  }
}
