/* ========================================
   STYLES POUR LE SITE GÉNÉALOGIQUE ANGIBAUD
   ======================================== */

/* Conteneur du panneau de notes pour permettre à la flèche de dépasser */
.footnotes-panel {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 320px; /* Largeur augmentée pour inclure la flèche */
    max-height: 70vh;
    overflow: visible; /* Permettre à tous les éléments de dépasser */
    z-index: 100;
    transition: transform 0.3s ease;
}

/* Contenu du panneau de notes */
.footnotes-panel .footnotes-content {
    width: 300px;
    max-height: 70vh;
    overflow-y: auto; /* Défilement automatique sans barre visible */
    overflow-x: hidden; /* Empêcher le défilement horizontal du contenu */
    background-color: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    border-radius: 0 8px 8px 0;
    padding: 1rem;
    /* Masquer la barre de défilement */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
    /* Défilement fluide */
    scroll-behavior: smooth;
}

/* Masquer la barre de défilement pour WebKit (Chrome, Safari, Edge) */
.footnotes-panel .footnotes-content::-webkit-scrollbar {
    display: none;
}

/* État réduit du panneau de notes - seul le bouton dépasse */
.footnotes-panel.collapsed {
    transform: translateX(-280px) translateY(-50%);
}

/* Bouton de basculement des notes - positionné en haut à droite */
.footnote-toggle {
    position: absolute;
    right: -20px;
    top: 5px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 12px 6px;
    cursor: pointer;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    z-index: 101;
    min-width: 20px; /* Assurer une largeur minimale */
}

.footnote-toggle:hover {
    background: #1d4ed8;
    transform: translateX(2px);
}

/* Élément de note de bas de page */
.footnote-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    word-wrap: break-word; /* Permettre la coupure des mots longs */
    overflow-wrap: break-word; /* Alternative pour les navigateurs modernes */
    hyphens: auto; /* Césure automatique des mots */
}

/* Aperçu de la note de bas de page */
.footnote-preview {
    cursor: pointer;
    color: #3b82f6;
    font-weight: 500;
    word-wrap: break-word; /* Permettre la coupure des mots longs */
    overflow-wrap: break-word; /* Alternative pour les navigateurs modernes */
    hyphens: auto; /* Césure automatique des mots */
    line-height: 1.4; /* Améliorer la lisibilité */
}

/* Contenu complet de la note */
.footnote-full {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8fafc;
    border-radius: 4px;
    color: #334155;
    word-wrap: break-word; /* Permettre la coupure des mots longs */
    overflow-wrap: break-word; /* Alternative pour les navigateurs modernes */
    hyphens: auto; /* Césure automatique des mots */
    line-height: 1.5; /* Améliorer la lisibilité */
}

/* Affichage de la note complète quand active */
.footnote-item.active .footnote-full {
    display: block;
}

/* Numéro de la note de bas de page */
.footnote-number {
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 0.8rem;
}

/* Contenu des onglets */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

/* Onglet actif */
.tab-content.active {
    display: block;
}

/* Animation d'apparition */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Liens de navigation */
.nav-link {
    transition: all 0.3s ease;
}

/* Effet de survol sur les liens de navigation */
.nav-link:hover {
    transform: translateY(-3px);
}

