/* =========================================
   1. STYLE GLOBAL ET FOND D'ÉCRAN
========================================= */
body {
    font-family: Arial, sans-serif;
    /* Superposition d'un filtre sombre sur l'image spatiale */
    background-image: 
        linear-gradient(rgba(5, 8, 16, 0.65), rgba(5, 8, 16, 0.65)),
        url(../img/espace.jpg);
    background-size: cover; 
    background-position: center;
    background-attachment: fixed;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
}

/* =========================================
   2. EN-TÊTE ET NAVIGATION (HEADER / NAV)
========================================= */
header {
    background-color: transparent; 
    padding: 20px;
    text-align: center;
}

nav ul {
    list-style-type: none;
    padding: 0;
}

nav ul li {
    display: inline-block; 
    margin: 0 15px;
}

nav a {
    color: #ffffff; 
    text-decoration: none;
    font-size: 1.2rem;
    display: inline-block; 
    transition: all 0.3s ease; 
}

/* Effet au survol (agrandissement et couleur néon) */
nav a:hover {
    color: #00d2ff; 
    transform: scale(1.15); 
}

/* =========================================
   3. STRUCTURE CENTRALE (MAIN)
========================================= */
main {
    padding: 20px;
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 60px; 
}

/* Masquage initial pour l'animation JavaScript (Uniquement les enfants directs) */
main > h1, main > p {
    opacity: 0; 
}

main > h1 {
    font-size: 3.5rem; 
    margin-bottom: 10px;
}

main > p {
    font-size: 1.6rem; 
    max-width: 800px;
}

/* =========================================
   4. BARRE DE RECHERCHE (CATALOGUE)
========================================= */
.barre-recherche-container {
    text-align: center;
    margin: 10px auto 40px auto;
    max-width: 500px;
    width: 90%;
}

#recherche-titre {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #00d2ff;
    border-radius: 30px;
    background-color: rgba(5, 8, 16, 0.8);
    color: #fff;
    outline: none;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box; 
}

#recherche-titre:focus {
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
    border-color: #ffffff;
}

#recherche-titre::placeholder {
    color: #888;
}

/* =========================================
   5. CATALOGUE DES ROMANS (LISTING)
========================================= */
.catalogue-grille {
    display: flex;
    justify-content: center;
    gap: 30px; 
    flex-wrap: wrap; 
    max-width: 1200px;
    margin-top: 20px;
}

/* Pour que le lien englobe proprement la carte cliquable */
.lien-carte {
    text-decoration: none;
    color: inherit;
    display: block;
}

.carte-roman {
    background-color: rgba(0, 0, 0, 0.8); 
    padding: 20px;
    border-radius: 12px;
    width: 240px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); 
    opacity: 0; /* Masquage initial pour l'apparition JS */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: left; 
}

/* Effet Lévitation au Hover */
.carte-roman:hover {
    transform: translateY(-15px); 
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7); 
}

.carte-roman img {
    width: 100%; 
    height: 320px; 
    object-fit: cover; 
    border-radius: 6px;
    margin-bottom: 15px;
    border-bottom: 2px solid #00d2ff; 
}

.carte-roman h2 {
    font-size: 1.4rem;
    color: #ffffff;
    margin: 0 0 10px 0;
}

/* =========================================
   6. PAGE DE DÉTAILS D'UN ROMAN
========================================= */
.page-details {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

.details-conteneur {
    background-color: rgba(0, 0, 0, 0.85);
    border: 2px solid #00d2ff;
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.3);
    border-radius: 12px;
    padding: 40px;
    max-width: 900px;
    width: 90%;
    display: flex;
    gap: 40px;
    text-align: left;
}

.details-image {
    width: 300px;
    height: 450px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #00d2ff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
}

.details-texte h1 {
    color: #ffffff;
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #00d2ff;
    padding-bottom: 10px;
}

.details-info {
    font-size: 1.2rem;
    color: #e0e0e0;
    margin-bottom: 15px;
}

.details-info strong {
    color: #00d2ff;
}

.details-resume {
    background-color: rgba(5, 8, 16, 0.6);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #00d2ff;
    margin-top: 25px;
    margin-bottom: 30px;
}

.details-resume h3 {
    color: #00d2ff;
    margin-top: 0;
    margin-bottom: 10px;
}

.details-resume p {
    line-height: 1.6;
    font-size: 1.1rem;
    color: #cccccc;
}

.btn-retour {
    display: inline-block;
    background-color: #00d2ff;
    color: #050810;
    padding: 12px 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-retour:hover {
    background-color: #ffffff;
    transform: scale(1.05);
}

/* =========================================
   7. STYLE DU FORMULAIRE D'IDENTIFICATION
========================================= */
.cadre-formulaire {
    background-color: rgba(0, 0, 0, 0.8); 
    border: none;
    border-radius: 8px;
    padding: 30px 40px;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2); 
    width: 100%;
    max-width: 350px;
    text-align: left; 
}

.cadre-formulaire h2 {
    color: #ffffff;
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
}

.cadre-formulaire label {
    display: block;
    margin-bottom: 8px;
    color: #00d2ff;
    font-weight: bold;
}

.cadre-formulaire input[type="text"],
.cadre-formulaire input[type="number"],
.cadre-formulaire input[type="password"] {
    width: 100%;
    padding: 12px;
    background-color: rgba(5, 8, 16, 0.7); 
    border: 1px solid #334;
    border-radius: 4px;
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box; 
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cadre-formulaire input[type="text"]:focus,
.cadre-formulaire input[type="number"]:focus,
.cadre-formulaire input[type="password"]:focus {
    outline: none;
    border-color: #00d2ff; 
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
}

.btn-valider {
    background-color: #00d2ff;
    color: #050810;
    border: none;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-valider:hover {
    background-color: #ffffff;
    transform: scale(1.05);
}

/* Animation "Accès Refusé" (Secousse) */
.secousse {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.4) !important;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* =========================================
   8. PIED DE PAGE (FOOTER)
========================================= */
footer {
    text-align: center;
    padding: 40px 10px 15px 10px;
    background: linear-gradient(to bottom, rgba(5, 8, 16, 0) 0%, rgba(5, 8, 16, 0.8) 40%, rgba(5, 8, 16, 1) 100%);
    position: fixed;
    bottom: 0;
    width: 100%;
    pointer-events: none; 
}

footer p {
    pointer-events: auto;
    margin: 0;
}

/* =========================================
   9. RESPONSIVE (Mobiles & Tablettes)
========================================= */
@media screen and (max-width: 768px) {
    /* Menu en colonne */
    nav ul li {
        display: block; 
        margin: 15px 0;
    }

    main > h1 {
        font-size: 2.2rem;
    }
    
    main > p {
        font-size: 1.2rem;
    }

    /* Grille du catalogue passe sur 1 colonne */
    .catalogue-grille {
        flex-direction: column;
        align-items: center;
    }

    .carte-roman {
        width: 80%;
    }

    /* Page de détails (image en haut, texte en bas) */
    .details-conteneur {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }
    
    .details-texte h1 {
        text-align: center;
    }

    .details-image {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
}