/* gene/static/css/style.css */

/* --- Style général --- */
body {
    background-color: #f8f9fa;
}

/* --- Conteneur de l'arbre --- */
.chart-container {
    width: 100%;
    height: 80vh; /* Hauteur de 80% de la fenêtre */
    overflow: auto; /* Permet le scroll horizontal et vertical */
    border: 1px solid #dee2e6;
    border-radius: .25rem;
    background-color: #fff;
    /* Améliore le scroll sur mobile */
    -webkit-overflow-scrolling: touch; 
}

/* --- Style des noeuds de l'arbre (Treant.js) --- */
.person-node {
    padding: 0; /* Le padding sera sur le contenu interne */
    border-radius: 8px;
    border: 2px solid #6c757d;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 200px;
    transition: all 0.2s ease-in-out;
}

.person-node.selected {
    border-color: #0d6efd; /* Bordure bleue pour la sélection */
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.4);
}

/* Nouveau : cibler le contenu interne pour le curseur et le padding */
.node-content {
    padding: 10px;
    cursor: pointer;
}

.person-node:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.node-content img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ced4da;
    margin-bottom: 8px;
}

.node-content .node-name {
    font-weight: bold;
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #212529;
}

.node-content .node-dates {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0 0 8px 0;
    min-height: 1.2em; /* Évite le décalage si vide */
}

.node-content .node-notes {
    font-size: 0.75rem;
    color: #495057;
    font-style: italic;
    white-space: pre-wrap; /* Respecte les sauts de ligne */
    max-height: 60px;
    overflow-y: auto;
}

/* Noeuds invisibles pour la structure */
.pseudo-node {
    display: none;
}

/* --- Style pour la recherche --- */
#search-results {
    position: absolute;
    z-index: 1000;
    width: calc(100% - 2rem); /* S'adapte à la largeur du champ de recherche */
}

#search-results .list-group-item {
    cursor: pointer;
}

#search-results .list-group-item:hover {
    background-color: #e9ecef;
}


/* --- Media Queries pour le Responsive Design --- */

/* Pour les petits écrans (smartphones) */
@media (max-width: 767.98px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .person-node {
        width: 160px;
    }
    
    .node-content {
        padding: 8px;
    }

    .node-content .node-name {
        font-size: 0.9rem;
    }
}

/* --- Styles pour la galerie de photos dans le formulaire --- */
.photo-wrapper {
    position: relative;
    border-radius: .25rem;
    overflow: hidden;
    border: 2px solid transparent; /* Bordure par défaut */
    transition: border-color 0.2s ease-in-out;
}

.photo-wrapper.profile-pic {
    border-color: #0d6efd; /* Bordure bleue pour la photo de profil */
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

.photo-wrapper .img-thumbnail {
    display: block;
    margin-bottom: 0;
}

.photo-wrapper .photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.photo-wrapper:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay .btn {
    margin: 4px 0;
}

.photo-overlay .delete-photo-btn {
    position: absolute;
    top: 2px;
    right: 5px;
    font-size: 1.2rem;
    padding: 0 .5rem;
    background-color: rgba(255,255,255,0.8);
    color: #dc3545;
    border: none;
    border-radius: 50%;
}