/* Conteneur du formulaire */
.search-bar {
    display: block;
    justify-content: center;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto 20px;
}

.search-bar input {
    width: 100%;
}

/* Champs de recherche */
.search-field {
    flex: 1 1 70%;
    position: relative;
}

.ville-field {
    flex: 1 1 30%;
}

/* Autocomplétion */
#titre-list {
    position: absolute;
    background: white;
    /*border: 1px solid var(--bleu);*/
    border-radius: 30px;
    max-height: 150px;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    z-index: 10;
}

#titre-list li {
    padding: 8px;
    cursor: pointer;
    color: var(--bleu);
}

#titre-list li:hover {
    background: #f0f0f0;
}

/* Bouton de recherche */
.search-bar button {
    padding: 10px;
    background: #142469;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.search-bar button:hover {
    background: #0f1b50;
}

/* Responsive */
@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
    }
}

/* 💡 CONTAINER PRINCIPAL */
.liste-offre-container {
    display: grid;
    grid-template-columns: 280px 1fr; /* 280px pour les filtres, reste pour les offres */
    gap: 30px;
    width: 90%;
    margin: 40px auto;
    align-items: flex-start;
}


.offres-container {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    align-items: flex-start; /* Garde la hauteur minimale des blocs latéraux */
}

.offres-container a {
    text-decoration: none;
}

/* 📌 BLOCS LATÉRAUX (STICKY + TAILLE MIN) */
.filtres, .candidature {
    position: sticky;
    top: 100px;
    min-width: 280px;
}

.filtres * {
    max-width: 100%;
    box-sizing: border-box;
}


.candidature-content {
    background: var(--blanc);
    padding: 20px;
    border-radius: 30px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    height: fit-content; /* Taille minimale */
    min-width: 250px; /* Largeur minimale pour éviter qu'ils soient trop petits */
    margin-bottom: 30px;
}

.form-alerte button{
    margin-top: 10px;
}

.form-alerte input {
    width: 100%;
}

/* 📜 LISTE DES OFFRES */
.liste-offres {
    background: var(--creme);
    padding: 20px;
    border-radius: 30px;
    margin-top: 50px;
}

/* 📝 CARTE OFFRE (empilement vertical) */
/* 📝 CARTE OFFRE */
.offre-card {
    background-color: var(--bleu);
    border-radius: 30px;
    padding: 0px;
    border: 1px solid var(--bleu);
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column; /* Maintien de l'empilement vertical */
    gap: 10px;
    min-height: 150px;
    text-decoration: none;
}


/*a:has(.offre-card):nth-child(even) .offre-card {
    background-color: #1f3780;
}
*/
.offre-bloc:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.offre-card a {
        text-decoration: none;
}

.offre-main {
    background-color: var(--blanc);
    padding: 20px;
    border-radius: 30px;
}

.offre-main a {
        text-decoration: none !important;
        color: var(--bleu);
}

/* 🔹 Ligne 1 : Titre + Date */
.offre-header {
    display: flex;
    /*justify-content: space-between;*/
    gap: 10px;
    align-items: center;
    width: 100%; /* Évite que la date saute en dessous */
    min-height: 100px;
}

a div.offre-card {
    text-decoration: none !important;
}

.offre-header h3 {
    font-size: 12pt;
    font-family: 'Futura Std', serif;
    font-weight: 300;
    letter-spacing: 1pt;
    color: var(--bleu);
    margin: 0;
    text-decoration: none;
    text-transform: uppercase;
}

.offre-date {
    color: #7799bf;
    font-weight: bold;
    font-size: 9pt;
    padding: 2px 12px;
    text-transform: uppercase;
    text-align: center;
    display: flex;
    justify-content: center;
}

.offres-container .offre-card:hover .offre-main {
    background-color: var(--bleu);
    transition: all 0.3s ease;
}

.offres-container .offre-card:hover .offre-header h3 {
    transition: all 0.3s ease;
    color: var(--creme);
}


/*
.offre-extra {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  padding-top: 0;
  font-size: 10px;
  color: #333;
}

.offres-container .offre-card:hover .offre-extra {
  max-height: 300px;
  opacity: 1;
  padding-top: 10px;
  transition: all 0.3s ease;
}

.offres-container .offre-card:hover .offre-header {
  min-height: 0 !important;
    transition: all 0.3s ease;
}

.offres-container .offre-card:hover .offre-header h3 {
    font-size: 10pt;
    text-transform: none;
    transition: all 0.3s ease;
}
*/
.new_offer {
    /*position: absolute;*/
    background-color: #93c255;
    color: var(--creme);
    border-radius: 30px;
    padding: 5px;
    font-size: 10px;
    margin: 0 0 0 10px;

}

.offre-date .date_popup {
  visibility: hidden;
  width: auto;
  background-color: var(--bleu);
  color: var(--creme);
  text-align: center;
  border-radius: 6px;
  padding: 5px 2px;
  position: absolute;
  z-index: 1;
}
    
.offre-date:hover .date_popup {
  visibility: visible;
}

/* 🔹 Ligne 2 : Descriptif */
.offre-description {
    opacity: 0.8;
    font-size: 9pt;
    line-height: 1.5;
}

/* 🔹 Séparateur */
.offre-separateur {
    border: none;
    height: 1px;
    background: var(--bleu);
    opacity: 0.2;
}

