/* =========================
   BASE STYLES
========================= */
:root {
    --primary-color: #1e90a2;
    --secondary-color: #fcce28;
    --success-color: #54d558;
    --danger-color: #dc3545;
    --light-color: #f5f7fa;
    --dark-color: #333;
    --gray-color: #888;
    --border-color: #b6c6c4;
    --shadow: 0 2px 10px rgba(0,0,0,0.05);
}

* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}


/* =========================
   SCROLLBAR STYLES
========================= */

/* Appliquer à toute la page */
html {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #6e7b7d #e1e6e3; /* Gris moyen et gris très clair pour le fond */
}

/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #e1e6e3; /* Gris très clair */
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background-color: #6e7b7d; /* Gris moyen */
  border-radius: 5px;
  border: 2px solid #ffffff; /* Bord blanc pour un contraste léger */
}

::-webkit-scrollbar-thumb:hover {
  background-color: #a3b0b1; /* Gris clair au survol */
}



/* =========================
   UTILITY CLASSES
========================= */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* =========================
   404 PAGE
========================= */

.error-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.error-content {
    max-width: 600px;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.error-message {
    margin-bottom: 2rem;
    color: #666;
}

.error-image {
    max-width: 300px;
    margin: 0 auto 2rem;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

footer {
    text-align: center;
    padding: 1.5rem;
    background-color: white;
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .error-code {
        font-size: 4rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .error-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* =========================
   LAYOUT
========================= */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    padding: 30px;
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 250px;
    background: var(--primary-color);
    color: white;
    padding: 20px 0;
    transition: width 0.3s;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

nav ul {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    transition: all 0.3s;
}

nav li a:hover {
    background: rgba(255,255,255,0.1);
}

nav li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

nav li.active a {
    background: rgba(255,255,255,0.2);
    border-left: 3px solid var(--secondary-color);
}

/* =========================
   HEADER
========================= */
header {
    background: white;
    padding: 3%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

header h1 {
    color: var(--dark-color);
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s;
}

.user-info i {
    font-size: 1.5rem;
    color: var(--gray-color);
}

/* =========================
   CARDS
========================= */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
}

.card h2 {
    margin-top: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.card h2 .icon {
    margin-right: 10px;
    color: var(--secondary-color);
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* =========================
   BUTTONS
========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    gap: 5px;
}

.btn i {
    font-size: 0.9em;
}

.btn-add {
    background: #54d558;
    color: white;
}

.btn-add:hover {
    background: #3dc242;
}

.btn-manage {
    background: var(--primary-color);  /* Nouvelle couleur bleu foncé */
    color: white;
}

.btn-manage:hover {
    background: #167d8f;  /* Couleur légèrement plus claire au survol */
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #167d8f;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--dark-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #3dc242;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}


.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* === Styles spécifiques à preview_formation === */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(35%, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.form-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.form-section.full-width {
    grid-column: 1 / -1;
}

.section-title {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

/* === Boutons dans la modal === */
.modal-actions .btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.modal-actions .btn-danger:hover {
    background-color: #bd2130;
}

.modal-actions .btn-secondary {
    background-color: #e2e6ea;
    color: #333;
}

.modal-actions .btn-secondary:hover {
    background-color: #d6d8db;
}

/* =========================
   USER DASHBOARD STYLES
========================= */
.user-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.user-welcome-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-left: 5px solid #1e90a2;
}

.user-welcome-card h2 {
    color: #1e90a2;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.user-organisme {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: #333;
}

.user-organisme i {
    color: #1e90a2;
}

.user-organisme.warning {
    color: #ce5b5b;
}

.user-organisme.warning i {
    color: #ce5b5b;
}

.user-formations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.user-formations-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.user-formation-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.user-formation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.user-formation-header {
    padding: 20px;
    height: 18vh;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Ajout des styles pour gérer l'overflow */
.user-formation-header h3 {
    margin: 0;
    font-size: 1.3rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;         /* Limite à 2 lignes */
    line-clamp: 2;                 /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;              /* Cache le contenu qui dépasse */
    text-overflow: ellipsis;       /* Ajoute les points de suspension */
    word-break: break-word;        /* Permet la coupure des mots longs */
    padding-right: 15px;           /* Espace pour éviter que l'ellipsis ne touche le type */
    min-height: 3.2em;             /* Hauteur minimale pour 2 lignes */
    line-height: 1.6;             /* Espacement des lignes */
}

.user-formation-type {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 15px;
    flex-shrink: 0;            /* Empêche le badge de se rétrécir */
}

.user-formation-type.initiale {
    background: #32caf1;
}

.user-formation-type.continue {
    background: var(--success-color);
}

.user-formation-details {
    padding: 20px;
    flex-grow: 1;
}

.user-formation-details p {
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
}

.user-formation-details i {
    width: 20px;
    color: #1e90a2;
    text-align: center;
}

.user-formation-status {
    padding: 0 20px 15px;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.valide {
    background: #d4edda;
    color: #155724;
}

.status-badge.en_attente {
    background: #fff3cd;
    color: #856404;
}

.user-formation-actions {
    display: flex;
    border-top: 1px solid #eaeaea;
    padding: 15px;
    gap: 10px;
}

.user-formation-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-edit {
    background: #1e90a2;
    color: white;
}

.btn-edit:hover {
    background: #167d8f;
}

.user-no-formations {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.user-no-formations img {
    max-width: 200px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.user-no-formations h3 {
    color: #1e90a2;
    margin-bottom: 10px;
}

.user-no-formations p {
    color: #666;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Styles pour la carte d'avertissement */
.warning-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.warning-popup.show {
    opacity: 1;
}

.warning-popup-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.warning-popup.show .warning-popup-content {
    transform: translateY(0);
}

.warning-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.warning-popup-header i {
    color: #f0ad4e;
    font-size: 24px;
}

.warning-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.warning-popup p {
    margin: 0 0 20px;
    color: #666;
    line-height: 1.5;
}

.warning-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.warning-popup-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warning-popup-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.warning-popup-actions .btn-primary {
    background: #1e90a2;
    color: white;
}

.warning-popup-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-associate {
    background-color: #1e90a2;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    border: none;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-associate:hover {
    background-color: #167385;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-associate i {
    font-size: 1.1em;
}


/* Responsive */
@media (max-width: 768px) {
    .user-formations-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .user-formations-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .card-header, .form-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* =========================
   TABLES
========================= */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: auto; /* Plus flexible */
    overflow-x: auto;
    display: block; /* Permet scroll horizontal si nécessaire */
    max-width: 100%;
}

.table th, .table td {
    border: 1px solid #ccc;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    /* overflow caché supprimé pour permettre retour à la ligne */
    white-space: normal; /* Permet le wrap */
    word-wrap: break-word; /* Casse les mots longs */
    text-overflow: clip; /* Pas d’ellipse ici */
    vertical-align: top;
}

.table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.table tr:hover {
    background-color: #f1f1f1;
}

.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

/* Suppression des largeurs fixes pour laisser la table s’adapter */


/* Colonnes petites */

.table th:nth-child(1),
.table td:nth-child(1) {
    width: 6%;
}  /* ID */

.table th:nth-child(7),
.table td:nth-child(7), /* État */
.table th:nth-child(3),
.table td:nth-child(3) { /* Type */
    width: 17%;
}

.table th:nth-child(5),
.table td:nth-child(5),  /* Prix */
.table th:nth-child(6),
.table td:nth-child(6) { /* Label */
    width: 12%;
}

/* Colonne Nom large */
.table th:nth-child(2),
.table td:nth-child(2) {
    width: 33%;
}

/* Colonnes restantes (Type, Organisme, État, Actions) partagent le reste */
 /* Type */
.table th:nth-child(4),
.table td:nth-child(4), /* Organisme */
.table th:nth-child(8){ /* Actions */
    width: 20%; /* 46% divisé par 4 */
}

/* =========================
   FORMULAIRES
========================= */
.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.text-center {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 30px;
}

.form-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease-in-out;
}

.form-card:hover {
    transform: translateY(-2px);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary-color);
    font-size: 15px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 6px rgba(30, 144, 162, 0.2);
    outline: none;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}


/* === BOUTON ÉTAT uniforme === */
.etat-btn {
    display: inline-block;
    width: 140px;
    text-align: center;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
}

.etat-btn[data-state="valide"] {
    background-color: var(--success-color);
}

.etat-btn[data-state="en_attente"] {
    background-color: var(--primary-color);
}

/* =========================
   FORMULAIRE STEP
========================= */

/* Styles spécifiques au formulaire */
.form-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.form-stepper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e0e0e0;
    z-index: 1;
    transform: translateY(-50%);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background-color: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background-color: var(--success-color);
    color: white;
}

.step-label {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--dark-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-title {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 0;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.add-more-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    margin-top: 10px;
}

.required-field::after {
    content: " *";
    color: var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-stepper {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .form-stepper::before {
        display: none;
    }
}


/* =========================
   PROFILE - STYLES SPÉCIFIQUES
========================= */
.profile-container {
    max-width: 80%;
    margin: 40px auto;
    font-family: 'Poppins', sans-serif;
}

.profile-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 30px;
    transition: all 0.3s ease-in-out;
}

.profile-form:hover {
    transform: translateY(-2px);
}

.profile-form .form-group {
    margin-bottom: 24px;
}

.profile-form .form-group label {
    display: block;
    font-weight: bold;
    color: #1e90a2;
    margin-bottom: 8px;
    font-size: 1rem;
}

.organisme-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.profile-form .form-group input[type="text"],
.profile-form .form-group input[type="email"],
.profile-form .form-group input[type="password"],
.profile-form .form-group input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    background-color: #fefefe;
    transition: border 0.3s, box-shadow 0.3s;
}

.profile-form .form-group input:focus {
    border-color: #1e90a2;
    box-shadow: 0 0 0 3px rgba(30, 144, 162, 0.1);
    outline: none;
}

.profile-form small {
    color: #888;
    font-size: 13px;
    margin-top: 4px;
    display: inline-block;
}

.profile-form .btn {
    background-color: #1e90a2;
    color: white;
    border: none;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.profile-form .btn:hover {
    background-color: #167e8c;
}

.password-toggle {
    cursor: pointer;
    color: #1e90a2;
    font-size: 14px;
    margin-top: 5px;
    display: inline-block;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #167e8c;
}

/* Styles pour la photo de profil dans le formulaire */
.profile-picture {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid #1e90a2;
    object-fit: cover;
}


.default-picture {
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.default-picture i {
    font-size: 3em;
    color: #888;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 25px; /* augmente le gap pour aérer */
    flex-wrap: wrap;
}


.custom-file-upload,
.btn-reset-photo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-file-upload {
    background-color: #f0f0f0;
    padding: 8px 14px; /* plus petit */
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ccc;
    transition: background-color 0.3s;
}

.custom-file-upload:hover {
    background-color: #e0e0e0;
}

.custom-file-upload {
    margin: 0 !important;
}

.form-group small {
    margin-top: 1.2em;
}


.photo-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}


input[type="file"] {
    display: none;
}
.btn-reset-photo {
    background-color: #1e90a2;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-reset-photo:hover {
    background-color: #167e8c;
}

/* Styles pour la sélection d'organisme */
.organismes-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.organisme-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.organisme-item:last-child {
    border-bottom: none;
}

.organisme-item input[type="radio"] {
    margin-right: 15px;
}

.organisme-item label {
    flex: 1;
    margin-bottom: 0;
    cursor: pointer;
}

.form-actions {
    text-align: center;
    margin-top: 20px;
}

.separator {
    margin: 15px 0;
    font-weight: bold;
    text-align: center;
}

.organisme-info-profile {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}


/* =========================
   LOGIN/REGISTER PAGES
========================= */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.auth-container h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

.links {
    margin-top: 1.5rem;
    text-align: center;
}

.links a {
    color: var(--primary-color);
    font-weight: 500;
}

/* =========================
   FLASH MESSAGES
========================= */

/* Flash Popup */
.flash-popup-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* pour pouvoir cliquer à travers le conteneur */
}

.flash-popup {
    min-width: 250px;
    max-width: 400px;
    padding: 15px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;

    /* ANIMATION: fade in puis fade out */
    animation: flashLife 5s forwards;

    /* Active les clics pendant l'affichage */
    pointer-events: auto;
}

/* Animation combinée fadein + fadeout */
@keyframes flashLife {
    0% {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: auto;
    }
    10% {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    80% {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
    }
}

.flash-popup.fade-out {
    pointer-events: none !important;
    animation: fadeout 0.5s forwards;
    position: absolute !important; /* facultatif : la popup n’occupe plus d’espace */
}
.flash-popup-container:empty {
    display: none;
}

/* Animation keyframes */
@keyframes fadein {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeout {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* Close button */
.flash-popup .close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 16px;
    pointer-events: auto; /* Assure que le bouton de fermeture est cliquable */
}

/* Color variants */
.flash-success {
    background-color: #28a745;
}

.flash-danger {
    background-color: #dc3545;
}

.flash-info {
    background-color: #17a2b8;
}


.flash-messages {
    margin-bottom: 1rem;
}
.flash-message {
    padding: 0.5rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}
.flash-message.success {
    background-color: #d4edda;
    color: #155724;
}
.flash-message.danger {
    background-color: #f8d7da;
    color: #721c24;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-box {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    position: fixed;          /* IMPORTANT */
    top: 50%;                 /* Position verticale au centre */
    left: 50%;                /* Position horizontale au centre */
    transform: translate(-50%, -50%); /* Décalage pour centrage exact */
    /* On retire le display flex et flex-direction */
    /* display: flex; */
    /* flex-direction: column; */
    gap: 1.5rem;
}


@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-box h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.3rem;
    text-align: center;
}

.modal-box textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    resize: none;
    min-height: 100px;
    transition: border-color 0.3s;
    margin-bottom: 15px;
}

.modal-box textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

/* Pour les petits écrans */
@media (max-width: 576px) {
    .modal-box {
        padding: 1.5rem;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-buttons .btn {
        width: 100%;
    }
}

/* =========================
   CARTE PAGE
========================= */
#container {
    position: relative;
    height: 100vh;
    width: 100%;
    transition: all 0.5s ease; /* animation fluide sur l'ensemble */
}

#map {
    height: 100%;
    width: 100%;
}

.user-info {
    max-width: 100%;
    overflow: hidden;
}

.user-name {
    display: inline-block;
    max-width: 20ch; /* correspond à environ 30 caractères */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}



/* Formations list */
#formations-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 350px;
    height: 100%;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(0);
    transition: transform 0.5s ease;
}

/* Si container a la classe collapsed → on décale la liste */
#container.collapsed #formations-list {
    transform: translateX(-100%);
}


.formation-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    background-color: white;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.formation-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.organisme-name {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 15px;
}

.formation-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    font-size: 17px;
}

.formation-details {
    font-size: 13px;
    color: var(--gray-color);
    margin-bottom: 5px;
}

.formation-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
}

.type-initiale {
    background-color: #32caf1;
    color: white;
}

.type-continue {
    background-color: var(--success-color);
    color: white;
}

.list-header {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

/* Effet lorsque la liste est cachée */
#formations-list.hidden + .toggle-btn i {
    transform: rotate(180deg); /* Rotation de 180° */
}

/* Toggle Button */
.toggle-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.5s ease, background-color 0.3s ease, width 0.3s ease;
    left: 350px;
}

.toggle-btn:hover {
    background-color: var(--secondary-color);
    width: 28px;
}


/* Quand la liste est repliée, le bouton se déplace à gauche */
#container.collapsed .toggle-btn {
    left: 0;
    border-radius: 8px 0 0 8px;
}

/* Rotation de l’icône */
.toggle-btn i {
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--dark-color);
    font-weight: 500;
}

.user-info i {
    font-size: 20px;
    color: var(--primary-color);
}

.header-links {
    display: flex;
    gap: 10px;
}

.header-btn {
    background-color: var(--primary-color);
    color: white;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.header-btn.logout {
    background-color: var(--danger-color);
}

.header-btn:hover {
    opacity: 0.9;
}

/* =========================
   CHARGEMENT
========================= */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #1e90a2;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-screen.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
}

/* =========================
   POPUPS MAP
========================= */

.popup-container {
    font-family: 'Poppins', sans-serif;
    max-width: 280px;
    padding: 15px;
}

.popup-title {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.popup-info {
    margin-bottom: 15px;
    font-size: 14px;
}

.popup-info p {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;            /* Cache le texte qui dépasse */
    text-overflow: ellipsis;     /* Ajoute les "..." */
    white-space: nowrap;         /* Empêche le retour à la ligne */
}


.popup-info i {
    width: 16px;
    color: var(--primary-color);
    text-align: center;
}

.popup-formations-count {
    background-color: #f5f7fa;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
}

.popup-button {
    display: block;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}
.leaflet-popup-content a {
    color: white;
    text-decoration: none;
}

.leaflet-popup-content a[href^="mailto:"] {
    color: black;
}


.popup-button:hover {
    background-color: #167d8f;
    color: white;
}

.popup-button i {
    margin-right: 8px;
}

/* =========================
   Formations Map - Modern UI
========================= */

/* Conteneur principal */
.formation-details-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 24px;
}

/* Bouton retour modernisé */
.btn-retour {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--primary-color);
    font-weight: 500;
    border: 2px solid var(--primary-color);
    padding: 10px 18px;
    border-radius: 12px;
    transition: 0.3s ease all;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 2%;
}

