/* =====================================================================
   LVL1 Reviews — Floating Badges CSS
   Préfixe : .lvl1r-floating-
   ===================================================================== */

/* ------------------------------------------------------------------ */
/* Container fixe                                                       */
/* ------------------------------------------------------------------ */

.lvl1r-floating-container {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lvl1r-floating--left  { left: 20px; }
.lvl1r-floating--right { right: 20px; }

/* ------------------------------------------------------------------ */
/* Badge individuel                                                     */
/* ------------------------------------------------------------------ */

.lvl1r-floating-badge {
    position: relative;
    pointer-events: auto;
    transform: translateY(calc(100% + 36px));
    opacity: 0;
    transition: transform .42s cubic-bezier(.34, 1.56, .64, 1),
                opacity   .3s  ease;
    will-change: transform, opacity;
}

.lvl1r-floating-badge.is-visible {
    transform: translateY(0);
    opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Inner (lien ou div)                                                  */
/* ------------------------------------------------------------------ */

.lvl1r-floating-badge__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--lvl1r-bg, #ffffff);
    color: var(--lvl1r-text, #3c4043);
    border: 1.5px solid var(--lvl1r-border, #e8eaed);
    border-radius: var(--lvl1r-border-radius, 12px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .12), 0 1px 4px rgba(0, 0, 0, .07);
    text-decoration: none;
    cursor: default;
    min-width: 140px;
    transition: box-shadow .25s ease, transform .25s ease;
}

a.lvl1r-floating-badge__inner {
    cursor: pointer;
}

.lvl1r-floating-badge:hover .lvl1r-floating-badge__inner,
a.lvl1r-floating-badge__inner:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
    transform: translateY(-2px);
}

/* ------------------------------------------------------------------ */
/* Logo                                                                 */
/* ------------------------------------------------------------------ */

.lvl1r-floating-badge__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ------------------------------------------------------------------ */
/* Contenu (étoiles + note | count)                                    */
/* ------------------------------------------------------------------ */

.lvl1r-floating-badge__content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.lvl1r-floating-badge__stars {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lvl1r-floating-badge__stars .lvl1r-stars {
    gap: 1px;
}

.lvl1r-floating-badge__stars .lvl1r-stars svg {
    width: 13px;
    height: 13px;
}

.lvl1r-floating-badge__num {
    font-size: 14px;
    font-weight: 700;
    color: var(--lvl1r-text, #3c4043);
    line-height: 1;
}

.lvl1r-floating-badge__count {
    font-size: 11px;
    color: var(--lvl1r-text, #3c4043);
    opacity: .68;
    white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Bouton fermer (par badge, absolu top-right)                         */
/* Caché par défaut, apparaît au hover du badge                        */
/* ------------------------------------------------------------------ */

.lvl1r-floating-badge__close {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transform: scale(.7);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 2;
    color: var(--lvl1r-text, #3c4043);
}

.lvl1r-floating-badge__close svg {
    fill: currentColor;
    display: block;
}

/* Apparition au hover du badge complet */
.lvl1r-floating-badge:hover .lvl1r-floating-badge__close {
    opacity: 1;
    transform: scale(1);
}

.lvl1r-floating-badge__close:hover {
    transform: scale(1.2) !important;
}

/* ------------------------------------------------------------------ */
/* Couleurs par source                                                  */
/* ------------------------------------------------------------------ */

/* Google — fond blanc, texte sombre */
.lvl1r-floating-badge--google {
    --lvl1r-bg:     #ffffff;
    --lvl1r-text:   #3c4043;
    --lvl1r-border: #e8eaed;
}

/* Opinion System — fond bleu marine, texte blanc */
.lvl1r-floating-badge--opinionsystem {
    --lvl1r-bg:     #102d69;
    --lvl1r-text:   #ffffff;
    --lvl1r-border: transparent;
}

.lvl1r-floating-badge--opinionsystem .lvl1r-floating-badge__close {
    color: #102d69;
}

.lvl1r-floating-badge--opinionsystem .lvl1r-floating-badge__count {
    opacity: .75;
}

/* ------------------------------------------------------------------ */
/* Dark theme (override manuel)                                         */
/* ------------------------------------------------------------------ */

.lvl1r-floating-badge.lvl1r-theme-dark {
    --lvl1r-bg:     #202124;
    --lvl1r-text:   #e8eaed;
    --lvl1r-border: #3c4043;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
    .lvl1r-floating-container {
        bottom: 12px;
    }

    .lvl1r-floating--left  { left: 12px; }
    .lvl1r-floating--right { right: 12px; }

    .lvl1r-floating-badge__inner {
        padding: 8px 12px;
        gap: 8px;
        min-width: 140px;
    }

    .lvl1r-floating-badge__num { font-size: 13px; }
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                       */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .lvl1r-floating-badge {
        transition: opacity .2s ease;
        transform: none !important;
    }
}
