/**
 * Styles pour l'archive des offres d'emploi et le panneau de détail
 * Plugin Job Importer
 */

/* ===================================== */
/* 1. FONCTIONNEMENT GÉNÉRAL & VARIABLES */
/* ===================================== */

/* Force la couleur de fond blanche pour les pages d'archive des offres */
body.post-type-archive-job,
body.tax-job_category,
body.tax-job_tag {
  background-color: var(--ast-global-color-4, #FFFFFF) !important;
}

body.post-type-archive-job #primary {
  margin-top: 10px !important;
  padding-top: 0 !important
}

/* Variables CSS - Utilisation des couleurs du thème Astra */
:root {
  --border-radius-btn: 25px;
  --border-radius-round: 50%;
  --btn-transition: all 0.3s ease;
  --overlay-transition: opacity 0.3s ease;
  --filters-transition: left 0.3s ease;
  --layout-transition: all 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fa-spinner {
  animation: fa-spin 1s infinite linear;
}

/* Style du masque de chargement */
#loading-overlay {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 8px;
  transition: opacity 0.3s ease;
  margin: 0;
}

#loading-overlay.loading-hidden {
  display: none;
}

#loading-overlay.loading-visible {
  display: flex;
}

/* Styles pour le spinner de chargement */
.loading-spinner {
  text-align: center;
}

.loading-spinner-icon {
  display: inline-block;
  font-size: 40px;
  color: var(--ast-global-color-0);
  margin-bottom: 10px;
}

.loading-spinner p {
  margin-top: 10px;
  color: var(--ast-global-color-2);
  font-weight: 500;
}

/* ================================ */
/* 2. LAYOUT PRINCIPAL & CONTENEURS */
/* ================================ */

/* Layout principal */
main#jobs, #jobs {
  max-width: 1440px !important;
  margin: 2rem auto !important;
  display: flex !important;
  gap: 0.5rem !important;
  padding: 0 !important;
  position: relative;
  min-height: 100vh;
  /* Ajout de la transition pour l'animation */
  transition: var(--layout-transition);
}

/* En mode détail, supprimer le gap pour éviter le décalage à gauche mais conserver l'espacement à droite */
#jobs.detail-view {
  gap: 0 !important;
}

/* Conteneur principal pour le mode avec panneau détail */
#jobs-main-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
  /* Ajout de la transition pour l'animation fluide */
  transition: var(--layout-transition);
  transform: translateX(0);
}

/* Modes d'affichage */
#jobs.normal-view .job-filters {
  display: block;
  visibility: visible;
  /* Animation de la sidebar des filtres */
  transform: translateX(0);
  opacity: 1;
  transition: var(--layout-transition);
  flex: 0 0 450px !important;
  width: 450px !important;
  max-width: 100%;
  padding: 25px !important;
}

#jobs.normal-view #jobs-main-container {
  flex: 1;
  transform: translateX(0);
  /* En mode normal, la liste prend tout l'espace disponible */
  width: auto;
}

#jobs.detail-view .job-filters {
  /* Ne pas utiliser display: none pour permettre l'animation */
  visibility: hidden;
  /* Animation de sortie pour les filtres */
  transform: translateX(-100%);
  opacity: 0;
  transition: var(--layout-transition);
  flex: 0 0 0px !important;
  width: 0px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
}

#jobs.detail-view #jobs-main-container {
  /* En mode détail, largeur fixe avec animation */
  flex: 0 0 450px !important;
  width: 450px !important;
  /* Ajouter une marge à droite pour compenser le gap supprimé et maintenir l'espacement avec le panneau détail */
  margin-right: 1rem !important;
}

#jobs.detail-view #jobs-section {
  flex: 1 !important;
  width: 100% !important;
}

/* ============================= */
/* 3. ZONE DE RECHERCHE EN HAUT */
/* ============================= */

#top-filter-bar {
  width: 100%;
  background: var(--ast-global-color-4);
  position: relative;
}

/* Bordure qui s'étend sur toute la largeur de l'écran */
#top-filter-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background-color: var(--ast-global-color-7);
}

#top-filter-bar .search-container {
  max-width: 1440px;
  margin: auto;
}