.btn-retour:hover {
    background-color: var(--primary-color);
    color: white;
}

/* En-tête de la formation */
.formation-header {
    background-color: #ffffff;
    border-radius: 28px;
    padding: 48px;
    margin-bottom: 50px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.formation-header h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 24px;
}

/* Présentation organisme */
.organisme-presentation {
    font-size: 1.125rem;
    line-height: 1.9;
    color: #44525c;
    margin: 30px 0;
    padding: 30px;
    background-color: #f9fbfc;
    border-radius: 20px;
    border-left: 5px solid var(--primary-color);
}

/* Grille d'information */
.organisme-info {
    margin-top: 35px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.organisme-info p {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f1f6f8;
    padding: 18px;
    border-radius: 14px;
    font-size: 1rem;
    transition: all 0.25s ease;
}

.organisme-info p:hover {
    background: #eaf3f6;
    transform: translateY(-3px);
}

.organisme-info i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Liens */
.organisme-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: 0.3s;
}

.organisme-info a:hover {
    text-decoration: underline;
    color: #167d8f;
}

/* Section Formations */
.formations-list h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--secondary-color);
    color: var(--primary-color);
}


/* =========================
   FORMATIONS INFORMATIONS
========================= */

.formation-card {
    background: white;
    border: none;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}

