:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --header-height: 70px;
}

html {
  overflow-x: hidden;
}

body {
  background-color: #FFFFFF;
  color: #333;
  font-family: var(--font-family);
  margin: 0;
}

#search-header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-sizing: border-box;
  height: var(--header-height);
  position: sticky;
  top: 0;
}

.header-logo {
  display: block;
  flex-shrink: 0;
}

.header-logo img {
  height: 40px;
  display: block;
}

#search-form {
  display: flex;
  gap: 1rem;
  width: 100%;
  align-items: center;
  flex-grow: 1;
}

#search-form input[type="search"] {
  flex-grow: 1;
  padding: 0.8rem;
  border: 1px solid #DEE2E6;
  border-radius: 4px;
  font-size: 1rem;
  min-width: 100px;
  background-color: #FFFFFF;
  color: #343A40;
}

#search-form select {
  padding: 0.8rem;
  border: 1px solid #DEE2E6;
  border-radius: 4px;
  font-size: 1rem;
  background-color: #FFFFFF;
  color: #6C757D;
}

.desktop-only {
  display: inline;
}

.mobile-only {
  display: none;
}

#drop-zone {
  min-height: calc(100dvh - var(--header-height) - 30px);
  max-height: calc(100dvh - var(--header-height) - 30px);
  /* Corregido */
  box-sizing: border-box;
  margin: 15px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  text-align: center;
  border: 2px dashed #A0C4FF;
  position: relative;
  cursor: pointer;
  overflow-y: auto;
}

#job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 30px;
  width: 100%;
  box-sizing: border-box;
  cursor: default;
  align-content: start;
}

#upload-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ccc;
  padding: 0 1rem;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  width: 100%;
}

#drop-zone.drag-over {
  border-color: #007bff;
  background-color: #f0f8ff;
}



.job-card {
  position: relative;
  border: 1px solid #eee;
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  /* background-color: #F8F9FA; */
  background-color: #fdfdec;
  line-height: 1.2;
}

.job-card p {
  margin-top: 0;
  margin-bottom: 0rem;
  /* Reduce el espacio debajo de cada párrafo */
  line-height: 0;
  color: #6C757D;
}

.job-card h2 {
  margin-top: 0;
  margin-bottom: 0rem;
  /* Reduce el espacio debajo de cada párrafo */
  line-height: 0;
}

.job-card h3 {
  margin-top: 0;
  margin-bottom: 0rem;
  /* Ajusta este valor si quieres más o menos espacio */
}

.job-card h3+p {
  margin-bottom: 0;
}

.job-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.job-card-footer {
  font-size: 0.8rem;
  color: #6C757D;
  margin-top: 0rem;
  /* Ajusta el espacio */
}

.job-date-ref {
  font-weight: 100;
  text-align: right;
  margin-top: 0.0rem;
  color: #495057;
}

.job-ref {
  font-size: 0.8rem;
  font-weight: 100;
  opacity: 0.8;
  color: #495057;
}


/* Para el "Puesto de empleo" */
.job-card .job-card-title {
  font-size: 1.2rem !important;
  font-weight: 300 !important;
  color: #212529 !important;
  margin-bottom: 0.5rem !important;
  /* Un PEQUEÑO espacio debajo del título */
  line-height: 1.2 !important;
  /* Altura de línea normal para el título */
}

/* Para el PÁRRAFO que CONTIENE el nombre de empresa */
.job-card .job-card-company {
  font-size: 1rem !important;
  /* Tamaño de fuente para todo el párrafo */
  color: #495057 !important;
  /* Color para todo el párrafo */
  margin-top: 0 !important;
  /* Sin espacio extra arriba */
  margin-bottom: 0rem !important;
  /* <-- CLAVE: Espacio DEBAJO de la empresa */
  line-height: 1.2 !important;
  /* Altura de línea normal */
}

/* Para el texto en negrita "Nombre de empresa" (el strong dentro) */
.job-card .job-card-company strong {
  font-weight: 100 !important;
  /* Un poco más de peso que 100 */
  /* No necesitamos font-size o color aquí si lo hereda del párrafo */
}