/* Styles pour la zone de recherche */
.search-fields {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 25px 0px;
  background: var(--ast-global-color-4);
}

.search-field {
  flex: 1;
  position: relative;
}

.search-field label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 400;
  color: var(--ast-global-color-3);
  font-style: normal;
  pointer-events: none;
  transition: all 0.2s ease;
  background: var(--ast-global-color-4);
  padding: 0 4px;
}

.search-field input {
  width: 100%;
  padding: 26px 16px;
  border: 1px solid var(--ast-global-color-7);
  border-radius: 25px;
  font-size: 16px;
  background: var(--ast-global-color-4);
  transition: none;
  box-shadow: none;
  color: var(--ast-global-color-8);
}

.search-field input + label {
  color: #888;
}

/* Label flottant quand l'input a une valeur ou est focus */
.search-field input:focus + label,
.search-field input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 12px;
  color: var(--ast-global-color-0);
  font-style: normal;
}

.search-field input:hover {
  border: 2px solid rgba(237, 23, 56, 0.4);
  box-shadow: none;
  padding: 25px 15px;
}

.search-field input:focus {
  outline: none;
  border: 2px solid var(--ast-global-color-0);
  box-shadow: none;
  padding: 25px 15px; 
}

.search-field input::placeholder {
  color: transparent;
}

.search-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.search-actions button {
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius-btn);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  height: fit-content;
  transition: var(--btn-transition);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn, #search-btn {
  background: var(--ast-global-color-0);
  color: var(--ast-global-color-4);
}

.search-btn:hover, #search-btn:hover {
  background: var(--ast-global-color-1);
}

.clear-all-btn, #clear-all-btn {
  background: var(--ast-global-color-2);
  color: var(--ast-global-color-4);
  border: none;
  padding: 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--border-radius-btn);
  transition: var(--btn-transition);
  float: right;
}


.clear-all-btn:hover, #clear-all-btn:hover {
  background: var(--ast-global-color-3);
}

#jobs.detail-view .clear-all-btn,
.clear-all-btn.hidden {
  display: none !important;
}

/* ======================= */
/* 4. COLONNE DES FILTRES */
/* ======================= */

/* Sidebar des filtres */
.job-filters {
  background: var(--ast-global-color-4);
  padding: 25px;
  border: 1px solid var(--ast-global-color-7);
  max-height: 100vh;
  overflow-y: auto;
  flex: 0 0 450px;
  width: 450px;
  position: relative;
  /* Ajout de l'animation pour la sidebar */
  transition: var(--layout-transition);
  transform: translateX(0);
  opacity: 1;
}

.filters-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 20px !important;
  padding-bottom: 10px !important;
  flex-wrap: nowrap !important; /* Empêche le passage à la ligne */
  gap: 15px !important;
  min-height: 32px !important; /* Hauteur minimale pour maintenir l'alignement */
}

.filters-header .clear-all-btn {
  flex-shrink: 0 !important;
  max-width: none !important;
}

.job-filters h3 {
  color: var(--ast-global-color-2);
  font-size: 18px;
  font-weight: 800;
  margin-top: 6px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  flex: 1 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Style des groupes de filtres */
.filter-group .filter-group-toggle {
  color: var(--ast-global-color-2);
  font-size: 16px;
  font-weight: 600;
}

.filter-group:first-child .filter-group-toggle {
  margin-top: 0;
}

/* Styles pour l'accordéon des groupes de filtres */
.filter-group-toggle {
  cursor: pointer;
  user-select: none;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  position: relative;
  padding: 20px 0 15px;
  margin: 1rem 0 0 0 !important;
  border-top: 2px solid var(--ast-global-color-7) !important;
}

.filter-group:first-child .filter-group-toggle {
  margin-top: 0 !important;
}

.filter-group-title {
  flex: 1;
  font-weight: 700;
  color: var(--ast-global-color-2);
}

/* Pastille avec le nombre de filtres sélectionnés */
.filter-group-badge {
    background-color: var(--ast-global-color-0);
    color: var(--ast-global-color-4);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    text-align: center;
    margin-right: 8px;
    display: inline-block;
}

/* Flèche d'accordéon */
.filter-group-arrow {
  transition: transform 0.3s ease;
  color: var(--ast-global-color-3);
  font-size: 14px;
}

.filter-group-toggle.collapsed .filter-group-arrow {
  transform: rotate(180deg);
}

/* Contenu du groupe de filtres */
.filter-group-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 1000px;
  opacity: 1;
}

