:root {
    /* Palette cohérente avec votre menu */
    --primary-blue: #3359d7;
    --dark-blue: #020617;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    /* background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); */
    min-height: 100vh;
}

a {
    text-decoration: none !important;
}

.main-content {
    background: transparent;
    border-radius: 0;
    padding: 10;
    margin-top: 0;
    box-shadow: none;
}

/* ========================================
   SECTION EN-TÊTE
======================================== */
.header-section {
    background: linear-gradient(177deg, #3359d7 0%, #020617 100%);
    padding: 2rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Pattern décoratif subtil */
.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
}

.header-content {
    position: relative;
    z-index: 1;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-align: center;
    margin: 0;
    text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.book-count {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ========================================
   BARRE DE RECHERCHE MOBILE
======================================== */
.search-container {
    max-width: 600px;
    margin: 1.5rem auto 0;
    position: relative;
    padding: 0 1rem;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    background: white;
    transform: translateY(-2px);
}

/* ========================================
   FILTRES DESKTOP
======================================== */
.filters-desktop {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    transition: var(--transition-smooth);
    font-weight: 500;
    background: white;
    font-size: 0.95rem;
}

.filter-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(51, 89, 215, 0.1);
    outline: none;
}

.btn-filter {
    background: linear-gradient(135deg, #008cff 0%, #1900fa 100%);
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 140, 255, 0.3);
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 140, 255, 0.4);
}

.btn-reset {
    background: white;
    border: 2px solid #e9ecef;
    padding: 0.65rem 1.5rem;
    border-radius: 10px;
    color: #6c757d;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-reset:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
    transform: translateY(-2px);
}

/* ========================================
   GRILLE DE LIVRES - 6 COLONNES
======================================== */

/* Sur grand écran (1200px+) : 6 colonnes */
@media (min-width: 1200px) {
    .row-cols-lg-6 > * {
        flex: 0 0 auto;
        width: 16.666667%; /* 100% / 6 = 16.666667% */
    }
}

/* Sur écran moyen (992px - 1199px) : 4 colonnes */
@media (min-width: 992px) and (max-width: 1199px) {
    .row-cols-md-4 > * {
        flex: 0 0 auto;
        width: 25%; /* 100% / 4 = 25% */
    }
}

/* Sur petit écran (768px - 991px) : 3 colonnes */
@media (min-width: 768px) and (max-width: 991px) {
    .row-cols-sm-3 > * {
        flex: 0 0 auto;
        width: 33.333333%; /* 100% / 3 = 33.333333% */
    }
}

/* Sur mobile (moins de 768px) : 2 colonnes */
@media (max-width: 767px) {
    .row-cols-2 > * {
        flex: 0 0 auto;
        width: 50%; /* 100% / 2 = 50% */
    }
}

/* ========================================
   CARTES DE LIVRES
======================================== */
.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
    position: relative;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(51, 89, 215, 0.2);
}

.book-card-link {
    display: block;
    position: relative;
    overflow: hidden;
}

/* Hauteurs adaptatives pour les couvertures */
.book-cover {
    height: 20rem;
    object-fit: cover;
    width: 100%;
    transition: var(--transition-smooth);
}

/* Sur très grand écran, réduire légèrement la hauteur */
@media (min-width: 1400px) {
    .book-cover {
        height: 22rem;
    }
}

/* Sur grand écran, hauteur standard */
@media (min-width: 1200px) and (max-width: 1399px) {
    .book-cover {
        height: 20rem;
    }
}

/* Sur écran moyen */
@media (min-width: 992px) and (max-width: 1199px) {
    .book-cover {
        height: 18rem;
    }
}

/* Sur tablette */
@media (min-width: 768px) and (max-width: 991px) {
    .book-cover {
        height: 16rem;
    }
}

/* Sur mobile */
@media (max-width: 767px) {
    .book-cover {
        height: 14rem;
    }
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

/* Overlay au survol */
.book-card-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition-smooth);
}

.book-card:hover .book-card-link::after {
    opacity: 1;
}

/* ========================================
   BADGES ET TAGS
======================================== */

/* Tag événement */
.event-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #3359d7 0%, #5a7de6 100%);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 3px 12px rgba(51, 89, 215, 0.4);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Badge "Lu" */
.read-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 10;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
}

/* ========================================
   TITRE DU LIVRE
======================================== */
.book-title-container {
    padding: 2px;
    text-align: center;
    background: white;
}

.book-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5rem;
}

/* ========================================
   PAGINATION
======================================== */
.pagination-modern {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.page-link-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    background: white;
    color: #6c757d;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-decoration: none;
    font-size: 0.9rem;
}

.page-link-modern:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(51, 89, 215, 0.05);
    transform: translateY(-2px);
}

.page-link-modern.active {
    background: linear-gradient(135deg, #008cff 0%, #1900fa 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 140, 255, 0.3);
}

/* ========================================
   MESSAGE AUCUN RÉSULTAT
======================================== */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.no-results-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-text {
    font-size: 1.3rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ========================================
   RESPONSIVE GÉNÉRAL
======================================== */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
    }

    .book-count {
        font-size: 0.9rem;
    }

    .header-section {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
    }

    .filters-desktop {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 1.5rem;
    }
}

/* ========================================
   ANIMATIONS AU CHARGEMENT
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

/* Délais progressifs pour effet cascade - 18 livres */
.book-card:nth-child(1) { animation-delay: 0.03s; }
.book-card:nth-child(2) { animation-delay: 0.06s; }
.book-card:nth-child(3) { animation-delay: 0.09s; }
.book-card:nth-child(4) { animation-delay: 0.12s; }
.book-card:nth-child(5) { animation-delay: 0.15s; }
.book-card:nth-child(6) { animation-delay: 0.18s; }
.book-card:nth-child(7) { animation-delay: 0.21s; }
.book-card:nth-child(8) { animation-delay: 0.24s; }
.book-card:nth-child(9) { animation-delay: 0.27s; }
.book-card:nth-child(10) { animation-delay: 0.30s; }
.book-card:nth-child(11) { animation-delay: 0.33s; }
.book-card:nth-child(12) { animation-delay: 0.36s; }
.book-card:nth-child(13) { animation-delay: 0.39s; }
.book-card:nth-child(14) { animation-delay: 0.42s; }
.book-card:nth-child(15) { animation-delay: 0.45s; }
.book-card:nth-child(16) { animation-delay: 0.48s; }
.book-card:nth-child(17) { animation-delay: 0.51s; }
.book-card:nth-child(18) { animation-delay: 0.54s; }

/* ========================================
   OPTIMISATIONS PERFORMANCES
======================================== */
.book-card,
.book-cover,
.page-link-modern,
.btn-filter,
.btn-reset {
    will-change: transform;
}

/* Smooth scroll pour toute la page */
html {
    scroll-behavior: smooth;
}