/* Conteneur des cartes */
.stages-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

/* Carte individuelle */
.stage-card {
    width: 30%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stage-card:hover {
    transform: scale(1.05);
}

/* Image de la carte */
.stage-image {
    height: 200px;
    background-size: cover;
    background-position: center;
}

/* Contenu sous l'image */
.stage-content {
    padding: 15px;
}

/* Titre de l'offre */
.stage-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Badge de catégorie */
.custom-badge {
    color: #2EA3F2;
    border: 2px solid #2EA3F2;
    padding: 8px 12px;
    display: inline-block;
    border-radius: 20px;
    font-size: 12px;
    line-height: 0.2;
    margin: 5px 10px;
}

/* Description */
.stage-description {
    font-size: 14px;
    color: #666;
}

.stages-manager {
    font-family: Arial, sans-serif;
    padding: 20px;
    background-color: #f4f4f4;
    border-radius: 10px;
}

/* Titre */
.stages-manager h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

/* Tableaux */
.stages-manager table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

.stages-manager th,
.stages-manager td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.stages-manager th {
    background-color: #0073aa;
    color: white!important;
}

.stages-manager tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Boutons */
.stages-manager .button {
    border-radius: 12px; /* Bords plus arrondis */
    padding: 8px; /* Ajustement pour un meilleur alignement des icônes */
    font-size: 14px;
    font-weight: bold;
    color: inherit; /* Garde la couleur du texte par défaut */
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    margin-right: 10px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    background: transparent; /* Fond transparent */
}

/* Icônes colorées selon l'action */
.stages-manager .button-add i { color: #4CAF50; }
.stages-manager .button-edit i { color: #0073aa; } /* Couleur de l'icône "modifier" à la couleur de la barre de titre du tableau */
.stages-manager .button-delete i { color: #d9534f; } /* Couleur "supprimer" moins pastel */
.stages-manager .button-duplicate i { color: #a3d9b1; }

/* Effet au survol : léger grossissement */
.stages-manager .button:hover {
    transform: scale(1.1);
}

/* Icônes */
.stages-manager .button i {
    font-size: 18px;
}

/* Espacement entre les actions */
.stages-manager td a {
    display: inline-block;
}

/* Message si aucune offre */
.stages-manager .empty-message {
    text-align: center;
    font-style: italic;
    color: #777;
}

/* Style pour la recherche et les filtres */
#stages-filters {
    display: flex;
    gap: 20px; /* Espacement uniforme entre les éléments */
    margin-bottom: 20px;
}

#stages-filters input, #stages-filters select {
    padding: 8px 16px;
    font-size: 16px;
    border-radius: 25px; /* Bordure arrondie pour tout */
    border: 1px solid #ddd;
    height: 40px; /* Hauteur ajustée pour tous les éléments */
    display: flex;
    align-items: center; /* Centrer verticalement le texte dans les filtres */
    line-height: 1.4; /* Assurer que le texte n'est pas décalé */
    white-space: nowrap; /* Empêcher l'enroulement du texte */
    min-width: 200px; /* Largeur minimale pour éviter une taille trop petite */
    width: auto; /* Largeur dynamique selon le contenu */
    max-width: 100%; /* Ne pas dépasser la largeur du conteneur */
    padding-right: 24px; /* Plus d'espace à droite dans les filtres */
}

/* Zone de recherche (forme et largeur identique aux filtres) */
.stages-manager .search-container input[type="text"] {
    border-radius: 25px; /* Bordure arrondie identique aux filtres */
    padding: 8px 16px; /* Moins épais en hauteur */
    font-size: 16px;
    border: 1px solid #ddd;
    margin-right: 0; /* Suppression de l'espace supplémentaire à droite */
    width: auto; /* Largeur dynamique selon le contenu */
    box-sizing: border-box;
    height: 40px; /* Hauteur ajustée pour avoir une taille uniforme */
    display: flex;
    align-items: center; /* Centrer verticalement le texte dans la recherche */
    line-height: 1.4; /* Assurer que le texte est centré dans la zone de recherche */
    min-width: 200px; /* Largeur minimale pour la recherche */
    max-width: 100%; /* S'adapter à la largeur disponible */
    padding-right: 24px; /* Plus d'espace à droite dans la zone de recherche */
}

/* Filtres (entreprise et catégorie) */
.stages-manager #stages-entreprise,
.stages-manager #stages-categorie {
    width: auto; /* Largeur dynamique selon le contenu */
    border-radius: 25px; /* Bordure arrondie comme la zone de recherche */
    padding: 8px 16px; /* Moins épais en hauteur */
    font-size: 16px;
    border: 1px solid #ddd;
    box-sizing: border-box;
    height: 40px; /* Hauteur ajustée */
    display: flex;
    align-items: center; /* Centrer verticalement le texte dans les filtres */
    line-height: 1; /* Assurer que le texte est centré dans les filtres */
    min-width: 200px; /* Largeur minimale pour les filtres */
    max-width: 100%; /* S'adapter à la largeur disponible */
    padding-right: 24px; /* Plus d'espace à droite dans les filtres */
}

/* Total des offres sur la même ligne que les filtres et plus petit, centré verticalement */
#total-offres {
    font-size: 20px; /* Taille réduite pour qu'il ne soit pas trop grand */
    font-weight: bold;
    color: #0073aa;
    display: inline-block;
    vertical-align: middle;
    line-height: 40px; /* Centrer verticalement par rapport aux filtres */
}



    .text-green {
        color: green;
    }

    .text-red {
        color: red;
    }



.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
    text-transform: capitalize;
}