/* Para el párrafo "Localidad, región" */
.job-card .job-card-location {
  font-size: 01rem !important;
  /* Ligeramente más pequeño */
  font-weight: 100 !important;
  /* Más fino */
  color: #6C757D !important;
  /* Un gris diferente */
  margin-top: 0 !important;
  /* Sin espacio extra ARRIBA */
  margin-bottom: 0rem !important;
  /* Espacio debajo antes de la fecha/ref */
  line-height: 1.2 !important;
  /* Altura de línea normal */
}





#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 2000;
}

#close-lightbox {
  position: absolute;
  top: 50px;
  right: 50px;

  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 100px;
  height: 100px;

  /* --- CENTRADO PERFECTO CON FLEXBOX --- */
  line-height: 0;
  /* anula line-height global */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Centra horizontalmente */

  color: white;
  font-size: 5rem;
  font-weight: 300;

  cursor: pointer;
  z-index: 2002;
  transition: background-color 0.2s;

  transform: translateY(5px);

  line-height: 0;
  /* anula line-height global */
  display: flex;
  align-items: center;
}

#close-lightbox::before {
  content: "x";
  font-size: 5rem;
  font-weight: 300;
  line-height: 1.7;
  /* ajusta hasta que quede centrado visualmente */
  transform: translateY(-5%);
}

#close-lightbox:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* El NUEVO contenedor para las dos columnas */
.lightbox-content {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2001;
}

/* El panel de detalles de la izquierda */
#lightbox-details {
  width: 35%;
  max-width: 450px;
  background-color: #fff;
  padding: 2rem;
  overflow-y: auto;
  color: #333;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* El contenedor del PDF de la derecha */
#pdf-wrapper {
  flex-grow: 1;
  height: 100%;
}

#lightbox-pdf {
  width: 100%;
  height: 100%;
  border: none;
}

#lightbox-details h2,
#lightbox-details h3,
#lightbox-details h4 {
  margin: 0 0 0.5rem 0;
}

#lightbox-details h4 {
  margin-top: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

#lightbox-details p {
  white-space: pre-wrap;
  line-height: 1.6;
  word-wrap: break-word;
}

#detail-tags {
  margin: 1rem 0;
}

.tag {
  background-color: #eee;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  display: inline-block;
}

.tag:empty {
  display: none;
}

.hidden {
  display: none !important;
}

#loading-spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 2s linear infinite;
  position: absolute;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #ffffff;
  color: #212529;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  transform: scale(1);
  z-index: 10;
}

.job-card:hover .delete-btn {
  opacity: 0.7;
  transform: scale(1);
}

.delete-btn:hover {
  color: white;
  background: #d32f2f;
}

/* Ajuste fino opcional si la “×” se ve un poco baja */
.delete-btn span {
  display: inline-block;
  transform: translateY(-1px);
}



/* --- CÓDIGO NUEVO PARA BOTONES FLOTANTES DE SUBIDA (GRIS Y SEMI-TRANSPARENTE) --- */

#paste-from-clipboard-btn,
#voice-post-btn,
#upload-file-btn,
#scroll-to-top-btn {
  display: flex;
  position: fixed;
  /* bottom: 20px; */
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  /* Color Gris */
  opacity: 0.8;
  color: #212529;
  /* Mantenemos el icono SVG en blanco */
  transition: opacity 0.2s ease-in-out;
}

#scroll-to-top-btn {
  right: 20px;
  bottom: 20px;
}

#paste-from-clipboard-btn {
  right: 20px;
  bottom: 218px;
  /* Subimos para dejar espacio al botón de voz */
}

#voice-post-btn {
  right: 20px;
  bottom: 152px;
  /* Posición que antes tenía el de pegar */
}

/* Botón "Upload", ahora está abajo */
#upload-file-btn {
  right: 20px;
  bottom: 86px;
}

#voice-post-btn.listening {
  color: #fff;
  background-color: #f44336;
  /* Rojo mientras escucha */
  opacity: 1;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
  }
}