.filter-group-content.open {
  max-height: 1000px;
  opacity: 1;
}

.filter-group-content:not(.open) {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
}

/* Style pour le sous-titre des filtres */
.filter-subtitle {
  color: var(--ast-global-color-3);
  font-size: 12px;
  font-weight: 400;
  margin: 5px 0 0 0;
  line-height: 1.3;
}

/* Style des listes de filtres */
.filter-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 10px 0 0;
}

/* Style des labels de filtres */
.filter-label {
  display: flex !important;
  align-items: center !important;
  cursor: pointer !important;
  font-size: 14px;
  padding: 2px 6px;
  margin: 2px 0;
  border-radius: 25px;
  transition: all 0.2s ease;
  color: var(--ast-global-color-2);
  font-weight: 400;
}

.filter-label:hover {
  background-color: var(--ast-global-color-5);
}

/* Style des checkboxes de filtres */
.filter-checkbox {
  margin-right: 0.5rem;
  accent-color: var(--ast-global-color-0);
}

.filter-checkbox:checked + span {
  font-weight: 600;
  color: var(--ast-global-color-0);
}

/* Styles pour les filtres désactivés */
.filter-checkbox:disabled + .filter-label {
  color: var(--ast-global-color-7) !important;
  cursor: not-allowed;
}

.filter-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Styles pour la fonctionnalité "Voir plus" */
.filter-item-hidden {
  display: none !important;
}

.show-more-filters {
  background: transparent !important;
  border: none !important;
  padding: 0px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  color: var(--ast-global-color-2) !important;
  margin-top: 12px !important;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-weight: 400;
  letter-spacing: 0.5px;
  box-shadow: none;
}

.show-more-filters:hover {
  text-decoration: underline;
}

.detail-view #map-toggle-btn,
#mobile-filters-close {
  display: none;
}

/* ========================== */
/* 5. COLONNE LISTE DES OFFRES */
/* ========================== */

/* Section des offres */
#jobs-section {
  flex: 1 !important;
  position: relative !important;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--ast-global-color-5);
  /* Ajout de l'animation pour la section des offres */
  transition: var(--layout-transition);
  border: 1px solid var(--ast-global-color-7);
}

/* Styles pour l'en-tête des jobs */
.jobs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ast-global-color-5);
}

.jobs-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: none;
  min-height: 36px;
}

.jobs-header-top strong {
  margin: 0;
  font-size: 14px;
  color: var(--ast-global-color-2);
  font-weight: 600;
  display: flex;
  align-items: center;
}

/* Compteur de résultats stylé */
#jobs-count {
  font-weight: 700;
  color: var(--ast-global-color-0);
  font-size: 18px;
  margin-right: 4px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-controls label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ast-global-color-2);
  display: flex;
  align-items: center;
}

.sort-controls select {
  padding: 8px 15px !important;
  border: 1px solid var(--ast-global-color-7) !important;
  border-radius: 8px !important;
  background: var(--ast-global-color-4) !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.3s ease;
}

.sort-controls select:focus {
  outline: none;
  border-color: var(--ast-global-color-0);
  box-shadow: 0 0 0 3px rgba(237, 23, 56, 0.1);
}

/* Styles pour la liste des jobs */
#jobs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  transition: opacity 0.3s ease;
}

/* Styles pour les offres d'emploi individuelles */
#jobs-list li, .job-item {
  border: 1px solid transparent;
  border-top: 1px solid var(--ast-global-color-7);
  padding: 30px 20px;
  background: var(--ast-global-color-4);
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Layout en 2 colonnes pour écrans > 768px */
@media (min-width: 768px) {
  #jobs-list li, .job-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
  }
  
  .job-item-left {
    flex: 1;
    min-width: 0;
  }

  #jobs-main-container.detail-open .job-item-left {
    min-width: 55%;
  }

  #jobs-main-container.detail-open .job-item-right {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  #jobs-main-container.detail-open .job-item-right .job-details {
    flex-wrap: wrap;
  }

  #jobs-main-container.detail-open .job-item-right .job-detail-item {
    white-space: normal;
    word-break: break-word;
    text-align: left;
    align-items: baseline;
  }
  
  .job-item-right {
    flex: 0 0 280px;
    min-width: 280px;
    max-width: 280px;
    display: flex;
    align-items: center;
  }
}