/* Blason de famille avec ombre portée */
.family-crest {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Styles pour les références de notes dans le texte */
.footnote-ref {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
}

.footnote-ref:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Styles pour les sections de contenu */
.content-section {
    margin-bottom: 2rem;
}

.content-section h3 {
    color: #1e40af;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-section h4 {
    color: #2563eb;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Styles pour les citations et encadrés */
.quote-box {
    background-color: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

/* Styles pour les listes de références */
.reference-list {
    background-color: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Animation pour le défilement fluide */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Style pour les notes de bas de page mises en surbrillance */
.footnote-item.highlighted {
    background-color: #dbeafe;
    border-left: 3px solid #3b82f6;
    padding-left: 0.5rem;
    transition: all 0.3s ease;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Style pour les notes de bas de page actives */
.footnote-item.active {
    background-color: #f0f9ff;
    border-left: 3px solid #1d4ed8;
    padding-left: 0.5rem;
}

/* Styles spécifiques pour le deuxième onglet - Histoire familiale */
.genealogy-section {
    margin-bottom: 2.5rem;
}

.genealogy-section h3 {
    color: #1e3a8a;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 0.5rem;
}

.genealogy-section h4 {
    color: #2563eb;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Styles pour les listes de généalogie */
.genealogy-list {
    background-color: #f8fafc;
    border-left: 4px solid #1e40af;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.genealogy-list ul {
    list-style-type: none;
    padding-left: 0;
}

.genealogy-list li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.genealogy-list li::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Styles pour les encadrés d'information généalogique */
.genealogy-info-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.1);
}

.genealogy-info-box h5 {
    color: #0c4a6e;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.genealogy-info-box h5 i {
    margin-right: 0.5rem;
    color: #0284c7;
}

/* Styles pour les dates et périodes */
.period-badge {
    background-color: #1e40af;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    margin: 0.25rem 0.25rem 0.25rem 0;
}

/* Styles pour les relations familiales */
.family-relation {
    background-color: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

/* Styles pour l'encart carte */
.map-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.15);
    position: relative;
    overflow: hidden;
}

.map-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #0ea5e9, #06b6d4);
}

.map-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.map-header h3 {
    color: #0c4a6e;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.map-header i {
    margin-right: 0.75rem;
    color: #0284c7;
    font-size: 1.75rem;
}

.map-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    height: 500px;
    position: relative;
}

.map-toggle {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-toggle:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.map-toggle i {
    transition: transform 0.3s ease;
}

.map-toggle.expanded i {
    transform: rotate(180deg);
}

/* Styles pour les popups de marqueurs */
.leaflet-popup-content {
    font-family: 'Times New Roman', serif;
    line-height: 1.6;
}

.leaflet-popup-content h4 {
    color: #1e40af;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.leaflet-popup-content p {
    margin: 0.25rem 0;
    color: #374151;
}

.leaflet-popup-content .period {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    margin: 0.25rem 0;
}

/* Styles pour les boutons "Lire la suite" */
.continue-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.continue-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #1e40af);
}

.continue-button {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.continue-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.4);
}

.continue-button:active {
    transform: translateY(0);
}

.continue-button i {
    transition: transform 0.3s ease;
}

.continue-button:hover i {
    transform: translateX(3px);
}

.continue-text {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-style: italic;
}

/* ========================================
   STYLES POUR LA PAGE GÉNÉALOGIE
   ======================================== */

/* Conteneur des arbres généalogiques */
.tree-container {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

/* Contrôles de zoom */
.zoom-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.zoom-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.zoom-btn i {
    width: 16px;
    height: 16px;
}

/* Wrapper pour les arbres avec zoom */
.tree-wrapper {
    position: relative;
    overflow: auto; /* Permettre le défilement pour le drag */
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Masquer la barre de défilement */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.tree-wrapper::-webkit-scrollbar {
    display: none; /* WebKit (Chrome, Safari, Edge) */
}

/* Conteneur de zoom pour les arbres */
.tree-zoom-container {
    transition: transform 0.3s ease;
    transform-origin: center center;
    cursor: grab;
    user-select: none;
    min-width: 200%; /* Permettre plus de déplacement */
    min-height: 200%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px; /* Ajouter de l'espace autour de l'image */
}

.tree-zoom-container:active {
    cursor: grabbing;
}

/* Images des arbres */
.tree-image {
    max-width: none; /* Permettre à l'image de dépasser pour le drag */
    max-height: none;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
    border-radius: 4px;
    cursor: grab;
    user-select: none;
}

.tree-image:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tree-image:active {
    cursor: grabbing;
}


/* Responsive pour les arbres */
@media (max-width: 768px) {
    .tree-wrapper {
        min-height: 300px;
    }
    
    .tree-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .zoom-btn {
        width: 36px;
        height: 36px;
    }
    
}

/* Animation pour l'apparition des arbres */
.tree-container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour les descriptions généalogiques */
.genealogy-description {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #0ea5e9;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.genealogy-description p {
    margin: 0;
    color: #0c4a6e;
    line-height: 1.6;
}