/* Reset y tipografía */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f6fa;
  color: #2c3e50;
}

/* ==== HEADER con logo centrado visualmente ==== */
header {
  background: #34495e;
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

header .header-content {
  display: flex;
  align-items: center;
  justify-content: center; /* centrado del bloque completo */
  gap: 1.5rem;
}

header img.logo-header {
  width: 120px;
  height: auto;
  border-radius: 50%;
  flex-shrink: 0;
}

header .header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center; /* centrado del texto */
}

header .header-text h1 {
  margin: 0;
  font-size: 1.8rem;
}

header .header-text p {
  margin: 0;
  font-size: 1rem;
  color: #dfe6e9;
}

header .header-text h4 {
  margin: 0;
  font-size: 1.5rem;
  color: #dfe6e9;
}

/* ==== NAV ==== */
nav.menu-principal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2c3e50;
  padding: 0.7rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Contenedor para agrupar los botones de menú a la derecha */
nav.menu-principal .menu-container {
  display: flex;
  gap: 0.5rem;
  margin-right: 0.5rem;
}

.menu-btn {
  background: linear-gradient(135deg, #1abc9c, #16a085);
  border: none;
  padding: 0.8rem 1.6rem;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.menu-btn:hover {
  background: linear-gradient(135deg, #16a085, #1abc9c);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

main {
  padding: 2rem;
}

/* Secciones */
.modulo-section {
  display: none;
}

.modulo-section.active {
  display: block;
}

/* Contenedor de tarjetas */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.8rem;
  margin-top: 1rem;
}

/* Tarjetas */
.card {
  background: white;
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card h3 {
  margin-top: 0;
  font-size: 1.3rem;
  color: #34495e;
  text-align: center;
}

.card p {
  color: #555;
  flex-grow: 1;
  margin: 0.8rem 0;
}

/* Botones dentro de las tarjetas y formularios */
.card button,
.dynamicForm button {
  background: linear-gradient(135deg, #3498db, #2980b9);
  border: none;
  color: white;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.card button:hover,
.dynamicForm button:hover {
  background: linear-gradient(135deg, #2980b9, #3498db);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Formulario dinámico */
.dynamicForm {
  background: #ffffff;
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.dynamicForm h3 {
  margin-bottom: 1rem;
  color: #34495e;
}

.dynamicForm .form-label {
  font-weight: 500;
}

.dynamicForm .form-control {
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 0.6rem;
}

.dynamicForm .btn-volver {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.dynamicForm .btn-volver:hover {
  background: linear-gradient(135deg, #7f8c8d, #95a5a6);
}

/* Contenedor de botones en formularios */
.form-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.form-buttons button {
  flex-shrink: 0;
}

/* ==== FOOTER - Términos y Condiciones ==== */
footer {
  background-color: #1e1e1e;
  color: #f5f5f5;
  text-align: center;
  padding: 15px 10px;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
}

footer a {
  color: #ffffff;
  font-weight: 500;
  text-decoration: underline;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #00b4d8;
  text-decoration: none;
}

footer p {
  margin: 0;
  padding: 0;
}

/* ==== DISCLAIMER ==== */
.disclaimer-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.disclaimer-content {
  background: #fff;
  color: #000;
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.disclaimer-footer {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==== RESPONSIVO ==== */
@media (max-width: 600px) {
  header {
    padding: 0.8rem 1rem;
    text-align: center;
  }

  header .header-content {
    flex-direction: column;
    align-items: center;
  }

  header img.logo-header {
    width: 90px;
    margin-bottom: 0.5rem;
  }

  header .header-text {
    text-align: center;
  }

  header .header-text h1 {
    font-size: 1.5rem;
  }

  header .header-text p {
    font-size: 0.9rem;
  }

  .menu-principal {
    flex-direction: column;
  }

  .card-container {
    grid-template-columns: 1fr;
  }

  footer {
    font-size: 13px;
    padding: 12px 8px;
  }
}
/* ==== BOTÓN CERRAR SESIÓN ==== */
.logout-container {
  position: absolute;
  top: 15px;
  right: 25px;
}

.logout-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: none;
  padding: 0.6rem 1.2rem;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* 🔍 Estilos del buscador global */
.buscador-global {
  position: relative;
  width: 20%;
  min-width: 220px;
  margin-left: 0.5rem; /* un pequeño respiro desde el borde izquierdo */
}

/* Input con espacio para el icono */
.buscador-global input.input-busqueda {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem; /* ← deja espacio para el icono */
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.input-busqueda:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 6px rgba(0,123,255,0.4);
}

/* Lupa mediante pseudo-elemento */
.buscador-global::before {
  content: "🔍";
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.6;
  pointer-events: none; /* evita interferir con clics */
}

/* Efecto al enfocar */
.buscador-global input.input-busqueda:focus {
  border-color: #007bff;
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.4);
}

/* Resultados desplegables */
.resultados-filtro {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  max-height: 250px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 1000;
  display: none;
}

.resultados-filtro li {
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.resultados-filtro li:hover {
  background: #f5f5f5;
}

/* Mensaje sin resultados */
.resultado-vacio {
  padding: 0.6rem 1rem;
  color: #888;
  text-align: center;
  font-style: italic;
}

.resaltado {
  animation: parpadeo 1s ease-in-out 2;
}

@keyframes parpadeo {
  0%, 100% { background-color: inherit; }
  50% { background-color: #ffff99; }
}


.info-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  color: #17a2b8;
  margin-right: 8px;
}

.info-tooltip i {
  font-size: 18px;
}

.tooltip-text {
  visibility: hidden;
  width: 300px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 12px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  margin-left: -150px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.info-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}