#jobs-list li:hover, .job-item:hover {
  background: var(--ast-global-color-5);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--ast-global-color-2);
  border-top: 1px solid var(--ast-global-color-2);
}

#jobs-list li:hover .job-title,
.job-item:hover .job-title {
  text-decoration: underline;
}

.job-item.selected {
  background: var(--ast-global-color-5);
  border-right: 4px solid var(--ast-global-color-0);
}

/* Styles pour les métadonnées de job (date et badge) */
.job-meta {
  display: flex !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  margin-bottom: 5px !important;
  gap: 10px;
}

/* Style pour la date de publication */
.job-time {
  color: var(--ast-global-color-3) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

/* Badge "Nouveau" */
.job-new-badge {
  background: linear-gradient(135deg, var(--ast-global-color-0), var(--ast-global-color-1));
  color: var(--ast-global-color-4);
  padding: 2px 10px 0px 10px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top:8px;
}

/* Titre des offres */
.job-title-container h2,
.job-title {
  margin: 0 !important;
  padding: 0 !important;
  font-weight: 700;
  font-size: 20px;
  color: var(--ast-global-color-2);
  line-height: 1.4;
  padding-right: 80px !important; 
  font-family: 'Roboto', sans-serif;
}

/* Anciens styles pour la rétrocompatibilité - à supprimer si plus utilisés */
.job-title-link {
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
  display: inline;
}

.job-title-link:focus {
  outline: none;
}

/* Détails de l'offre (localisation, contrat) */
.job-details {
  font-size: 14px;
  color: var(--ast-global-color-3);
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.job-detail-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.job-detail-item i {
  flex-shrink: 0;
}

/* Ajustement des détails en mode 2 colonnes */
@media (min-width: 768px) {
  .job-item-right .job-details {
    margin-top: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Ajustement du titre en mode 2 colonnes */
@media (min-width: 768px) {
  .job-title-container h2,
  .job-title {
    padding-right: 0 !important;
  }
}

/* Ajustement des détails en mode 2 colonnes */
@media (min-width: 768px) {
  .job-item-right .job-details {
    margin-top: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
  
  .job-item-right .job-details i {
    margin-right: 6px;
    margin-left: 0;
  }
}

/* Message "Aucune offre trouvée" */
.no-jobs-message, #no-jobs {
  text-align: center !important;
  padding: 60px 40px !important;
  color: var(--ast-global-color-3) !important;
  background: var(--ast-global-color-5);
}

.no-jobs-message p, #no-jobs p {
  font-size: 16px;
  margin: 0;
}

/* Styles pour les contrôles de chargement (load more) */
#load-more {
  text-align: center;
  margin: 20px 0;
}

#load-more-btn {
  display: none;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--ast-global-color-0), var(--ast-global-color-1));
  color: var(--ast-global-color-4);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

#load-more-btn:hover {
  background: linear-gradient(135deg, var(--ast-global-color-1), var(--ast-global-color-2));
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

#load-more-btn:disabled {
  background: var(--ast-global-color-7);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#no-more-jobs {
  display: none;
  color: var(--ast-global-color-3);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

#filter-toggle-btn {
  display: none;
}

/* ============================== */
/* 6. COLONNE DÉTAIL D'UNE OFFRE */
/* ============================== */

/* Panneau de détail - EXTERNE et apparaît à la place des filtres */
.job-detail-panel {
  display: none; /* Caché par défaut */
  flex-shrink: 0;
  height: 100vh;
  background: var(--ast-global-color-4);
  overflow-y: auto;
  overflow-x: hidden;
  border-left: 1px solid var(--ast-global-color-7);
  border-bottom: 1px solid var(--ast-global-color-7);
  border-right: 1px solid var(--ast-global-color-7);
  /* Ajout de l'animation pour le panneau de détail */
  transform: translateX(100%);
  opacity: 0;
  transition: var(--layout-transition);
}