.status-publiee { background-color: #28a745; }      /* verte */
.status-programmee { background-color: #17a2b8; }    /* bleue */
.status-archivee { background-color: #6c757d; }      /* grise */
.status-refusee { background-color: #dc3545; }       /* rouge */
.status-en-attente { background-color: #ffc107; color: #333; } /* jaune */




/* =========================
   Styles Offres de Stage Front Office
   ========================= */

/* Zone de recherche */
.stages-manager2 .search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
}

.stages-manager2 .search-container input[type="text"] {
    padding: 12px 18px;
    font-size: 16px;
    border-radius: 25px !important;
    border: 1px solid #ccc !important;
    background-color: #fff !important;
    height: 45px;
    width: 100%;
    box-shadow: none !important;
    outline: none !important;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Effet focus pour la zone de recherche */
.stages-manager2 .search-container input[type="text"]:focus {
    border-color: #2EA3F2 !important;
    background-color: #f9f9f9 !important;
}

/* Filtres */
.stages-manager2 #stages-filters2 {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
}
.stages-manager2 #stages-filters2 > * {
    flex: 1 1 0;
    min-width: 120px;
    max-width: 220px;
}

/* Style des filtres (input et select) du FRONT harmonisé avec le back-office */
.stages-manager2 #stages-filters2 select {
    border-radius: 25px !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 8px 36px 8px 16px; /* espace à droite pour la flèche */
    font-size: 16px;
    height: 40px;
    min-width: 200px;
    box-shadow: none !important;
    outline: none !important;
    transition: all 0.3s ease;
    line-height: 1.2;
    white-space: nowrap;
    padding-right: 36px; /* espace pour la flèche */
    position: relative;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='18' viewBox='0 0 24 24' width='18' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}

/* Pour éviter le texte rogné */
.stages-manager2 #stages-filters2 select option {
    line-height: 1.5;
}

/* Hover et focus pour les filtres */
.stages-manager2 #stages-filters2 input:hover,
.stages-manager2 #stages-filters2 select:hover {
    background-color: #f1f1f1;
    border-color: #888;
}

.stages-manager2 #stages-filters2 input:focus,
.stages-manager2 #stages-filters2 select:focus {
    border-color: #2EA3F2;
    background-color: #eaf6fe;
    box-shadow: 0 0 5px rgba(46, 163, 242, 0.5);
}

/* Mobile : retour à flex-wrap: wrap */
@media (max-width: 700px) {
    .stages-manager2 #stages-filters2 {
        flex-wrap: wrap;
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
    }
    .stages-manager2 #stages-filters2 > * {
        width: 48%;
        min-width: 0;
        margin-bottom: 10px;
        flex: 1 1 48%;
    }
}
/* Cartes de stages */
.stages-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}
.stage-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.stage-card:hover {
    transform: translateY(-5px);
}
.stage-image {
    height: 150px;
    background-size: cover;
    background-position: center;
    object-fit: cover;
}
.stage-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.stage-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
}
.stage-entreprise, .stage-duree {
    margin-left: 15px;
    margin-right: 15px;
}
.custom-badge {
    color: #2EA3F2;
    border: 2px solid #2EA3F2;
    padding: 8px 12px;
    display: inline-block;
    border-radius: 20px;
    font-size: 12px;
    line-height: 0.2;
    margin: 5px 10px;
}