.formation-card:hover {
    transform: translateY(-5px);
}

/* En-tête des cartes */
.formation-card-header {
    background: var(--primary-color);
    color: white;
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.formation-card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Badge type */
.formation-type {
    padding: 6px 14px;
    font-size: 0.75rem;
    border-radius: 50px;
    background: #ffffff33;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
}

.type-initiale {
    background-color: #32caf1;
}

.type-continue {
    background-color: var(--success-color);
}

/* Corps de la carte */
.formation-card-body {
    padding: 28px;
}

.formation-details p {
    font-size: 1rem;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.7;
}

/* Métadonnées */
.formation-meta {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}

.formation-meta li {
    font-size: 0.9rem;
    color: #6a6a6a;
    margin-bottom: 8px;
}

/* Bouton inscription */
.inscription-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 14px 28px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-top: 12px;
}

.inscription-button:hover {
    background-color: #167d8f;
}

/* Responsive */
@media (max-width: 768px) {
    .formation-header {
        padding: 30px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .formation-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

.formation-type-container {
    display: flex;
    gap: 15px;
    align-items: center;
}

.formation-certification {
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.formation-certification i {
    color: #ffd700;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.description-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.labels-section {
    margin: 20px 0;
}

.labels-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.label-badge {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
}

.inscription-container {
    margin-top: 25px;
    text-align: center;
}

.formation-details p {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.formation-details i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
    margin-top: 4px;
}

/* =========================
   SEARCH & FILTERS STYLES
========================= */
.search-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-bar {
    flex: 1;
    position: relative;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    padding: 0 15px;
    height: 50px;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.search-icon {
    color: #6e7b7d;
    font-size: 16px;
    margin-right: 10px;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    padding: 12px 0;
    background: transparent;
}

.search-actions {
    display: flex;
    align-items: center;
}

.search-action-btn {
    background: none;
    border: none;
    color: #6e7b7d;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-action-btn:hover {
    background: #f0f0f0;
    color: #1e90a2;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover {
    background: #f5f7fa;
}

.suggestion-icon {
    margin-right: 10px;
    color: #1e90a2;
    font-size: 14px;
}

.suggestion-text {
    flex: 1;
}

.suggestion-type {
    font-size: 12px;
    color: #6e7b7d;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

.filter-toggle-btn {
    background: white;
    border: none;
    border-radius: 30px;
    padding: 0 20px;
    height: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1e90a2;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    background: #f5f7fa;
    color: #167d8f;
}

.filter-toggle-btn i {
    font-size: 16px;
}

.filters-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    padding: 20px;
    overflow-y: auto;
    transition: right 0.3s ease;
}

.filters-panel.active {
    right: 0;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.filters-header h3 {
    margin: 0;
    color: #1e90a2;
    font-size: 18px;
}

.close-filters-btn {
    background: none;
    border: none;
    color: #6e7b7d;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-filters-btn:hover {
    background: #f0f0f0;
    color: #1e90a2;
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 20px;
}

.filter-group-organisme {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 0 auto;
}

.filter-group-organisme label {
    margin-bottom: 0;
    font-weight: 500;
    white-space: nowrap;
    min-width: 50px;
}

.reset-filters {
    margin-left: auto;
    white-space: nowrap;
}

.filter-title {
    font-size: 15px;
    margin:5% 0 2% 0;
    color: #333;
    font-weight: 600;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 30px;
    margin-bottom: 5px;
}

.filter-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid #b6c6c4;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.filter-checkbox:hover input ~ .checkmark {
    border-color: #1e90a2;
}

.filter-checkbox input:checked ~ .checkmark {
    background-color: #1e90a2;
    border-color: #1e90a2;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.filter-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-label {
    margin-left: 10px;
    font-size: 14px;
    color: #333;
}

.type-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
    color: white;
}

.type-badge.initiale {
    background-color: #32caf1;
}

.type-badge.continue {
    background-color: #54d558;
}

.filter-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #b6c6c4;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    background-color: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.filter-select:focus {
    outline: none;
    border-color: #1e90a2;
    box-shadow: 0 0 0 3px rgba(30, 144, 162, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: flex-end;
}


/* Dans la section des filtres */
.price-filters {
    display: flex;
    gap: 10px;
}

.price-input {
    flex: 1;
}

.price-input label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.price-input input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #b6c6c4;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    background-color: white;
    transition: all 0.3s ease;
}

.price-input input:focus {
    outline: none;
    border-color: #1e90a2;
    box-shadow: 0 0 0 3px rgba(30, 144, 162, 0.1);
}

.price-input input::placeholder {
    color: #b6c6c4;
}

/* Pour gérer le spin button des inputs number */
.price-input input[type="number"]::-webkit-inner-spin-button,
.price-input input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    gap: 8px;
}

.btn-primary {
    background-color: #1e90a2;
    color: white;
}

.btn-primary:hover {
    background-color: #167d8f;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #1e90a2;
    color: #1e90a2;
}

.btn-outline:hover {
    background-color: #f0f8fa;
}

/* Overlay pour les filtres */
.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.filters-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* =========================
   TABLE STYLES (edit_formations, edit_organismes)
========================= */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 15px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 250px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(30, 144, 162, 0.2);
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--gray-color);
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.table-input, .table-select, .table-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.table-input:focus, .table-select:focus, .table-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(30, 144, 162, 0.2);
}