/* Panneau visible - prend tout l'espace restant (comme la liste des offres en mode normal) */
.job-detail-panel.open {
  display: block !important;
  flex: 1 !important; /* Prend automatiquement tout l'espace restant */
  width: auto !important; /* Largeur automatique basée sur flex */
  /* Animation d'entrée */
  transform: translateX(0);
  opacity: 1;
}

/* En-tête du panneau */
.job-detail-panel-header {
  position: sticky;
  top: 0;
  background: var(--ast-global-color-4);
  border-bottom: 1px solid var(--ast-global-color-7);
  display: flex;
  align-items: center;
  border: none;
}

/* Boutons de navigation */
.back-to-list {
  position: absolute;
  top: 16px;
  left: 10px;
  background: var(--ast-global-color-2);
  color: var(--ast-global-color-4);
  border: none;
  padding: 11px 20px;
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--border-radius-btn);
  transition: var(--btn-transition);
}

.back-to-list:hover {
  background-color: var(--ast-global-color-3);
  color: var(--ast-global-color-4);
}

/* Contenu du panneau */
.job-detail-panel-content {
  padding: 0;
}

/* États de chargement et d'erreur */
.job-detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--ast-global-color-3);
}

.job-detail-loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.job-detail-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--ast-global-color-0);
  text-align: center;
  padding: 2rem;
}

.job-detail-error i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Contenu de l'offre détaillée */
.job-detail-content {
  padding: 0;
}

.job-detail-content section {
  padding: 0 1rem; 
}

/* En-tête de l'offre détaillée */
.job-detail-header {
  padding: 1rem;
  border-bottom: 1px solid var(--ast-global-color-7);
}

.job-detail-title-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2px;
}

.job-company {
  font-size: 14px;
  font-weight: 700;
  color: var(--ast-global-color-6);
  margin-bottom: 8px;
}

.job-detail-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  font-family: 'Roboto', sans-serif;
  line-height: 1.2;
}

/* Métadonnées de l'offre détaillée */
.job-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 10px;
}

.job-meta-item {
  font-size: 14px;
}

.job-meta-item i {
  color: var(--ast-global-color-3);
}

.job-meta-item strong {
  font-weight: 600;
  color: var(--ast-global-color-0);
}

/* Actions de l'offre détaillée */
.job-detail-actions {
  gap: 1rem;
  float:right;
  margin-top: -10px;
}

#apply-button {
  font-size: 14px;
  color: var(--ast-global-color-4);
  text-decoration: none;
  font-weight: 900;
  background: var(--ast-global-color-0);
  border-radius: var(--border-radius-btn);
  transition: all 0.2s;
  padding: 6px 20px;
}

#apply-button:hover {
  background: var(--ast-global-color-0);
  text-decoration: none;
}

/* Favorite button (masqué) - conservé dans le markup pour réactivation future */
.favorite-button {
  /* Le bouton favoris est masqué, mais le HTML est conservé */
  display: none !important;
}

.favorite-button i,
.favorite-button svg,
.favorite-button .icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
  display: inline-block;
}

.favorite-button:hover {
  background: var(--ast-global-color-0);
  color: var(--ast-global-color-4);
  text-decoration: none;
}

/* Share button wrapper */
.share-button-wrapper {
  position: relative;
  display: inline-block;
}

.share-button {
  margin-right: 10px;
  text-decoration: none;
  width: 31px;
  height: 31px;
  padding: 0;
  border-radius: var(--border-radius-round);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ast-global-color-4);
  color: var(--ast-global-color-0);
  border: none;
  cursor: pointer;
  font-size: 0; /* hide possible text, icon size set below */
  line-height: 1;
  transition: all 0.2s;
  vertical-align: middle;
  min-width: 31px;
  min-height: 31px;
  box-shadow: none;
}

/* Icon inside the button (Font Awesome or SVG) */
.share-button i,
.share-button svg,
.share-button .icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
  display: inline-block;
}

/* Hover / focus / active states */
.share-button:hover {
  background: var(--ast-global-color-0);
  color: var(--ast-global-color-4);
}