/* Popup */
#stage-popup {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}
#popup-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    position: relative;
    border-radius: 15px;
}
#close-popup {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 2em;
    color: #888;
    cursor: pointer;
    z-index: 10;
}
#close-popup:hover,
#close-popup:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#retour-infos-offre {
    background: #eaf6ff;
    color: #0073aa;
    border: none;
    border-radius: 25px;
    padding: 10px 24px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s, color 0.2s;
}
#retour-infos-offre:hover {
    background: #d0eaff;
    color: #005f8d;
}

@media (max-width: 600px) {
    #popup-content {
        width: 98vw;
        padding: 10px;
        border-radius: 8px;
    }
    #stage-popup {
        align-items: flex-start;
        padding-top: 30px;
    }
}
.stages-manager2 .search-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
}

.stages-manager2 .search-container .fa-search {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
}

.stages-manager2 .search-container input[type="text"] {
    padding-left: 44px !important; /* espace pour la loupe */
}



#total-subscribers {
    font-size: 20px;
    font-weight: bold;
    color: #0073aa;
    display: inline-block;
    vertical-align: middle;
    line-height: 40px;
}

.subscribers-manager .button {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 8px !important; /* Optionnel : réduit l'espace autour de l'icône */
}





/* Design moderne pour les boutons d'action */
.previsu-actions .button {
    border-radius: 25px !important;
    padding: 10px 24px !important;
    font-size: 1em !important;
    border: none !important;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s !important;
    text-decoration: none !important;
    display: inline-block !important;
    margin-right: 10px;
}

.previsu-actions .button-primary {
    background: #0073aa !important;
    color: #fff !important;
}
.previsu-actions .button-primary:hover {
    background: #005f8d !important;
    color: #fff !important;
}

.previsu-actions .button-delete {
    background: #ffeaea !important;
    color: #d9534f !important;
}
.previsu-actions .button-delete:hover {
    background: #ffd6d6 !important;
    color: #b52b27 !important;
}

.previsu-actions .button-view {
    background: #eaf6ff !important;
    color: #0073aa !important;
}
.previsu-actions .button-view:hover {
    background: #d0eaff !important;
    color: #005f8d !important;
}

/* Bouton "Postuler" */
#postuler-button {
    background: #0971B8;
    color: #fff;
    border-radius: 25px;
    padding: 10px 24px;
    border: none;
    font-size: 1em;
    cursor: pointer;
    margin: 20px auto;
    display: block;
    transition: background 0.2s;
    width: auto;
}
#postuler-button:hover {
    background: #005f8d;
}

/* Bouton "Envoyer candidature" */
#envoyer-candidature {
    background: #0971B8;
    color: #fff;
    border-radius: 25px;
    padding: 10px 24px;
    border: none;
    font-size: 1em;
    cursor: pointer;
    margin: 20px auto 0 auto;
    display: block;
    transition: background 0.2s;
    width: auto;
}
#envoyer-candidature:hover {
    background: #005f8d;
}

/* Alignement des bouttons actions */    

.actions-cell {
    white-space: nowrap;
}
.actions-cell .button {
    margin-right: 6px;
    margin-bottom: 0 !important;
    vertical-align: middle;
}


.previsu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.previsu-actions .button {
    margin-right: 0;
}


/* Harmonisation des colonnes du tableau des offres */
.stages-manager table th,
.stages-manager table td {
    /* Largeur automatique par défaut, sauf exceptions ci-dessous */
    white-space: nowrap;
    vertical-align: middle;
}

/* Titre : colonne la plus large */
.stages-manager table th:nth-child(1),
.stages-manager table td:nth-child(1) {
    width: 28%;
    min-width: 180px;
    white-space: normal; /* Permet le retour à la ligne si besoin */
}

/* Entreprise : deuxième plus large */
.stages-manager table th:nth-child(2),
.stages-manager table td:nth-child(2) {
    width: 22%;
    min-width: 120px;
    white-space: normal;
}

/* Catégorie */
.stages-manager table th:nth-child(3),
.stages-manager table td:nth-child(3) {
    width: 14%;
    min-width: 90px;
}

/* Statut */
.stages-manager table th:nth-child(4),
.stages-manager table td:nth-child(4) {
    width: 12%;
    min-width: 80px;
    text-align: center;
}

/* Consultations : étroite mais assez large pour le mot complet */
.stages-manager table th:nth-child(5),
.stages-manager table td:nth-child(5) {
    width: 110px;
    min-width: 100px;
    max-width: 130px;
    text-align: center;
    padding-left: 0;
    padding-right: 0;
    white-space: nowrap;
}

