/* ============================================
   RESET & BASE
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Open Sans', 'Times New Roman', serif;
    line-height: 1.85;
    color: #333;
    /* Image d'arrière-plan */
    background-image: url(images/pontmain.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
}

/* Calque sombre sur l'image d'arrière-plan pour lisibilité */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 25, 65, 0.10);
    z-index: -1;
}

/* ============================================
   HEADER (style AELF violet profond)
   ============================================ */
.main-header {
    background: linear-gradient(135deg, #f2f0ea 0%, #f2f0ea 50%, #d7d2c4 100%);
    color: #64031f;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    border-bottom: 1px solid #f1d58b;
}

.main-header h1 {
    font-size: 1.6rem;
    font-weight: normal;
    letter-spacing: 1px;
}

.top-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.nav-btn {
	background: rgba(256, 256, 256, 0.4);
	border: 1px solid rgba(255, 215, 0, 0.4);
	color: #64031f;
	padding: 0.5rem 1rem;
	cursor: pointer;
	border-radius: 1px;
	transition: all 0.2s;
	font-size: 1rem;
	font-weight: 300;
}

.nav-btn:hover {
    background: rgba(170, 170, 170, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.8);
}

.date-picker {
    padding: 0.5rem;
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 3px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.date-picker option {
    background: #2d1941;
    color: white;
}

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */
.main-container {
    display: flex;
    max-width: 1400px;
    margin: 2rem auto;
    gap: 2rem;
    padding: 0 1.5rem;
}

/* ============================================
   OVERLAY (fond sombre derrière la sidebar)
   ============================================ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 89;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* PAS de backdrop-filter ici */
}

.overlay.visible {
    display: block;
    opacity: 1;
}

/* ============================================
   SIDEBAR (boîte blanche style carte)
   ============================================ */
.sidebar {
    width: 280px;
    background: white;
    border-radius: 3px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    height: fit-content;
    position: sticky;  /* OU fixed selon votre préférence */
    top: 100px;        /* ← AJOUTER : décalage sous le header sticky */
    z-index: 100;      /* ← ASSURER UN Z-INDEX POSitif */
}

.testament-section {
    padding: 0;
}

.testament-tabs {
    display: flex;
    background: linear-gradient(to bottom, #e1dcce, #fff);
    border-bottom: 2px solid #e8dcff;
}

.tab-btn {
    flex: 1;
    padding: 1rem 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    color: #63031f;
    position: relative;
}

.tab-btn.active {
    background: #63031f;
    color: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #f1d58b;
}

.book-list {
    padding: 0.75rem;
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto;
}

.book-item {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.92rem;
    transition: all 0.15s;
    border-left: 4px solid transparent;
    background: #fafafa;
}

.book-item:hover {
    background: #e1dcce;
    border-left-color: #61031e;
    transform: translateX(5px);
}

.book-item.selected {
    background: linear-gradient(135deg, #61031e, #88082c);
    color: white;
    border-left-color: #f1d58b;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(197, 169, 128, 0.4);
}

/* ============================================
   SECTION CHAPITRES (dans la sidebar)
   ============================================ */
.chapter-section {
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    background: #fafafa;
}

/* TITRE DU LIVRE AU-DESSUS DES CHAPITRES */
.book-title-bar {
    background: linear-gradient(to right, #61031e, #88082c);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1d58b;
    text-align: center;
}

.book-title-bar #selectedBookTitleDisplay {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.chapter-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(to right, #61031e, #88082c);
    border-bottom: 1px solid #88082c;
}

.chapter-list-header h3 {
    font-size: 1rem;
    color: white;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(-90deg);
}

.chapter-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    background: white;
}

.chapter-item {
    text-align: center;
    padding: 0.6rem;
    cursor: pointer;
    border-radius: 3px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    font-size: 0.88rem;
    transition: all 0.15s;
    font-weight: 500;
}

.chapter-item:hover {
    background: #61031e;
    color: white;
    border-color: #61031e;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(197, 169, 128, 0.3);
}

.chapter-item.current {
    background: linear-gradient(135deg, #61031e, #88082c);
    color: white;
    font-weight: bold;
    border-color: #88082c;
    box-shadow: 0 3px 10px rgba(197, 169, 128, 0.5);
}

/* ============================================
   CONTENU PRINCIPAL (boîte blanche style AELF)
   ============================================ */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    min-width: 0;
}

/* Boîte principale pour le texte biblique */
.bible-text {
    background: white;
    border-radius: 3px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    padding: 2.5rem 3rem;
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 2;
    animation: fadeIn 0.4s ease-in-out;
}

.welcome-message {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.welcome-message h2 {
    color: #61031e;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.subtitle {
    color: #999;
    font-style: italic;
    margin-top: 1rem;
}

.chapter {
    margin-bottom: 2rem;
}

.chapter-title {
    text-align: center;
    color: #2d1941;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: bold;
    border-bottom: 3px solid #61031e;
    padding-bottom: 1rem;
    letter-spacing: 2px;
}

/* Nouvelle version (versets empilés verticalement) */
.bible-text p {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: justify;
}

/* ============================================
   VERSETS BIBLE CRAMPON - STYLE AELF
   ============================================ */

.verse {
    display: flex;
    align-items: flex-start;
    line-height: 1.8;
    margin-bottom: 0.25rem;
    padding-left: 0.5rem;
}

.verse-num {
    background: #fff0e6;    /* Fond orange pâle */
    color: #d4350a;         /* Texte orange foncé */
    font-size: 0.68rem;
    font-weight: bold;
    padding: 1px 5px;
    margin-right: 0.5rem;
    min-width: 20px;
    text-align: center;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.verse-number {
    font-size: 0.75em;
    color: #8b5e34;
    font-weight: bold;
    margin-right: 5px;
}

.verse-num:hover {
    background: #ffe0cc;
    color: #b82600;
    box-shadow: 0 1px 4px rgba(212, 53, 10, 0.3);
}

.verse {
    line-height: 2;
    text-align: justify;
}

/* Alignement cohérent avec AELF */
.bible-text {
    line-height: 2;
    font-size: 1rem;
    text-indent: 0;
}

/* Marges entre chapitres */
.chapter {
    margin-bottom: 3rem;
}

.chapter-title {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}
}

.verse-num:hover {
    color: #2d1941;
    background: #fff8e1;
}

/* Navigation entre chapitres */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem;
    margin-bottom: 2rem;
	margin-top: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ref-title {
    font-weight: bold;
    font-size: 1.25rem;
    color: #2d1941;
    flex: 1;
    text-align: center;
    letter-spacing: 1px;
}

.nav-arrow {
    background: linear-gradient(135deg, #61031e, #88082c);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.nav-arrow:hover:not(:disabled) {
    background: linear-gradient(135deg, #88082c, #61031e);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(197, 169, 128, 0.5);
    border-color: #88082c;
}

.nav-arrow:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 3px;
    width: 90%;
    max-width: 700px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 3px solid #61031e;
}

.close-modal {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    font-size: 1.75rem;
    cursor: pointer;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #61031e;
    color: white;
    transform: rotate(90deg);
}

/* ============================================
   RECHERCHE
   ============================================ */
.search-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input-group input {
    flex: 1;
    padding: 0.85rem 1rem;
    border: 2px solid #ddd;
    border-radius: 3px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #fafafa;
}

.search-input-group input:focus {
    outline: none;
    border-color: #61031e;
    background: white;
    box-shadow: 0 0 0 3px rgba(197, 169, 128, 0.2);
}

.search-btn {
    background: linear-gradient(135deg, #61031e, #88082c);
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.search-btn:hover {
    background: linear-gradient(135deg, #88082c, #4a2c6a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(197, 169, 128, 0.4);
}

.search-options {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.search-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.search-meta {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fff8e1;
    border-radius: 3px;
    font-size: 0.9rem;
    color: #666;
    border-left: 4px solid #88082c;
}

.search-results {
    margin-top: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
    border-top: 2px solid #eee;
    padding-top: 1.5rem;
}

.result-item {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #fafafa;
    border-radius: 3px;
    border-left: 4px solid #61031e;
    cursor: pointer;
    transition: all 0.15s;
}

.result-item:hover {
    background: #f0e6ff;
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(197, 169, 128, 0.2);
}

.result-item strong {
    color: #61031e;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    font-weight: bold;
}

.result-item p {
    font-size: 0.98rem;
    color: #444;
    line-height: 1.7;
}

.highlight {
    background: #ffff99;
    padding: 0 3px;
    font-weight: bold;
    border-radius: 3px;
}

/* ============================================
   BAS DE PAGE
   ============================================ */

.footer-text {
    font-family: 'Open Sans', 'Times New Roman', serif;
    font-size: 10px;
    color: #ffffff;
    line-height: 1.5;
}

.footer-text a {
    color: #ffffff;
    text-decoration: underline;
    padding: 0 2px;
    border-radius: 2px;
    transition: none;
}

.footer-text a:hover {
    background-color: #61031e;
    color: #ffffff;
    text-decoration: none;
}
/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.sidebar::-webkit-scrollbar,
.chapter-list::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track,
.chapter-list::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb,
.chapter-list::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #61031e, #88082c);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.chapter-list::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #88082c, #4a2c6a);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: fixed;
        left: 0;
        top: 70px;
        height: calc(100vh - 70px);
        z-index: 110;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0.75rem 1rem;
    }
    
    .main-header h1 {
        font-size: 1.3rem;
    }
    
    .top-nav {
        gap: 0.5rem;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .content {
        padding: 1rem;
    }
    
    .bible-text {
        padding: 1.5rem;
        font-size: 1.05rem;
    }
    
    .chapter-title {
        font-size: 1.5rem;
    }
    
    .chapter-list {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .search-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-content {
        padding: 1.1rem;
    }
}

@media (max-width: 480px) {
    .chapter-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .book-list {
        max-height: 40vh;
    }
}





/* ============================================
   PETIT BOUTON DE FERMETURE DANS LA SIDEBAR (mobile)
   ============================================ */
.sidebar-close {
    display: none;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    background: rgba(100, 3, 31, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    color: #64031f;
    cursor: pointer;
    z-index: 10;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-close:hover {
    background: #64031f;
    color: white;
    transform: rotate(90deg);
}

/* ============================================
   BARRE DE NAVIGATION INFÉRIEURE (MOBILE)
   ============================================ */
.bottom-nav {
    display: none; /* Cachée par défaut */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, #64031e 0%, #88082c 100%);
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0.25rem;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    z-index: 115;
    border-top: 2px solid #f1d58b;
}

.bottom-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s;
    opacity: 0.85;
    max-width: 85px;
	min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Empêche le SVG d'intercepter les clics */
.bottom-btn svg {
    pointer-events: none !important;
    touch-action: manipulation; /* Améliore réactivité tactile */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.bottom-btn:hover,
.bottom-btn:active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.bottom-btn.main-action {
    flex-grow: 1.3;
}

.bottom-btn.main-action svg {
    width: 28px;
    height: 28px;
}

.bottom-btn.main-action span {
    font-weight: bold;
    font-size: 0.75rem;
}

/* État désactivé */
.bottom-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    background: transparent !important;
}

.bottom-btn:disabled svg {
    filter: grayscale(0.5) brightness(0.7);
}

/* Affichage uniquement sur mobile */
@media (max-width: 1024px) {
    .bottom-nav {
        display: flex;
    }

    .main-container {
        padding-bottom: 4.5rem;
    }

    .content {
        padding-bottom: 4rem;
    }
}

/* Masquer les textes sur très petits écrans */
@media (max-width: 360px) {
    .bottom-btn span {
        display: none;
    }
}

/* ============================================
   RESPONSIVE — AFFICHAGE MOBILE
   ============================================ */
@media (max-width: 1024px) {
    .menu-toggle {
        display: flex;
    }

    .main-header {
        padding: 0.75rem 1rem;
    }

    .main-header table td img {
        max-width: 180px;
        height: auto;
    }

    /* Sidebar en mode tiroir coulissant */
    .sidebar {
        width: 85%;
        max-width: 340px;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 105;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        border-radius: 0;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
    }



    /* Marge basse pour ne pas masquer le contenu sous la barre */
    .main-container {
        padding-bottom: 4rem;
        margin-top: 1rem;
    }

    /* Les boutons de navigation du haut sont masqués sur mobile
       car ils sont dupliqués dans la barre inférieure */
    .chapter-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-nav .nav-btn p {
        font-size: 0.8rem;
    }

    .top-nav .nav-btn img {
        max-width: 140px;
        height: auto;
    }

    .main-header table {
        width: auto;
    }

    .main-header table td img {
        max-width: 140px;
    }
}

@media (max-width: 480px) {


    .bottom-icon {
        font-size: 1rem;
    }

    .main-header table td {
        display: block;
    }

    .main-header table td img {
        max-width: 120px;
    }
}

@media (max-width: 1024px) {
    /* Masquer le bouton recherche du header sur mobile */
    .top-nav {
        display: none;
    }
}

@media (max-width: 1024px) {
    /* Cacher la première cellule (logo + texte) */
    .main-header table td:first-child {
        display: none;
    }
    
    /* Ajuster la taille de l'image titre2.png */
    .main-header table td:last-child img {
        max-width: 200px;
        height: auto !important;
    }
    
    /* Masquer les titres vides */
    .main-header h1 {
        display: none !important;
    }
    
    /* Masquer le bouton recherche du header */
    .top-nav {
        display: none;
    }
    
    /* Afficher la barre de navigation inférieure */
    .bottom-nav {
        display: flex;
    }
    
    /* Espace pour ne pas masquer le contenu */
    .main-container {
        padding-bottom: 4.5rem;
    }
}

@media (max-width: 1024px) {
    /* Centrer le contenu du tableau */
    .main-header table {
        margin: 0 auto;
        text-align: center;
    }
    
    /* Forcer la cellule restante à prendre toute la largeur */
    .main-header table td:last-child {
        display: block;
        text-align: center;
    }
}