/* 🔹 Ligne 3 : Ville + Contrat + Bouton */
.offre-footer {
    justify-content: space-between; /* Maintient les éléments en ligne */
    align-items: center;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

/* Tags Ville + Contrat */
.offre-tags {
    display: flex;
    gap: 10px;
}

.offre-ville, .offre-contrat {
    background: var(--creme);
    color: var(--bleu);
    padding: 2px 4px;
    border: 1px solid var(--bleu);
    border-radius: 15px;
    font-size: 9pt;
    font-weight: normal;
    text-transform: uppercase;
    margin-bottom: 20px;
}

/* SEARCH BAR */

.search-bar {
    text-align: center;
}

/* 📌 BOUTON "VOIR L'OFFRE" */
.btn-rouge {
    background: var(--rouge);
    color: var(--blanc) !important;
    padding: 10px 15px;
    display: inline-flex;
    justify-content: center;
    border-radius: 30px;
    font-weight: bold;
    font-size: 9pt;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease;
    min-width: 120px; /* Pour éviter qu'il devienne trop petit */
    text-align: center;
}

.btn-second {
    background-color: #ffffff !important;
    border: 1px solid var(--rouge) !important;
    color: var(--rouge) !important;
    font-size: 12px;
}

.btn-rouge:hover {
    background: #c73214;
}

.nb_resulats {
    position: sticky;
    top: 20px;
    text-align: center;
    display: flex;
}

/* 📏 RESPONSIVE (tablette et mobile) */
@media (max-width: 1024px) {
    .liste-offre-container {
        grid-template-columns: 1fr;
    }

    .filtres,
    .candidature {
        position: static;
        width: 1rem;
        margin-bottom: 20px;
    }
    
    .offres-container {
        display: inline !important;
    }

    .search-bar form {
        width: 90%;
    }
    
    .offre-bloc {
        width: 1rem;
        display: block;
    }
    
    .offre-card {
        margin-bottom: 10px;
        min-height: 0px;
    }
    
    .offre-header, .offre-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        min-height: 20px;
    }

    .offre-footer {
        flex-direction: column-reverse;
        align-items: flex-start;
    }

    .btn-rouge {
        width: 100%;
        text-align: center;
    }
    
    div .pagination-limit {
        display: none;
    }
    
    .pagination-numbers {
        display: none !important;
    }
    
    .candidature-content {
        margin: 5%;
    }
}

.offre-card h3 span :not(.hf){
    font-family: 'Futura Std';
    background-color: var(--bleu);
    color: var(--creme);
    text-align: left;
    font-size: 16px;
    font-weight: 200;
    padding: 2px;
}



.offre-card:hover {
    transform: scale(1.05);
}

/* Contenu texte en bas de la carte */
.offre-content {
    position: relative;
    z-index: 2;
}

.offre-titre {
    font-size: 10px;
    font-weight: bold;
}

.offre-lieu {
    font-size: 1rem;
    opacity: 0.8;
}


/* PAGINATION */
.pagination-container {
    display: grid;
    grid-template-columns: 10  1fr;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Conteneur pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Flèches de navigation */
.pagination-arrow {
    padding: 8px 12px;
    background: #142469;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
}

.pagination-arrow:hover {
    background: #0f1b50;
}

/* Numéros de page */
.pagination-numbers {
    display: flex;
    gap: 5px;
}

.pagination-numbers a {
    padding: 8px 12px;
    background: #142469;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.pagination-numbers a:hover {
    background: #0f1b50;
}

.pagination-numbers .active {
    background: #ed4018;
}

/* Sélection du nombre d'offres */
.pagination-limit {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.pagination-limit label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

/* Dropdown */
#limit-select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: auto;
}

    .mobile-only {
        display: none;
    }

/* Responsive */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
        
    .liste-offre-container {
        padding-top: 20%;
    }
    
    .liste-offres h2 {
        display: none;
    }
    
    .search-bar {
        display: none;
    }
    
    .mobile-only {
        display: flex;
    }
    
    .filter-second-btns {
        display: grid;
        grid-template-columns: 49% 49%;
        gap: 2%;
}

}

p.nombre-resultats {
    text-align: center;
}

.btn-delete {
    font-size: 10pt !important;
    color: #232323 !important;
    background-color: #D3D3D3 !important;
    border: none !important;
}

.emoji {
    text-align: center;
    width: 50px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.search-bar {
    flex-grow: 1;
    max-width: calc(100% - 300px); /* ajuste selon la largeur de .candidature */
}

.candidature {
    width: 280px; /* fixe la largeur pour réserver l'espace */
}

.offres-container {
    width: 100%;
}

.btn-alerte-sticky {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background-color: #ed4018;
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-family: 'Futura Std', sans-serif;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none; /* Masqué par défaut */
}

/* Affichage uniquement sur desktop */
@media screen and (min-width: 1024px) {
    .btn-alerte-sticky {
        display: block;
    }
}

.btn-alerte-sticky {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background-color: #ed4018;
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-family: 'Futura Std', sans-serif;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
}
@media screen and (min-width: 1024px) {
    .btn-alerte-sticky {
        display: block;
    }
}

/* Modale */
.modal-alerte {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content-alerte {
    background-color: #faf7f4;
    margin: 10% auto;
    padding: 30px;
    border-radius: 30px;
    width: 90%;
    max-width: 500px;
    font-family: 'Juana', serif;
    position: relative;
}

.close-alerte {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
}

.hf-tooltip {
    position: relative;
    display: inline-block;
    color: #7799bf;
    font-size: 8pt;
    cursor: help;
}

.hf-tooltip .hf-tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #7799bf !important;
    color: #fff;
    text-align: center;
    padding: 8px !important;
    border-radius: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* au-dessus */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 9px !important;
    line-height: 1.4;
}

.hf-tooltip .hf-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%; /* flèche */
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #142469 transparent transparent transparent;
}

.hf-tooltip:hover .hf-tooltip-text {
    visibility: visible;
    opacity: 1;
}