/* Share dropdown */
.share-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  left: auto;
  background: white;
  border: 1px solid var(--ast-global-color-7);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none; /* Désactiver les événements par défaut */
}

/* Zone de survol étendue pour éviter que le dropdown disparaisse */
.share-button-wrapper::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 10px;
  background: transparent;
}

.share-button-wrapper:hover .share-dropdown,
.share-dropdown:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  display: flex; /* Afficher en flex au survol */
  pointer-events: auto; /* Activer les événements au survol */
}

.share-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ast-global-color-2);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 50%;
}

.share-option:hover {
  background: var(--ast-global-color-5);
  transform: scale(1.1);
}

.share-option i {
  font-size: 18px;
  color: var(--ast-global-color-2);
}

.share-option:hover i {
  color: var(--ast-global-color-0);
}

.share-option span {
  display: none; /* Masquer le texte */
}

/* Corps du contenu détaillé */
.job-detail-body {
  padding: 0;
}

/* Sections du contenu détaillé */
.job-detail-body section {
  padding: 0 1rem;
}

/* Sections du contenu détaillé */
.job-detail-body .job-criteria {
  border-bottom: 1px solid var(--ast-global-color-7);
  padding: 1rem;
  margin-bottom: 40px;
}

.job-detail-body section:last-child {
  border-bottom: none;
}

.job-detail-body h3 {
  font-size: 18px;
  font-weight: 500;
  color: var(--ast-global-color-2);
  margin-bottom: 8px;
}

.job-detail-body h3.accordion-toggle {
  font-size: 18px;
  font-weight: 400;
  margin: 0;
}

.job-detail-body .accordion-content.open {
  margin-top: 1rem;
  padding: 0 2rem;
}

/* Styles pour l'accordéon */
.accordion-toggle {
  cursor: pointer;
  position: relative;
}

.accordion-toggle::after {
  content: '\f107'; /* Font Awesome chevron-down */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: 0;
  transition: transform 0.3s ease;
}

.accordion-toggle.active::after {
  transform: rotate(180deg);
}

.accordion-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 0;
}

/* Grille des critères */
.criteria-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.criteria-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.criteria-item label {
  font-weight: 400;
  color: var(--ast-global-color-3);
  font-size: 14px;
  margin: 0;
  min-width: 170px;
}

.criteria-item span {
  background: var(--ast-global-color-5);
  color: var(--ast-global-color-2);
  padding: 0.2rem 0.8rem;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

/* Contenu texte de l'offre détaillée */
.job-content {
  color: var(--ast-global-color-3);
  line-height: 1.6;
  font-size: 14px;
}

.job-content p {
  margin-bottom: 1rem;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: var(--ast-global-color-3);
}

.job-content ul,
.job-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.job-content li {
  margin-bottom: 0.5rem;
}

/* Informations de contact */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ast-global-color-0);
  text-decoration: none;
  font-weight: 500;
  padding: 0.8rem 1.2rem;
  background: var(--ast-global-color-5);
  border-radius: 6px;
  transition: all 0.2s;
  width: fit-content;
}

.contact-email:hover {
  background: var(--ast-global-color-0);
  color: var(--ast-global-color-4);
  text-decoration: none;
}

#mobile-back-to-list {
  display: none;
}

/* ===================================== */
/* 7. STYLES POUR LES ICÔNES FONT AWESOME */
/* ===================================== */

.search-field label i,
.job-filters h3 i,
.jobs-header-top strong i,
.sort-controls label i {
  margin-right: 8px;
  color: var(--ast-global-color-0);
}

.search-btn i,
.clear-all-btn i {
  margin-right: 6px;
}

.no-jobs-message i {
  margin-right: 8px;
  color: var(--ast-global-color-1);
  font-size: 1.1em;
}

.job-time i {
  margin-right: 5px;
  color: var(--ast-global-color-3);
  font-size: 12px;
}

.job-new-badge i {
  margin-right: 5px;
  font-size: 10px;
}

.job-title i {
  margin-right: 8px;
  color: var(--ast-global-color-0);
  font-size: 16px;
}