/* Actions : largeur fixe pour aligner les boutons */
.stages-manager table th:nth-child(6),
.stages-manager table td:nth-child(6) {
    width: 180px;
    min-width: 150px;
    text-align: center;
    white-space: nowrap;
}


.fa, .fa-solid, .fa-regular, .fa-light, .fa-thin, .fa-duotone, .fa-brands {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal;
    font-size: 18px !important;
    vertical-align: middle;
}



/* Harmonisation des colonnes pour la page gestion des candidatures */
#candidatures-table th,
#candidatures-table td,
#candidatures-table-nonretenue th,
#candidatures-table-nonretenue td {
    white-space: nowrap;
    vertical-align: middle;
    padding: 12px;
}

/* Offre */
#candidatures-table th:nth-child(1),
#candidatures-table td:nth-child(1),
#candidatures-table-nonretenue th:nth-child(1),
#candidatures-table-nonretenue td:nth-child(1) {
    width: 22%;
    min-width: 140px;
    white-space: normal;
}

/* Entreprise */
#candidatures-table th:nth-child(2),
#candidatures-table td:nth-child(2),
#candidatures-table-nonretenue th:nth-child(2),
#candidatures-table-nonretenue td:nth-child(2) {
    width: 18%;
    min-width: 100px;
    white-space: normal;
}

/* Nom */
#candidatures-table th:nth-child(3),
#candidatures-table td:nth-child(3),
#candidatures-table-nonretenue th:nth-child(3),
#candidatures-table-nonretenue td:nth-child(3) {
    width: 13%;
    min-width: 80px;
}

/* Prénom */
#candidatures-table th:nth-child(4),
#candidatures-table td:nth-child(4),
#candidatures-table-nonretenue th:nth-child(4),
#candidatures-table-nonretenue td:nth-child(4) {
    width: 13%;
    min-width: 80px;
}


/* Actions */
#candidatures-table th:nth-child(7),
#candidatures-table td:nth-child(7),
#candidatures-table-nonretenue th:nth-child(7),
#candidatures-table-nonretenue td:nth-child(7) {
    width: 14%;
    min-width: 110px;
    text-align: center;
    white-space: nowrap;
}

/* pop-up  candidatures */
/* Responsive pour le pop-up candidature */
.candidature-modal-outer {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}
.candidature-modal-inner {
    background: #fff;
    margin: 40px 0 0 0;
    padding: 32px 48px;
    max-width: 1500px;
    width: 98vw;
    min-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}
.candidature-modal-cvlettre {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    height: calc(100vh - 320px);
    min-height: 320px;
}
.candidature-modal-cvlettre > div {
    flex: 1 1 320px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}
.candidature-modal-cvlettre iframe {
    flex: 1 1 auto;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 8px;
    min-height: 200px;
    height: 100%;
    max-height: 100%;
}

/* Responsive : mobile/tablette */
@media (max-width: 1100px) {
    .candidature-modal-inner {
        padding: 18px 2vw;
        max-width: 99vw;
        width: 99vw;
    }
    .candidature-modal-cvlettre {
        flex-direction: column;
        height: auto;
        gap: 18px;
    }
    .candidature-modal-cvlettre > div {
        min-width: 0;
    }
    .candidature-modal-cvlettre iframe {
        min-height: 220px;
        height: 45vw;
        max-height: 60vw;
    }
    .previsu-actions {
        flex-wrap: wrap;
        gap: 8px;
        padding-right: 0 !important;
    }
}
@media (max-width: 600px) {
    .candidature-modal-inner {
        padding: 8px 0;
        max-width: 100vw;
        width: 100vw;
        border-radius: 0;
    }
    .candidature-modal-cvlettre iframe {
        min-height: 160px;
        height: 38vw;
        max-height: 50vw;
    }
    .previsu-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
    }
}

/* Bouton de téléchargement */

.button-download {
    background: #eaf6ff !important;
    color: #0073aa !important;
    border-radius: 50% !important;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    border: none !important;
    cursor: pointer;
    font-size: 1em !important;
    box-sizing: border-box;
}

.button-download .fa-download {
    font-size: 14px !important;
    color: #0073aa !important;
    transition: color 0.2s;
    display: inline-block !important;
}

.button-download:hover,
.button-download:focus {
    background: #0073aa !important;
    color: #fff !important;
}

.button-download:hover .fa-download,
.button-download:focus .fa-download {
    color: #fff !important;
}