/* Importation des polices */
@import url('https://fonts.googleapis.com/css?family=Poppins:300,400,500,600&display=swap');

/* Styles Globaux */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #F6F6E9;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Barre de Navigation */
header {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 1000;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

nav .logo img {
    width: 180px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links li a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 10px;
    transition: color 0.3s;
}

.nav-links li a:hover {
    color: #167151;
}

/* Section d'Accueil */
#hero {
    background: url('images/bibliotheque.jpg') center center / cover no-repeat;
    color: white;
    text-align: center;
    padding: 200px 20px;
    position: relative;
}

#hero::after {
    content: '';
    background-color: rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 80px;
    animation: blurIn 1s ease-in-out forwards;
}

/* Animation Blur In */
@keyframes blurIn {
    0% {
        opacity: 0;
        filter: blur(10px);
    }
    50% {
        opacity: 0.5;
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
    }
}


@keyframes levitate {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.cta-button {
    background-color: #167151;
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: #145940;
}

/* Section Notre Histoire */
#notre-histoire {
    padding: 60px 20px;
    background-color: #E9E9E1;
    text-align: center;
}

#notre-histoire h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #167151;
}

#notre-histoire p {
    font-size: 1em;
    color: #555;
    margin-bottom: 15px;
}

.contact-info p {
    font-size: 1em;
    color: #333;
    margin-bottom: 10px;
}

.horaires h3 {
    font-size: 1.5em;
    color: #167151;
    margin-bottom: 15px;
}

.horaires ul {
    list-style: none;
    padding: 0;
}

.horaires ul li {
    font-size: 1em;
    color: #555;
    margin: 5px 0;
}

/* Section des Livres les Plus Vendus */
#nos-livres {
    padding: 60px 20px;
    text-align: center;
}

#nos-livres h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: #167151;
}

.book-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

/* Boîte de Livre */
.book {
    background-color: white;
    padding: 20px;
    width: 250px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid #ddd;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.book:hover {
    transform: translateY(-10px);
}

.book img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.book h3 {
    margin: 15px 0 10px;
    font-size: 1.2em;
    color: #167151;
}

.book p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #555;
}

.book .description {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Boutons */
.reserve-button,
.prochainement-button {
    background-color: #167151;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 30px;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
}

.reserve-button:hover,
.prochainement-button:hover {
    background-color: #145940;
}

.prochainement-button {
    background-color: #1E90FF;
}

.prochainement-button:hover {
    background-color: #1C86EE;
    transform: scale(1.05);
}

/* Message Final */
.end-message {
    background-color: #f9f9f9;
    border-top: 2px solid #ddd;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}

.end-message h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.end-message p {
    color: #555;
    font-size: 1.1em;
}

/* Section Prochaines Sorties */
#prochaines-sorties {
    padding: 60px 20px;
    text-align: center;
}

#prochaines-sorties h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: #167151;
}

/* Formulaire de Réservation */
#reservation {
    padding: 60px 20px;
    background-color: #F6F6E9;
    text-align: center;
}

#reservation h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: #167151;
}

#reservation-form {
    max-width: 600px;
    margin: 0 auto;
}

#reservation-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

#reservation-form .form-group label {
    display: block;
    font-size: 1em;
    color: #333;
    margin-bottom: 8px;
}

#reservation-form .form-group input,
#reservation-form .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
}

#reservation-form .form-group input:focus,
#reservation-form .form-group textarea:focus {
    border-color: #167151;
    outline: none;
}

#reservation-form textarea {
    resize: vertical;
}

#reservation-form .form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

#reservation-form .form-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 30px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

#reservation-form .form-actions button[type="submit"] {
    background-color: #167151;
    color: white;
}

#reservation-form .form-actions button[type="submit"]:hover {
    background-color: #145a41;
}

#reservation-form .form-actions button[type="reset"] {
    background-color: #ccc;
    color: #333;
}

#reservation-form .form-actions button[type="reset"]:hover {
    background-color: #999;
}

/* Notification de Confirmation (Toast) */
.confirmation-toast {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #167151;
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: fadeInOut 4s forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    10%, 90% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.confirmation-toast p {
    margin: 0;
    font-size: 1em;
}

/* Footer */
footer {
    background-color: #fff;
    padding: 60px 20px 20px;
    color: #333;
    border-top: 1px solid #ddd;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-col {
    flex: 1;
    min-width: 220px;
    margin: 20px 0;
}

.footer-col h4 {
    font-size: 18px;
    color: #167151;
    text-transform: capitalize;
    margin-bottom: 20px;
    position: relative;
}

.footer-col h4::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    background-color: #167151;
    height: 2px;
    width: 50px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: #167151;
}