/* Opcional pero recomendado: que los botones se vuelvan opacos al tocarlos o pasar el ratón */
#paste-from-clipboard-btn:hover,
#voice-post-btn:hover,
#upload-file-btn:hover,
#scroll-to-top-btn:hover {
  opacity: 1;
}

/* --- NUEVOS ESTILOS PARA EL BOTÓN DE VER PDF --- */
#view-pdf-btn {
  display: none;
  background-color: #007bff;
  color: white;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  border-radius: 5px;
  margin-bottom: 1.5rem;
}

.mobile-only-flex {
  display: none;
}









/* --- ESTILOS PARA EL SELECTOR DE IDIOMA Y PAÍS --- */
#language-selector,
#country-selector {
  position: fixed;
  /* Fijo en la pantalla */
  /* top: 20%; Centrado verticalmente */
  left: 0;
  transform: translateY(-20%);
  z-index: 1002;
  /* Para que esté por encima de otros elementos */
}

#language-selector {
  top: 20%;
  /* Movemos el de idioma un poco más abajo */
}

#country-selector {
  top: 30%;
  /* Posicionamos el de país un poco más arriba */
}

#language-tab,
#country-tab {
  background-color: #ffffff;
  color: grey;
  border: none;
  padding: 12px 8px;
  cursor: pointer;
  writing-mode: vertical-rl;
  /* Texto vertical si quieres poner letras */
  border-radius: 0 4px 4px 0;
  font-size: 1.0rem;
  line-height: 1;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

/* Esta regla rota ÚNICAMENTE el texto */
#language-tab span,
#country-tab span {
  display: inline-block;
  /* Necesario para que la transformación se aplique correctamente */
  transform: rotate(180deg);
}

#language-menu,
#country-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 100%;
  top: 0;
  background-color: white;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  max-height: 40vh;
  /* Limita la altura al 40% de la pantalla */
  overflow-y: auto;
  /* Añade scroll vertical solo si es necesario */
}

#language-menu li,
#country-menu li {
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  white-space: nowrap;
  /* Evita que el texto se parta en dos líneas */
}

#language-menu li:hover,
#country-menu li:hover {
  background-color: #f0f0f0;
}

/* Usaremos esta clase para ocultar el menú con JS */
#language-menu.hidden,
#country-menu.hidden {
  display: none;
}

/* --- FIN ESTILOS PARA EL SELECTOR DE IDIOMA --- */









/* --- CSS Básico para el Modal --- */
/* El fondo oscuro superpuesto */
.modal-overlay {
  position: fixed;
  /* z-index: 1000; */
  /* Lo subimos como hicimos antes */
  z-index: 3001;
  /* Asegúrate que sea un valor alto */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  /* Ajusta la opacidad si quieres */
  display: flex;
  /* Importante para centrar */
  align-items: center;
  justify-content: center;
  /* Añadimos padding por si acaso */
  padding: 20px;
  box-sizing: border-box;
}

/* El contenedor principal blanco del modal */
.modal-content {
  background-color: #fff;
  /* Fondo blanco */
  border-radius: 8px;
  /* Bordes redondeados */
  width: 90%;
  /* Ancho */
  max-width: 700px;
  /* Ancho máximo */
  max-height: 90vh;
  /* Altura máxima */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  /* Sombra */
  display: flex;
  /* Estructura interna */
  flex-direction: column;
  /* Asegúrate de que tenga un z-index relativo si es necesario */
  position: relative;
  z-index: 3002;
  /* Para estar seguro sobre el overlay */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
  /* Añadimos color por si acaso */
}

.modal-close-button {
  font-size: 2rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  line-height: 1;
}

.modal-close-button:hover {
  color: #000;
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  /* Permite scroll si el contenido es muy largo */
  color: #333;
  /* Aseguramos color del texto */
}

/* --- Zona de Soltar (Drop Zone) --- */
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  background-color: #f9f9f9;
  transition: background-color 0.2s, border-color 0.2s;
  color: #555;
  /* Color del texto dentro */
}

.drop-zone.drag-over {
  background-color: #e0f0ff;
  border-color: #007bff;
}

.drop-zone p {
  margin: 0 0 10px 0;
}