.job-details i {
  margin-right: 5px;
  color: var(--ast-global-color-3);
  font-size: 12px;
  width: 14px;
  text-align: center;
  margin-right: 0;
}

.job-details .fa-file-contract {
  margin-left: 10px;
}

/* ===================================== */
/* 8. AUTOCOMPLETE LIEU */
/* ===================================== */

.search-field {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: var(--ast-global-color-4);
  border: 1px solid var(--ast-global-color-7);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--btn-transition);
  border-bottom: 1px solid var(--ast-global-color-7);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--ast-global-color-5);
}

.suggestion-item i {
  color: var(--primary-red);
  margin-right: 0.75rem;
  font-size: 1rem;
  min-width: 16px;
}

.suggestion-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ast-global-color-2);
}

.suggestion-main {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ast-global-color-2);
  margin-bottom: 0.15rem;
}

.suggestion-detail {
  font-size: 0.8rem;
  color: var(--ast-global-color-3);
}

.suggestion-count {
  font-size: 0.8rem;
  color: var(--ast-global-color-3);
  font-weight: normal;
  margin-left: 0.5rem;
}

.no-suggestions,
.suggestion-item.no-results {
  padding: 0.75rem 1rem;
  color: var(--ast-global-color-3);
  font-style: italic;
  text-align: center;
  font-size: 14px;
  cursor: default;
  justify-content: center;
}

.suggestion-item.no-results:hover {
  background: transparent;
}


/* ===================================== */
/* 9. CARTE INTERACTIVE */
/* ===================================== */

.header-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.map-toggle-btn ,
.map-toggle-btn:focus {
  background-color: var(--ast-global-color-4);
  color: var(--ast-global-color-2);
  border: none;
  padding: 10px 16px;
  border-radius: var(--border-radius-btn);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--btn-transition);
  white-space: nowrap;
  box-shadow: none;
}

.map-toggle-btn:hover {
  background-color: var(--ast-global-color-0);
  color: var(--ast-global-color-4);
}



.map-toggle-btn i {
  color: var(--ast-global-color-0);
  font-size: 16px;
}

.jobs-map {
  margin: 0;
  border: 1px solid var(--ast-global-color-7);
  overflow: hidden;
  position: relative;
  z-index: 99;
}

#map-container {
  max-height: 400px;
  width: 100%;
}

/* Popup des villes avec offres d'emploi */
.city-popup {
  min-width: 200px;
}

