/* style.css */

/* On s'assure que le html et le body peuvent prendre toute la hauteur */
html, body {
    background-color: whitesmoke;
    height: 100%;
    margin: 0;
    font-family: sans-serif;
}

/* On transforme le body en conteneur Flex vertical */
body {
    display: flex;
    flex-direction: column;
}

/* C'est la ligne la plus importante ! */
main {
    /* flex-grow: 1; dit à l'élément <main> de grandir
       pour occuper tout l'espace vertical disponible. */
    flex-grow: 1;
}

/* Styles optionnels pour la démo */
header, footer {
    background-color: #f2f2f2;
    padding: 1rem;
    text-align: center;
}

/* Pour les lignes de la liste d'utilisateurs */
.clickable-row {
    cursor: pointer;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    /* Assure que les colonnes gèrent bien le texte long */
    /* L'overflow visible évite de couper les ombres (box-shadow) des éléments enfants
       comme les badges interactifs ou l'ombre de la ligne au survol. Le masquage
       du texte est géré au niveau des colonnes enfants. */
    overflow: visible;
}

.clickable-row > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Coloration une ligne sur deux (zebra-striping) */
.user-list .clickable-row:nth-of-type(even) {
    background-color: #f8f9fa; /* Bootstrap 'light' color */
}

.clickable-row:hover {
    transform: scale(1.01);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Amélioration de l'espacement des formulaires */
.form-label {
    margin-bottom: 0.5rem;
}

.form-check {
    padding-left: 2.25em; /* Augmente l'espace pour le label à côté de la checkbox */
    margin-bottom: 0.5rem;
}

/* Sticky headers pour les cartes */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1020; /* Bootstrap nav z-index est 1030, on reste en dessous */
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%); /* Dégradé vert clair */
    border-bottom: 2px solid #4caf50; /* Bordure verte */
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2); /* Ombre verte */
    transition: all 0.3s ease;
}

/* Effet hover pour les sticky headers */
.sticky-header:hover {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Assure que les cartes sont bien positionnées pour le sticky */
.card {
    overflow: visible;
}

/* Style uniforme pour tous les titres sticky headers */
.sticky-header h5 {
    color: #2e7d32; /* Vert foncé pour tous les titres */
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

/* Styles pour les boutons de copie dans les en-têtes */
.sticky-header .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.sticky-header .btn-outline-primary {
    border-color: #2e7d32;
    color: #2e7d32;
}

.sticky-header .btn-outline-primary:hover {
    background-color: #2e7d32;
    border-color: #2e7d32;
    color: white;
}

/* Animation pour le feedback de copie réussie */
.sticky-header .btn-success {
    background-color: #4caf50;
    border-color: #4caf50;
    transition: all 0.3s ease;
}

/* Champs readonly (édition déclarée non autorisée) */
.readonly-locked[readonly] {
    background-color: #f1f3f5; /* gris clair distinguable */
    cursor: not-allowed;
    opacity: 0.85;
}

/* Lorsque l'édition est activée on retire l'effet visuel */
.readonly-locked:not([readonly]) {
    background-color: #ffffff;
    cursor: text;
    opacity: 1;
}