/* Section principale du livre */
.golden-book-section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

/* Conteneur du livre */
.book-container {
    max-width: 1200px;
    max-height: 950px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    background-image: url('../images/couverture.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Pages du livre */
.page {
    background: linear-gradient(to right, #f9f9f9, #fff);
    font-family: 'Crimson Text', serif;
    color: #333;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 5px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
}

.messages-container {
    height: calc(100% - 30px); /* Espace pour le numéro de page */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    word-wrap: break-word;
    word-break: break-word;
}

/* Personnalisation de la scrollbar */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 128, 0.1);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 128, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 128, 0.5);
}

/* Support Firefox pour la scrollbar */
.messages-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 128, 0.3) rgba(0, 0, 128, 0.1);
}

/* Effet de texture sur les pages */
.page::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: url('../images/vieux-papier-texture.jpg');
    opacity: 0.1;
    pointer-events: none;
}

/* Contenu de la page */
.page-content {
    padding: 25px;
    height: 100%;
    position: relative;
    z-index: 2;
}

/* En-tête de la page */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    color: #000080;
    font-size: 2.5rem;
    font-family: 'Crafty Girls', cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 128, 0.1);
}

/* Messages */
.message {
    margin-bottom: 25px;
    padding: 15px;
    border-bottom: 2px solid rgba(0, 0, 128, 0.1);
    transition: transform 0.3s ease;
}

.message:hover {
    transform: translateX(10px);
}

.message-author {
    font-weight: bold;
    color: #000080;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.message-date {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
}

.message-text {
    margin-top: 10px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #444;
    font-style: italic;
    padding-left: 20px;
    border-left: 3px solid #FFD700;
}

/* Navigation du livre */
.book-navigation {
    display: none; /* Caché par défaut */
}

.nav-button {
    background: rgba(0, 0, 128, 0.8);
    border: none;
    color: #FFD700;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 15px;
    border-radius: 50%;
    pointer-events: auto;
    opacity: 0.6;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover {
    transform: scale(1.1);
    opacity: 1;
    background: rgba(0, 0, 128, 0.9);
}



/* Animations */
@keyframes swipeHint {
    0% { transform: translateX(-5px); opacity: 0.5; }
    50% { transform: translateX(5px); opacity: 1; }
    100% { transform: translateX(-5px); opacity: 0.5; }
}

.page-turn {
    animation: turnPage 0.6s ease-in-out;
}

@keyframes turnPage {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-180deg); }
}

/* Effet de brillance sur les bords */
.book-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.5), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Pied de page de la page */
.page-footer {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Crimson Text', serif;
    font-style: italic;
    color: #666;
    font-size: 1rem;
}

/* Numéro de page */
.page-number {
    display: inline-block;
    padding: 5px 15px;
    position: relative;
}

.page-number::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 30px;
    height: 1px;
    background: rgba(0, 0, 128, 0.2);
}

.page-number::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 30px;
    height: 1px;
    background: rgba(0, 0, 128, 0.2);
}

.quick-nav {
    margin-top: 20px;
}

.btn-quick-nav {
    background: none;
    border: 2px solid #000080;
    color: #000080;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Crafty Girls', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-quick-nav:hover {
    background: #000080;
    color: #FFD700;
}


/* Navigation du livre */
.book-navigation {
    display: none; /* Caché par défaut */
}

.page-indicator {
    display: none; /* Caché par défaut */
}


/* Page de couverture */
.cover-page .page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Conteneur de l'image de couverture */
.cover-image-container {
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 128, 0.2);
}

/* Image de couverture */
.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cover-image:hover {
    transform: scale(1.05);
}

/* En-tête de la couverture */
.page-header {
    color: #000080;
    font-family: 'Crafty Girls', cursive;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: clamp(0.8rem, 2vw, 1.5rem);
    text-align: center;
}