/* Estilo básico para el botón dentro del drop-zone */
.btn-primary {
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background-color: #0056b3;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#gen-social-img-btn {
  background: linear-gradient(135deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
  font-weight: 600;
  border: none;
  color: white;
}

#gen-social-img-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}


/* --- Pestañas de Resultados --- */
.analysis-percentage {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.analysis-percentage h4 {
  margin: 0;
  color: #333;
}

.analysis-percentage span#result-percentage {
  font-weight: bold;
  color: #007bff;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid #ccc;
  margin-bottom: 15px;
}

.tab-link {
  padding: 10px 15px;
  cursor: pointer;
  border: none;
  background-color: transparent;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  /* Solapamiento con el borde inferior */
  font-size: 1rem;
  color: #555;
  /* Color para pestañas inactivas */
}

.tab-link.active {
  border-bottom-color: #007bff;
  font-weight: 600;
  color: #007bff;
  /* Color para pestaña activa */
}

.tab-content {
  display: none;
  /* Oculto por defecto */
  color: #333;
  /* Asegura color del texto */
}

.tab-content.active {
  display: block;
  /* Visible */
}

.tab-content h4 {
  /* Estilo para títulos "Fortalezas"/"Debilidades" */
  margin-top: 10px;
  margin-bottom: 8px;
  color: #333;
}

.tab-content textarea {
  width: 100%;
  box-sizing: border-box;
  /* Asegura que el padding no desborde */
  padding: 10px;
  font-family: monospace;
  font-size: 0.9rem;
  background-color: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 10px;
  /* Espacio arriba */
  color: #333;
  /* Color del texto */
}

.tab-content ul {
  padding-left: 20px;
  margin-top: 0;
  margin-bottom: 15px;
  color: #555;
  /* Color del texto de las listas */
}

.tab-content li {
  margin-bottom: 5px;
  /* Espacio entre items de lista */
}

/* --- Spinner (Simple CSS) --- */
.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}