.city-popup h4 {
  margin: 0 0 10px 0;
  color: var(--ast-global-color-0);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.city-popup p {
  margin: 0 0 15px 0;
  color: var(--ast-global-color-2);
  font-size: 14px;
}

.city-popup p strong {
  font-weight: 600;
}

.city-filter-btn {
  background: var(--ast-global-color-0);
  color: var(--ast-global-color-4);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.city-filter-btn:hover {
  background: var(--ast-global-color-0);
}

.city-filter-btn i {
  font-size: 12px;
}

/* Marker personnalisé des villes */
.custom-city-marker-container {
  background: transparent !important;
  border: none !important;
}

.custom-city-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background-color: var(--ast-global-color-0);
  border-radius: var(--border-radius-round);
}

.custom-city-marker i {
  color: var(--ast-global-color-4);
  font-size: 18px;
  text-shadow: none;
  filter: none;
}

/* Clusters de markers */
.marker-cluster-small {
  background-color: rgba(237, 23, 56, 0.4);
}

.marker-cluster-small div {
  background-color: var(--ast-global-color-0);
}

.marker-cluster-medium {
  width: 50px !important;
  height: 50px !important;
  background-color: rgba(237, 23, 56, 0.4);
}

.marker-cluster-medium div {
  background-color: var(--ast-global-color-0);
}

.marker-cluster-large {
  width: 65px !important;
  height: 65px !important;
  background-color: rgba(237, 23, 56, 0.4);
}

.marker-cluster-large div {
  background-color: var(--ast-global-color-0);
}

.marker-cluster {
  border-radius: var(--border-radius-round);
  text-align: center;
  color: var(--ast-global-color-4);
}

.marker-cluster div {
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: var(--border-radius-round);
  display: flex;
  font-weight: bold;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

/* Tailles spécifiques pour les petits clusters */
.marker-cluster-small div {
  width: 36px;
  height: 36px;
  font-size: 12px;
  margin-left: 2px;
  margin-top: 2px;
}

/* Tailles spécifiques pour les clusters moyens */
.marker-cluster-medium div {
  width: 46px;
  height: 46px;
  font-size: 14px;
  margin-left: 2px;
  margin-top: 2px;
}

/* Tailles spécifiques pour les gros clusters */
.marker-cluster-large div {
  width: 55px;
  height: 55px;
  font-size: 16px;
}

.marker-cluster span {
  line-height: 1;
}

/* Effet hover pour les clusters */
.marker-cluster:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

/* ===================================== */
/* BLOC DE POSTULATION (Détail AJAX) */
/* ===================================== */

.job-application-section {
  border-top: 1px solid var(--ast-global-color-7);
  padding: 3rem 2rem !important;
  margin: 2rem 0 0 0;
  text-align: center;
}

.job-application-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--ast-global-color-2, #333);
  margin: 0 0 0.5rem 0;
  text-transform: none;
}

.job-application-subtitle {
  font-size: 16px;
  color: var(--ast-global-color-3, #666);
  margin: 0 0 2rem 0;
  line-height: 1.4;
}

.job-application-form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.job-application-form .form-group {
  margin: 0;
}

.job-application-form .form-control {
  max-width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--ast-global-color-7, #DDD);
  border-radius: 4px;
  font-size: 15px;
  transition: border-color 0.2s;
  background: var(--ast-global-color-4, #FFF);
  box-sizing: border-box;
}

.job-application-form .form-control:disabled {
  background: var(--ast-global-color-4, #FFF);
  cursor: not-allowed;
  opacity: 1;
  color: var(--ast-global-color-3, #666);
}

.job-application-form .form-control::placeholder {
  color: var(--ast-global-color-8, #999);
}

.job-application-form .form-hint {
  font-size: 13px;
  color: var(--ast-global-color-3, #666);
  margin: -0.5rem 0 0 0;
  text-align: center;
  font-style: normal;
}

.job-application-form .btn-submit-application {
  max-width: 220px;
  padding: 10px 20px;
  background: var(--ast-global-color-4, #FFF);
  color: var(--ast-global-color-2, #333);
  border: 2px solid var(--ast-global-color-2, #333);
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 auto;
}

.job-application-form .btn-submit-application:hover:not(:disabled) {
  background: var(--ast-global-color-2, #333);
  color: var(--ast-global-color-4, #FFF);
}

.job-application-form .btn-submit-application:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.job-application-form .form-disclaimer {
  font-size: 13px;
  color: var(--ast-global-color-3, #666);
  line-height: 1.5;
  margin: 0.5rem 0 0 0;
  text-align: center;
}

.job-application-form .form-disclaimer a {
  color: var(--ast-global-color-0, #E30613);
  text-decoration: underline;
}

.job-application-form .form-disclaimer a:hover {
  text-decoration: none;
}

.job-application-section .job-reference {
  font-size: 14px;
  color: var(--ast-global-color-3, #666);
  margin: 1.5rem 0 0 0;
  text-align: center;
}

.job-application-section .job-reference strong {
  font-weight: 600;
  color: var(--ast-global-color-2, #333);
}

/* ===================================== */
/* 12. MEDIA QUERIES RESPONSIVE */
/* ===================================== */

/* Styles responsive pour le bouton d'alerte */
@media (max-width: 768px) {
  .create-alert-btn {
    bottom: 20px;
    right: 20px;
    padding: 12px 18px;
    font-size: 14px;
  }
  
  .create-alert-btn.stuck-at-bottom {
    bottom: 20px;
    right: 20px;
  }
  
  /* Masquer le texte et ne garder que l'icône sur très petits écrans */
  @media (max-width: 480px) {
    .create-alert-btn {
      padding: 12px;
      border-radius: var(--border-radius-round);
      width: 48px;
      height: 48px;
      justify-content: center;
    }
    
    .create-alert-btn i {
      margin: 0;
    }
    
    .create-alert-btn::after {
      content: ' Créer une alerte';
      position: absolute;
      white-space: nowrap;
      visibility: hidden;
    }
  }
}