.footer-logo {
    width: 150px;
    margin-top: 10px;
}

.social-links {
    display: flex;
    align-items: center;
}

.social-links a {
    margin-right: 15px;
    display: inline-block;
    transition: transform 0.3s;
}

.social-links a img {
    width: 30px;
    height: 30px;
}

.social-links a:hover {
    transform: scale(1.1);
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.footer-bottom p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Responsivité */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        flex-direction: column;
        gap: 15px;
    }

    /* Liste des Livres */
    .book-list {
        flex-direction: column;
        align-items: center;
    }

    /* Formulaire de Réservation */
    .form-actions {
        flex-direction: column;
    }

    /* Footer */
    .footer-row {
        flex-direction: column;
        align-items: center;
    }

    .footer-col {
        max-width: 100%;
        text-align: center;
    }

    .footer-col ul li a {
        font-size: 18px;
    }
}

/* Conteneur du Chatbot et du Message */
#chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    z-index: 1000;
}

/* Message d'Information du Chatbot */
#chatbot-message {
    background-color: #167151;
    color: #fff;
    padding: 10px 15px;
    border-radius: 20px;
    margin-right: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

#chatbot-message p {
    margin: 0;
    font-size: 14px;
}

/* Bouton du Chatbot */
#chatbot-button {
    width: 60px;
    height: 60px;
    background-color: #167151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#chatbot-button img {
    width: 30px;
    height: 30px;
}

#chatbot-button:hover {
    background-color: #145940;
}

/* Afficher le Message au Survol du Conteneur */
#chatbot-container:hover #chatbot-message {
    opacity: 1;
    transform: translateY(0);
}

/* Fenêtre du Chatbot */
#chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Header de la Fenêtre du Chatbot */
#chatbot-header {
    background-color: #167151;
    color: #fff;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#chatbot-header h3 {
    margin: 0;
    font-size: 16px;
}

#chatbot-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

/* Contenu Principal du Chatbot */
#chatbot-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Zone des Messages */
.chatbot-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

/* Champ de Saisie du Chatbot */
.chatbot-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;
    background-color: #fff;
}

.chatbot-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    margin-right: 10px;
    outline: none;
}

.chatbot-input button {
    padding: 10px 20px;
    background-color: #167151;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.chatbot-input button:hover {
    background-color: #145940;
}

/* Messages du Chatbot */
.chatbot-message {
    margin-bottom: 10px;
}

.chatbot-message.user {
    text-align: right;
}

.chatbot-message.bot {
    text-align: left;
}

.chatbot-message p {
    display: inline-block;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
}

.chatbot-message.user p {
    background-color: #dcf8c6;
}

.chatbot-message.bot p {
    background-color: #e5e5ea;
}

/* Section FAQ */
#faq {
    padding: 60px 20px;
    background-color: #E9E9E1;
    text-align: center;
}

#faq h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: #167151;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.faq-item {
    background-color: #fff;
    border: 1px solid #ccc;
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    background-color: #f9f9f9;
}

.faq-question h3 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.faq-toggle {
    font-size: 1.5em;
    color: #167151;
    transition: transform 0.3s;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding: 0 15px 15px;
    margin: 0;
    font-size: 1em;
    color: #555;
}

.faq-item.active .faq-answer {
    max-height: 200px; /* Ajustez selon la longueur de la réponse */
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg); /* Change le + en x */
}

/* Section des logos défilants */
.logo-slider {
    background-color: #ffffff; /* Couleur de fond */
    padding: 20px 0;
    overflow: hidden; /* Masque le contenu hors de la zone visible */
    position: relative;
}

.logo-container {
    display: flex;
    gap: 50px; /* Espacement entre les logos */
    animation: scrollLeft 50s linear infinite; /* Animation lente et fluide */
    width: max-content; /* Permet au contenu de dépasser horizontalement */
}

.logo-container img {
    height: 50px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.logo-container img:hover {
    opacity: 1;
}

/* Animation pour un défilement infini */
@keyframes scrollLeft {
    from {
        transform: translateX(0); /* Position initiale */
    }
    to {
        transform: translateX(-50%); /* Déplacement du conteneur */
    }
}