/* --- Estilo para el botón de analizar CV como icono --- */
.btn-analizar-cv.icon-button {
  position: absolute;
  /* Posicionamiento absoluto dentro de la tarjeta */
  top: 50%;
  /* Espacio desde arriba */
  right: 5px;
  /* Espacio desde la derecha */
  background-color: rgba(250, 250, 250, 0.5);
  /* Fondo semi-transparente */
  color: #212529;
  /* Color del icono */
  border: none;
  border-radius: 50%;
  /* Círculo */
  width: 30px;
  /* Tamaño */
  height: 30px;
  padding: 0;
  /* Sin padding interno */
  display: flex;
  /* Centrar icono */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
  z-index: 5;
  /* Por si acaso */
  opacity: 0.1;
  /* Oculto por defecto */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

/* Mostrar al pasar el ratón por la tarjeta */
.job-card:hover .btn-analizar-cv.icon-button {
  opacity: 0.8;
}

.btn-analizar-cv.icon-button:hover {
  background-color: rgba(250, 250, 250, 0.9);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
  /* Efecto ligero al pasar por encima */
}

/* Asegúrate de que el icono SVG herede el color */
.btn-analizar-cv.icon-button svg {
  stroke: currentColor;
  color: grey;
}

.job-date-ref {
  font-weight: 100;
  text-align: right;
  margin-top: 0.0rem;
  color: #495057;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.job-ref {
  font-size: 0.8rem;
  font-weight: 100;
}

/* --- Botón Circular para Social Ad (Relocalizado antes de la fecha) --- */
.btn-gen-social-img.icon-button {
  background: transparent;
  /* Fondo transparente para que se vea el icono 'enviar' */
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.2s;
}

.btn-gen-social-img.icon-button img {
  width: 0.8rem;
  /* Igualado con el font-size de la fecha */
  height: 0.8rem;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.job-card:hover .btn-gen-social-img.icon-button img {
  opacity: 1;
  /* Al pasar el ratón se ve al 100% */
}

.btn-gen-social-img.icon-button:active {
  transform: scale(0.9);
}

/* En móvil, lo hacemos visible siempre */
@media (max-width: 800px) {
  .btn-gen-social-img.icon-button {
    opacity: 1;
  }
}

/* En móvil, hazlo siempre visible si lo prefieres */
@media (hover: none) and (pointer: coarse) {
  .btn-analizar-cv.icon-button {
    opacity: 0.5;
    /* Ligeramente visible */
  }
}






/* --- Estilos para los botones de acción del Textarea --- */
.textarea-actions {
  text-align: right;
  /* Alinea los botones a la derecha */
  margin-bottom: 5px;
  /* Pequeño espacio sobre el textarea */
  /* position: relative; */
  /* Puedes hacerlo relativo si quieres posicionar absoluto */
}

.textarea-actions button {
  background: #f0f0f0;
  /* Fondo gris claro */
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 6px;
  /* Padding pequeño */
  margin-left: 5px;
  /* Espacio entre botones */
  cursor: pointer;
  line-height: 1;
  /* Asegura que el SVG no añada altura extra */
  transition: background-color 0.2s, box-shadow 0.2s;
}

.textarea-actions button:hover {
  background: #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.textarea-actions button svg {
  vertical-align: middle;
  /* Alinea el icono verticalmente */
  stroke: #555;
  /* Color del icono */
  width: 16px;
  /* Tamaño explícito */
  height: 16px;
}

/* Estilo opcional para feedback visual al copiar */
.copy-feedback {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(40, 167, 69, 0.8);
  /* Verde semi-transparente */
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.8em;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.copy-feedback.show {
  opacity: 1;
}

.tab-content {
  /* Necesitamos posición relativa aquí para el feedback */
  position: relative;
}








/* --- ESTILOS SOLO PARA VISTA DE ORDENADOR --- */
@media (min-width: 801px) {
  .job-card {
    position: relative;
    padding-bottom: 3rem;
  }

  /* Aplicamos el posicionamiento solo al contenedor de fecha/ref */
  .job-date-ref {
    position: absolute;
    bottom: 1rem;
    right: 1rem;

    /* Le damos un text-align para que su contenido se alinee a la derecha */
    text-align: right;
  }
}


@media (max-width: 800px) {

  html,
  body {
    width: 100%;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
  }

  #drop-zone {
    overscroll-behavior-y: contain;
    /* Añade esto también para el contenedor */
    border: none;
    /* Oculta el marco discontinuo */
  }

  #job-grid {
    padding: 15px;
  }

  #loading-spinner {
    transform: translateY(-80px);
  }

  /* --- CORRECCIÓN FINAL PARA LIGHTBOX MÓVIL --- */
  #lightbox {
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #close-lightbox {
    position: fixed;
  }

  #lightbox-details {
    width: 100%;
    max-width: none;
  }

  .mobile-only-flex {
    display: block;
  }

  /* Ocultamos el contenedor del iframe en móvil */
  #pdf-wrapper {
    display: none;
  }

  #job-counter {
    position: fixed;
    top: 50vh;
    left: 0;
    z-index: 1002;
    background-color: transparent;
    opacity: 1;
    padding: 0;
    border: 0px solid #f0f0f0;
    border-left: none;
    border-radius: 0 4px 4px 0;
    display: block;
    margin-left: 0;
    font-size: 0.8rem;
    writing-mode: vertical-rl;
    font-size: 0.8rem;
    margin-left: 0;
    display: block;
  }

  #job-counter span {
    display: inline-block;
    transform: rotate(180deg);
    color: #6C757D;
    font-weight: 100;
    font-size: 0.8rem;
    padding: 12px 8px;
  }

}

@media (max-width: 600px) {
  #search-header {
    height: auto;
    padding: 0.5rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .header-logo img {
    height: 30px;
  }

  #search-form {
    flex-direction: row;
    gap: 0.8rem;
    width: 100%;
  }

  #search-form input[type="search"],
  #search-form select {
    flex: 1;
    min-width: 0;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: inline;
  }

  #job-grid {
    padding-top: 20px;
  }
}

@media (max-width: 480px) {

  #search-form input[type="search"],
  #search-form select {
    font-size: 1rem;
  }

  #job-grid {
    gap: 20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .job-card {
    padding: 0.5rem;
  }
}