/* Sous-titre */
.subtitle {
    font-family: 'Crimson Text', serif;
    color: #666;
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

/* Logo de couverture */
.cover-logo {
    width: clamp(60px, 15vw, 100px);
    height: auto;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

/* Description de la couverture */
.cover-description {
    text-align: center;
    width: clamp(280px, 90%, 600px);
    margin: 0 auto;
    font-family: 'Crimson Text', serif;
    color: #333;
}

.cover-description p {
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    line-height: 1.6;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.cover-description .invitation {
    font-style: italic;
    color: #000080;
    margin-top: 2rem;
    font-size: 1rem;
}

/* Messages responsifs */
.message {
    padding: clamp(10px, 3vw, 20px);
    margin-bottom: clamp(15px, 4vw, 25px);
}

.message-author {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: clamp(5px, 1vw, 10px);
}

.message-date {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.message-text {
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    line-height: 1.6;
    padding-left: clamp(10px, 3vw, 20px);
}

/* Icônes responsives */
.message i, .cover-description i {
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    margin-right: clamp(5px, 1.5vw, 10px);
}

/* Media queries spécifiques */
@media (max-width: 1024px) {
    
   
    .page-content {
        overflow-y: auto;
        padding: 40px;
    }
    .page-header, .cover-description, .page-header{
       font-size: 0.9rem;
    }
    .cover-image-container {
        max-width: 250px;
    }

    .message {
        padding: 15px;
    }

    
}

@media (max-width: 768px) {

    .book-container {
        width: 90%;
        aspect-ratio: 1/1.2;
        margin: 20px auto;
    }
    

    .page {
        padding: 20px;
    }

    .page-content {
        padding: 15px;
    }

    .page-header {
        font-size: 2rem;
    }

    .message-text {
        font-size: 1rem;
    }

    .nav-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
        background: rgba(0, 0, 128, 0.9);
        opacity: 0.8;
    }

    /* Indicateurs de navigation mobile */
    .mobile-nav-hint {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        color: #FFD700;
        font-size: 0.9rem;
        opacity: 0.8;
        text-align: center;
        width: 100%;
    }

    .swipe-indicator {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-top: 10px;
    }

    .swipe-indicator i {
        animation: swipeHint 1.5s infinite;
    }
    .messages-container::-webkit-scrollbar {
        width: 6px;
    }

    .page-footer {
        bottom: 20px;
        font-size: 0.9rem;
    }
    
    .book-navigation {
        display: flex;
        position: absolute;
        width: 100%;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        justify-content: space-between;
        padding: 0 20px;
        z-index: 1000;
    }

    .nav-button {
        background: rgba(0, 0, 128, 0.8);
        border: none;
        color: #FFD700;
        font-size: 24px;
        cursor: pointer;
        transition: all 0.3s ease;
        padding: 15px;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0.8;
    }

    .nav-button:hover {
        transform: scale(1.1);
        opacity: 1;
        background: rgba(0, 0, 128, 0.9);
    }


    .cover-page .page-content {
        padding: 20px;
    }

    .cover-image-container {
        max-width: 200px;
    }

    .cover-description {
        width: 95%;
    }

    .message {
        padding: 12px;
        margin-bottom: 15px;
    }
    .book-navigation {
        display: flex;
        position: absolute;
        width: 100%;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        justify-content: space-between;
        padding: 0 20px;
        z-index: 1000;
    }

    .nav-button {
        background: rgba(0, 0, 128, 0.8);
        border: none;
        color: #FFD700;
        font-size: 24px;
        cursor: pointer;
        transition: all 0.3s ease;
        padding: 15px;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0.8;
    }

    .nav-button:hover {
        transform: scale(1.1);
        opacity: 1;
        background: rgba(0, 0, 128, 0.9);
    }
    .page-indicator {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    

    
    .page-number {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cover-image-container {
        max-width: 180px;
    }

    .message {
        padding: 10px;
    }

    .message-text {
        padding-left: 10px;
    }
    .book-container {
        width: 95%;
    }

    .page {
        padding: 15px;
    }

    .page-header {
        font-size: 1.8rem;
    }

    .message {
        padding: 10px;
    }

    .message-author {
        font-size: 1.1rem;
    }

    .message-text {
        font-size: 0.95rem;
        padding-left: 15px;
    }
}

/* Animations fluides */
.page-content, .message, .cover-image {
    transition: all 0.3s ease;
}

/* Optimisations pour les écrans haute résolution */
@media (min-width: 1440px) {
    .cover-image-container {
        max-width: 350px;
    }

    .cover-description {
        max-width: 700px;
    }
}

/* Ajout des styles pour la scrollbar de la page d'accueil */
@media (max-width: 1024px) {
    .cover-page .page-content {
        height: 100%;
        overflow-y: auto;
        padding: 20px;
        /* Personnalisation de la scrollbar */
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 128, 0.3) rgba(0, 0, 128, 0.1);
    }

    /* Styles Webkit pour la scrollbar */
    .cover-page .page-content::-webkit-scrollbar {
        width: 6px;
    }

    .cover-page .page-content::-webkit-scrollbar-track {
        background: rgba(0, 0, 128, 0.1);
        border-radius: 4px;
    }

    .cover-page .page-content::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 128, 0.3);
        border-radius: 4px;
        transition: all 0.3s ease;
    }

    .cover-page .page-content::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 128, 0.5);
    }

    /* Ajustement du contenu de la page de couverture */
    .cover-page .page-content {
        display: block; /* Change de flex à block pour un meilleur scroll */
    }

    .cover-description {
        margin-top: 20px;
        padding-bottom: 30px; /* Espace en bas pour le scroll */
    }

    /* Optimisation de l'espacement */
    .cover-image-container {
        margin: 15px auto;
    }

    .page-header {
        margin-top: 10px;
    }
}

/* Ajustements supplémentaires pour mobile */
@media (max-width: 768px) {
    .cover-page .page-content {
        padding: 15px;
    }

    .cover-page .page-content::-webkit-scrollbar {
        width: 4px; /* Scrollbar plus fine sur mobile */
    }
} 