/*
 * frontend.css — AFR Financement (version claire finale)
 * Auteur : Cyril Bochet
 * Date : novembre 2025
 */

/* ---------- CONTAINER PRINCIPAL ---------- */

#reviewsList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    padding: 10px 20px 40px;
    align-items: stretch; /* ✅ cartes uniformes */
}

/* ---------- CARTES D’AVIS ---------- */

.card-review-list {
    will-change: transform;
    background: #ffffff;
    color: #1a2b50;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e3e8ef;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* ✅ occupe toute la cellule */
}

.card-review-list:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(26, 43, 80, 0.15);
}

/* Corps de la carte */
.card-body-review-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-grow: 1;
}

/* Titre */
.card-title-review-list {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a2b50;
    margin-bottom: 0.2rem;
}

/* Étoiles */
.stars-review-list {
    color: #FFAE00;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

/* ---------- ÉTOILES AUTONOMES (SVG inline, sans Font Awesome) ---------- */

.imdv-star {
    display: inline-block;
    position: relative;
    width: 1.25em;
    height: 1.2em;
    margin-right: 0.12em;
    vertical-align: -0.18em;
}

.imdv-star svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Moitié gauche dorée de la demi-étoile */
.imdv-star-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.imdv-star-overlay svg {
    width: 200%;
    height: 100%;
}

/* Texte */
.card-text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #2a3553;
    flex-grow: 1;
    margin-bottom: 1rem;
}

/* Auteur / date */
.text-muted-review-list {
    color: #5a6b8d;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(26, 43, 80, 0.08);
}

/* ---------- ÉTAT “AUCUN AVIS” ---------- */

.immodvisor-no-reviews {
    text-align: center;
    color: #1a2b50;
    font-weight: 600;
    background: #f5f7fb;
    border-radius: 10px;
    padding: 1.2rem;
    border: 1px solid #e0e5ee;
}

/* ---------- PAGINATION ---------- */
.simple-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* 🔧 Empêche le débordement sur mobile */
    gap: 8px;
    margin-top: 30px;
    width: 100%;
    box-sizing: border-box;
}

.simple-pagination ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap; /* 🔧 Double sécurité pour sous-conteneur */
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.simple-pagination ul li a,
.simple-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    color: #1a2b50;
    background-color: #fff;
    border: 1px solid #ccd3e0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- Hover --- */
.simple-pagination ul li a:hover {
    background: #1a2b50;
    color: #fff;
    transform: translateY(-2px);
}

/* --- Active --- */
.simple-pagination ul li.active a,
.simple-pagination .current {
    background: linear-gradient(135deg, #1a2b50, #2c4a90);
    color: #fff;
    border-color: #1a2b50;
    box-shadow: 0 4px 12px rgba(26, 43, 80, 0.35);
}

/* --- Boutons précédent/suivant --- */
.simple-pagination .prev a,
.simple-pagination .next a {
    font-size: 20px;
    font-weight: 700;
    border-radius: 50%;
    width: 42px;
    height: 42px;
}

/* --- Ellipse (...) --- */
.simple-pagination .ellipse {
    color: #8894aa;
    letter-spacing: 2px;
}

/* --- Désactivés --- */
.simple-pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* --- Responsive mobile --- */
@media (max-width: 480px) {
    .simple-pagination ul li a,
    .simple-pagination ul li span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        border-radius: 8px;
    }

    .simple-pagination {
        gap: 6px;
        margin-top: 20px;
    }

    .simple-pagination .prev a,
    .simple-pagination .next a {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ---------- POPUP “VOIR PLUS” ---------- */

/* On retire l'animation hover sur les étoiles */
.stars-review-list {
    color: #FFAE00;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    transition: none;
}

/* Lien "voir plus" intégré */
.review-see-more {
    color: #1a2b50;
    font-weight: 600;
    cursor: pointer;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.review-see-more:hover {
    color: #FFAE00;
    text-decoration: underline;
}

/* MODALE — popup d'avis complet */

.review-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 20, 40, 0.6);
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.review-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 2.2rem 2.6rem;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
    position: relative;
    max-width: 700px;
    margin: 5% auto;
    animation: modalFadeIn 0.25s ease forwards;
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Header --- */
.review-modal-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}


.review-modal-stars {
    color: #ffb300;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.review-modal-meta {
    font-size: 0.9rem;
    color: #6b7890;
    font-style: italic;
}

/* --- Titre --- */
.review-modal-title {
    color: #1a2b50;
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}


/* --- Corps --- */
.review-modal-body p {
    line-height: 1.7;
    font-size: 1rem;
    color: #2d364c;
}


/* --- Footer --- */
.review-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(26, 43, 80, 0.1);
    padding-top: 1rem;
    margin-top: 1rem;
    gap: 10px;
}

.review-modal-logo {
    width: 80px;
    height: auto;
    opacity: 0.85;
}

.review-modal-brand {
    font-size: 0.9rem;
    color: #203659;
    font-weight: 600;
}

.review-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 2px solid #434960a1;
    border-radius: 50%;
    background: transparent;
    color: #434960a1;
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 3px rgb(134 134 134 / 5%);
}

.review-modal-close span {
    position: relative;
    top: -2px;
}

.review-modal-close:hover {
    border-color: #434960;
    color: #434960;
    background: rgba(67, 73, 96, 0.05);
}


@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- Blocage du scroll du body --- */
body.modal-open {
    overflow: hidden;
}



/* ---------- RESPONSIVE ---------- */

@media (max-width: 1024px) {
    #reviewsList {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 22px;
    }

    .card-review-list {
        padding: 1.6rem;
    }
}

@media (max-width: 768px) {
    #reviewsList {
        grid-template-columns: 1fr;
        padding: 0 10px 30px;
    }

    .card-review-list {
        padding: 1.5rem;
    }

    .simple-pagination ul li a,
    .simple-pagination ul li span {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }
}


/* ---------------------------------------------------
   DERNIERS AVIS (get_last_reviews)
--------------------------------------------------- */

.last-reviews-container {
    min-height: 200px;
}
.review-show {
    display: block;
}

.review-item.review-hide {
    display: none !important;
}

.review-item.review-show {
    display: block !important;
}

.paginate-last-reviews {
    text-align: center;
    margin-top: 10px;
}

.paginate-last-reviews a {
    font-size: 20px;
    padding: 3px;
}

.paginate-last-reviews a:hover,
.paginate-last-reviews a:active,
.paginate-last-reviews a:focus {
    color: #191919 !important;
}

.review-nav-btn {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.review-nav-btn:hover {
    opacity: 0.7;
}

/* Pas d'outline au clic souris, mais conservé pour la navigation clavier */
.review-nav-btn:focus {
    outline: none;
}

.review-nav-btn:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Pastilles de navigation (remplacent les icônes fa-circle).
   Taille en em : suit le font-size du lien (20px), comme fa-circle avant. */
.review-nav-dot {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    border-radius: 50%;
    background: #191919;
    vertical-align: middle;
}

.review-nav-btn.btn-active-review .review-nav-dot {
    background: #ffae00;
}