.job-counter-style {
  font-size: 1rem;
  font-weight: 300;
  /* Fuente fina para un look minimalista */
  color: #CACACA;
  /* Un gris suave */
  white-space: nowrap;
  /* Evita que se parta en dos líneas en pantallas pequeñas */
  margin-left: 1.5rem;
  /* Le da un poco de espacio respecto al formulario */
}



@media (hover: none) and (pointer: coarse) {
  .delete-btn {
    opacity: 1;
    transform: scale(1);
  }
}


/* --- ESTILOS PARA EL NUEVO BOTÓN Y MODAL DE AYUDA (FAQ) --- */

/* 1. Botón flotante de ayuda "i" */
#help-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background-color: #ffffff;
  opacity: 0.8;
  color: #212529;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-size: 1.8rem;
  font-weight: 400;
  font-style: italic;
  cursor: pointer;
  z-index: 1001;
  transition: transform 0.2s ease-in-out;
}

#help-btn:hover {
  transform: scale(1.1);
}

/* 2. Contenedor de la ventana modal de ayuda */
#help-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 3000;
  /* Por encima de la lightbox */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

/* 3. El cuadro blanco con el contenido del FAQ */
.help-content {
  position: relative;
  background-color: #fff;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  /* Mantenemos la altura máxima */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

  /* ¡CRÍTICO! Quitamos el overflow y el padding de aquí */
  overflow: hidden;
  /* Oculta cualquier desbordamiento */
  padding: 0;

  /* Usamos flexbox para que el contenido interior ocupe todo el espacio */
  display: flex;
  flex-direction: column;
}

.help-content h2 {
  margin-top: 0;
  color: #212529;
}

/* 4. El botón de cerrar "X" del modal de ayuda (NUEVO ESTILO) */
#close-help-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  width: 40px;
  height: 40px;
  background-color: rgba(128, 128, 128, 0.5);
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  color: white;
  font-size: 1.6rem;
  font-weight: 300;
  cursor: pointer;
  transition: background-color 0.2s;
}

#close-help-modal:hover {
  background-color: rgba(80, 80, 80, 0.7);
}

.help-scroll-wrapper {
  overflow-y: auto;
  padding: 69px 1.5rem 2rem;
}

/* 5. Estilos para el acordeón FAQ */
.faq-accordion details {
  border-bottom: 1px solid #eee;
  padding: 1rem 0;
}

.faq-accordion details:last-of-type {
  border-bottom: none;
}

.faq-accordion summary {
  font-weight: 500;
  color: #343A40;
  cursor: pointer;
  list-style: none;
  /* Quita el marcador por defecto */
  position: relative;
  padding-right: 2rem;
  /* Dejamos espacio para el icono */
}

/* --- INICIO DE LA MODIFICACIÓN: CREACIÓN DEL CHEVRON --- */

/* Creamos el icono "v" usando un borde */
.faq-accordion summary::after {
  content: '';
  /* El contenido está vacío porque lo dibujamos con bordes */
  position: absolute;
  right: 0.5rem;
  /* Posición a la derecha */
  top: 50%;
  /* Lo centramos verticalmente */

  /* Dibujamos una caja pequeña y la rotamos 45 grados */
  width: 8px;
  height: 8px;
  border-bottom: 2px solid #6C757D;
  /* Borde inferior gris */
  border-right: 2px solid #6C757D;
  /* Borde derecho gris */

  /* La rotación crea el efecto "v" */
  transform: translateY(-75%) rotate(45deg);

  /* Añadimos una transición suave para la animación */
  transition: transform 0.2s ease-in-out;
}

/* Cuando el <details> está abierto, rotamos el icono hacia arriba */
.faq-accordion details[open] summary::after {
  transform: translateY(-50%) rotate(-135deg);
}

.faq-accordion p {
  margin-top: 1rem;
  line-height: 1.6;
  color: #495057;
}

/* 6. Ajustes para Responsive */
@media (max-width: 800px) {
  .help-content {
    padding: 1.5rem;
    width: 90vw;
  }

  .help-content h2 {
    font-size: 1.5rem;
  }

  #help-btn {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
  }
}