/**
 * WS Booster - Announcement Badge
 * Pill style Linear / Vercel / Cal.com
 */

.ws-ab {
    --ws-ab-bg: rgba(255, 255, 255, 0.08);
    --ws-ab-border: rgba(255, 255, 255, 0.2);
    --ws-ab-shimmer: rgba(255, 255, 255, 0.25);
    --ws-ab-shimmer-speed: 3s;
    --ws-ab-grad-from: #6366f1;
    --ws-ab-grad-to: #ec4899;

    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--ws-ab-bg);
    border: 1px solid var(--ws-ab-border);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    isolation: isolate;
    width: fit-content;
    max-width: 100%;
}

/* === VARIANTS === */
.ws-ab-variant-pill .ws-ab {
    border-radius: 999px;
}

.ws-ab-variant-square .ws-ab {
    border-radius: 8px;
}

.ws-ab-variant-outline .ws-ab {
    background: transparent;
    border-width: 1px;
}

.ws-ab-variant-filled .ws-ab {
    background: var(--ws-ab-grad-from, #6366f1);
    border-color: transparent;
}

.ws-ab-variant-glass .ws-ab {
    background: var(--ws-ab-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
}

/* Variante gradient-border : bordure degradee (effet CSS double background) */
.ws-ab-variant-gradient-border .ws-ab {
    background:
        linear-gradient(var(--ws-ab-bg, rgba(0,0,0,0.6)), var(--ws-ab-bg, rgba(0,0,0,0.6))) padding-box,
        linear-gradient(135deg, var(--ws-ab-grad-from), var(--ws-ab-grad-to)) border-box;
    border: 1px solid transparent;
    border-radius: 999px;
}

/* === ICONE / EMOJI / DOT === */
.ws-ab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
}

.ws-ab__icon svg,
.ws-ab__icon i {
    width: 14px;
    height: 14px;
    font-size: 14px;
    color: inherit;
}

.ws-ab__emoji {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.ws-ab__dot {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}

.ws-ab__dot::before,
.ws-ab__dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: ws-ab-dot-pulse 2s ease-out infinite;
}

.ws-ab__dot::after {
    animation-delay: 1s;
}

@keyframes ws-ab-dot-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.6);
        opacity: 0;
    }
}

/* === TEXTE === */
.ws-ab__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === FLECHE === */
.ws-ab__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 2px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0.85;
}

.ws-ab__arrow svg {
    width: 14px;
    height: 14px;
    display: block;
}

.ws-ab--link:hover .ws-ab__arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* === SHIMMER (reflet qui traverse) === */
.ws-ab-shimmer-yes .ws-ab::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        110deg,
        transparent 0%,
        transparent 30%,
        var(--ws-ab-shimmer) 50%,
        transparent 70%,
        transparent 100%
    );
    animation: ws-ab-shimmer var(--ws-ab-shimmer-speed, 3s) linear infinite;
    pointer-events: none;
    z-index: 0;
}

.ws-ab-shimmer-yes .ws-ab > * {
    position: relative;
    z-index: 1;
}

@keyframes ws-ab-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* === HOVER LIFT === */
.ws-ab-lift-yes .ws-ab--link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.25);
}

.ws-ab--link:hover {
    filter: brightness(1.08);
}

/* === ACCESSIBILITE === */
@media (prefers-reduced-motion: reduce) {
    .ws-ab,
    .ws-ab__arrow,
    .ws-ab-shimmer-yes .ws-ab::before,
    .ws-ab__dot::before,
    .ws-ab__dot::after {
        animation: none !important;
        transition: none !important;
    }
}

/* === COMPATIBILITE SOMBRE/CLAIR === */
@media (prefers-color-scheme: light) {
    .ws-ab {
        --ws-ab-bg: rgba(0, 0, 0, 0.04);
        --ws-ab-border: rgba(0, 0, 0, 0.12);
        --ws-ab-shimmer: rgba(0, 0, 0, 0.12);
    }
}

/* === HOVER MOTIONS === */
.ws-ab-hover-pulse:hover { animation: ws-ab-pulse 0.6s ease-in-out; }
.ws-ab-hover-wiggle:hover { animation: ws-ab-wiggle 0.4s ease-in-out; }
.ws-ab-hover-shake-x:hover { animation: ws-ab-shake-x 0.5s ease-in-out; }
.ws-ab-hover-bounce:hover { animation: ws-ab-bounce 0.6s ease-in-out; }
.ws-ab-hover-tilt:hover { transform: perspective(500px) rotateX(8deg) rotateY(-4deg) translateY(-2px); }
.ws-ab-hover-expand:hover { transform: scale(1.06); }
.ws-ab-hover-glow-ring:hover { box-shadow: 0 0 0 4px rgba(99,102,241,0.18), 0 0 20px rgba(99,102,241,0.35); }
.ws-ab-hover-icon-spin:hover .ws-ab__icon i,
.ws-ab-hover-icon-spin:hover .ws-ab__icon svg,
.ws-ab-hover-icon-spin:hover .ws-ab__emoji { animation: ws-ab-spin 0.6s linear; display: inline-block; }
.ws-ab-hover-icon-bounce:hover .ws-ab__icon i,
.ws-ab-hover-icon-bounce:hover .ws-ab__icon svg,
.ws-ab-hover-icon-bounce:hover .ws-ab__emoji { animation: ws-ab-bounce 0.5s ease-in-out; display: inline-block; }

@keyframes ws-ab-pulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.05); }
}
@keyframes ws-ab-wiggle {
    0%,100% { transform: rotate(0); }
    25%     { transform: rotate(-2deg); }
    75%     { transform: rotate(2deg); }
}
@keyframes ws-ab-shake-x {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-4px); }
    40%     { transform: translateX(4px); }
    60%     { transform: translateX(-3px); }
    80%     { transform: translateX(3px); }
}
@keyframes ws-ab-bounce {
    0%,100% { transform: translateY(0); }
    30%     { transform: translateY(-6px); }
    60%     { transform: translateY(-2px); }
}
@keyframes ws-ab-spin {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}

/* === IDLE ANIMATIONS (continues sans hover) === */
.ws-ab-idle-float .ws-ab     { animation: ws-ab-float 3.4s ease-in-out infinite; }
.ws-ab-idle-float-rot .ws-ab { animation: ws-ab-float-rot 4.5s ease-in-out infinite; }
.ws-ab-idle-pulse-bg .ws-ab  { animation: ws-ab-pulse-bg 2.4s ease-in-out infinite; }
.ws-ab-idle-breath .ws-ab    { animation: ws-ab-breath 3s ease-in-out infinite; }

@keyframes ws-ab-float {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-6px); }
}
@keyframes ws-ab-float-rot {
    0%,100% { transform: translateY(0) rotate(-1deg); }
    50%     { transform: translateY(-6px) rotate(1deg); }
}
@keyframes ws-ab-pulse-bg {
    0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.0); }
    50%     { box-shadow: 0 0 0 6px rgba(99,102,241,0.15); }
}
@keyframes ws-ab-breath {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.03); }
}
