:root {
    --gold: #C5A059;       
    --creme: #F5F5DC;      
    --dark-brown: #2C1B18; 
    --black: #0F0F0F;
    --card-bg: #1A1A1A;
}

body {
    background-color: var(--black);
    color: var(--creme);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    overflow-x: hidden;
}


#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--gold);
    z-index: 9999;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
}


.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(to bottom, var(--dark-brown), var(--black));
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
}

.site-logo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    transition: transform 0.3s ease;
}

.site-logo:hover { transform: scale(1.05); }

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero h1 span { color: var(--gold); }

.intro {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 20px auto;
    line-height: 1.6;
    opacity: 0.9;
}

.intro span {
    color: var(--gold);
    font-weight: 600;
    display: block;
    margin-top: 10px;
}


.controls {
    padding: 30px 20px;
    background: var(--black);
    position: sticky;
    top: 0;
    z-index: 1000;
    text-align: center;
}

.search-wrapper {
    position: relative;
    max-width: 550px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px 15px 50px;
    border-radius: 50px;
    border: 1px solid #333;
    background: #222;
    color: white;
    outline: none;
    transition: border-color 0.3s;
}

#searchInput:focus {
    border-color: var(--gold);
}

.search-wrapper > i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    pointer-events: none;
}


#randomBtn {
    background: var(--gold);
    color: var(--dark-brown);
    border: none;
    width: 40px; /* Taille réduite pour plus d'élégance */
    height: 40px; 
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
    flex-shrink: 0;
}

#randomBtn:hover {
    transform: rotate(20deg) scale(1.1);
    box-shadow: 0 0 15px var(--gold);
}

#randomBtn i {
    font-size: 1rem; /* Icône réduite */
}

.filter-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--gold);
    color: var(--dark-brown);
    border-color: var(--gold);
    font-weight: 600;
}

/* Grille et Cartes */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.book-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: 0.4s;
    border: 1px solid #222;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-10px);
    border-color: var(--gold);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.book-img-container { height: 350px; overflow: hidden; }
.book-img-container img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s;
}

.book-card:hover .book-img-container img {
    transform: scale(1.1);
}

.infos { padding: 20px; }

.tag {
    font-size: 0.7rem;
    color: var(--gold);
    font-weight: bold;
    text-transform: uppercase;
}

.infos h3 { margin: 10px 0 5px; font-size: 1.2rem; }

.author { color: #888; font-size: 0.9rem; margin-bottom: 10px; }

.summary {
    font-size: 0.85rem;
    color: #bbb;
    font-style: italic;
    line-height: 1.5;
    margin: 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.find-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.book-card:hover .find-btn {
    background: var(--gold);
    color: var(--dark-brown);
}



.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    padding: 20px;
}

.modal-content {
    background-color: var(--card-bg);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    border-radius: 20px;
    position: relative;
    border: 1px solid var(--gold);
    padding: 40px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    animation: apparition 0.4s ease;
    overflow-y: auto;
}

@keyframes apparition {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 15px;
    font-size: 40px;
    color: var(--gold);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.close-modal:hover { color: white; }

.modal-body {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.modal-img {
    flex-shrink: 0;
}

.modal-img img {
    width: 250px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.modal-infos {
    flex: 1;
    min-width: 280px;
}

.modal-infos h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 2rem;
    margin-top: 0;
}


.share-section {
    margin: 25px 0;
    padding-top: 20px;
    border-top: 1px dashed #444;
}

.share-section p {
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.share-buttons {
    display: flex;
    gap: 15px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--creme);
    border: 1px solid var(--gold);
    text-decoration: none;
    transition: 0.3s;
}

.share-btn:hover {
    background: var(--gold);
    color: var(--dark-brown);
    transform: translateY(-3px);
}


.buy-info-modal strong {
    display: block;
    margin-bottom: 12px;
    color: var(--gold);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.store-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.store-tag {
    background: rgba(197, 160, 89, 0.15);
    border: 1px solid var(--gold);
    color: var(--creme);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    text-decoration: none;
}

.store-tag:hover {
    background: var(--gold);
    color: var(--dark-brown);
}


footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid #222;
    color: #666;
    font-size: 0.9rem;
}


@media (max-width: 600px) {
    .modal-body { flex-direction: column; align-items: center; text-align: center; }
    .modal-content { padding: 25px 15px; }
    .modal-img img { width: 200px; }
    .share-buttons { justify-content: center; }
    .store-list { justify-content: center; }
    .hero h1 { font-size: 1.8rem; }
    
    .search-wrapper {
        max-width: 95%;
    }
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--gold);
}