.table-textarea {
    min-height: 80px;
    resize: vertical;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-details, .btn-save, .btn-delete{
    padding: 10px 10px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-details {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-details:hover {
    background-color: #167d8f;
}

.btn-save {
    background-color: var(--success-color);
    color: white;
    border: none;
}

.btn-save:hover {
    background-color: #3dc242;
}

.details-row {
    background-color: #f9f9f9;
}

.details-container {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.details-container .form-group {
    margin-bottom: 0;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

#itemsPerPage, #itemsPerPageOrganismes, #itemsPerPageFormations {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
    font-family: 'Poppins', sans-serif;
}

.modal-box p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.modal-buttons .btn {
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-buttons .btn-secondary {
    background: #ddd;

}

.etat-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reason-link {
    font-size: 0.8em;
    margin-top: 5px;
}

.reason-link a {
    color: #666;
    text-decoration: underline;
    cursor: pointer;
}

/* Tooltip pour la raison */
.etat-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    white-space: nowrap;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        width: 95%;
        top: 10px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .filter-toggle-btn {
        width: 100%;
        justify-content: center;
    }
    
    .filters-panel {
        width: 85%;
        right: -100%;
    }
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .details-container {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .pagination-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-picture {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .auth-container {
        padding: 1.5rem;
    }
}

/* Styles du formulaire de profil */
.danger-zone {
    margin-top: 2.5rem !important;
    padding: 1.5rem;
    border: 2px solid #dc3545;
    border-radius: 8px;
    background-color: #fff5f5;
}

.danger-zone h3 {
    color: #dc3545;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.danger-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.btn-danger-outline {
    color: white;
    background-color: #dc3545;
    border: 2px solid #dc3545;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    display: inline-flex;
    justify-content: center;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-danger-outline:hover {
    background-color: #c82333;
    color: white;
}

.btn-danger-outline i {
    font-size: 0.9rem;
}

/* Modifier les styles pour organisme-info */
.organisme-info {
    width: 100%;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.organisme-info p {
    margin: 0;
    line-height: 1.6;
    width: 100%;
}

.organisme-info p strong {
    color: var(--primary-color);
    font-size: 1.1em;
    display: block;
    margin-bottom: 8px;
}

.organisme-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.organisme-buttons .btn {
    flex: 1;
    justify-content: center;
    min-width: 150px;
    /* Supprimer max-width pour permettre une expansion complète */
}

/* Style pour les infos de l'organisme */
.organisme-info p br {
    display: block;
    margin: 5px 0;
}

.organisme-info p span {
    display: block;
    margin: 5px 0;
}

/* =========================
   SUPPORT STYLES
========================= */

/* Support Page Styles */
.support-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.support-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.support-header {
    text-align: center;
    margin-bottom: 30px;
}

.support-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.support-header h2 {
    color: var(--dark-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.support-header p {
    color: #666;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.support-form {
    max-width: 600px;
    margin: 0 auto;
}

.priority-options {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.priority-option {
    flex: 1;
    cursor: pointer;
}

.priority-option input {
    display: none;
}

.priority-label {
    display: block;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.priority-option input:checked + .priority-label {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.priority-label.low {
    border-color: #28a745;
}

.priority-label.medium {
    border-color: #ffc107;
}

.priority-label.high {
    border-color: #dc3545;
}

.priority-option input:checked + .priority-label.low {
    background: #28a745;
}

.priority-option input:checked + .priority-label.medium {
    background: #ffc107;
}

.priority-option input:checked + .priority-label.high {
    background: #dc3545;
}

.char-count {
    float: right;
    font-size: 12px;
    color: #666;
}

.support-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.info-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.info-card p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    
    .content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px 0;
    }
    
    nav ul {
        display: flex;
        overflow-x: auto;
    }
    
    nav li {
        flex-shrink: 0;
    }
    
    nav li a {
        padding: 10px 15px;
    }
    
    .content {
        padding: 15px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    #formations-list {
        width: 280px;
    }
    
    .toggle-btn {
        left: 280px;
    }
}

@media (max-width: 576px) {
    header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-picture {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .auth-container {
        padding: 1.5rem;
    }
}

/* Styles pour le récapitulatif */
.summary-container {
    border: 1px solid #e0e0e0;
}

.summary-item {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

.summary-label {
    font-weight: 500;
    color: #555;
    min-width: 120px;
    display: inline-block;
}

.summary-value {
    color: #333;
    flex: 1;
}

@media (max-width: 768px) {
    .summary-item {
        flex-direction: column;
    }
    
    .summary-label {
        margin-bottom: 3px;
    }
}

/* Styles pour la section Options du dashboard */
.options-tabs {
    margin-top: 20px;
}

.options-tab-buttons {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.options-tab-buttons .tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
}

.options-tab-buttons .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.options-tab-content {
    display: none;
}

.options-tab-content.active {
    display: block;
}

.options-list {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #eee;
    margin-bottom: 10px;
    border-radius: 4px;
}

.option-item:hover {
    background-color: #f9f9f9;
}

.option-actions button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 10px;
    color: #666;
}

.option-actions button:hover {
    color: var(--primary-color);
}

.add-option-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.add-option-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Dans la section style du même fichier */
.help-icon {
    color: #ffc107;
    font-size: 0.9em;
    margin-left: 5px;
    cursor: help;
    position: relative;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    width: 250px;
    padding: 10px;
    border-radius: 6px;
    background: #333;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    white-space: normal;
    text-align: center;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    border: 6px solid transparent;
    border-top-color: #333;
    margin-bottom: -12px;
}