/* ═══════════════════════════════════════════════════════════════
   Sifency Video Avatar — Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper: shared fixed base ──────────────────────────────── */
.sifency-video-avatar-wrapper {
    position: fixed;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    visibility: hidden;
    /* GSAP reveals via autoAlpha */
}

/* ── Relative (in-flow) override ─────────────────────────────── */
.sifency-pos-relative {
    position: relative;
    z-index: auto;
    bottom: auto;
    top: auto;
    left: auto;
    right: auto;
    display: inline-flex;
}

/* ─────────────────────────────────────────────────────────────
   9-position grid
   ───────────────────────────────────────────────────────────── */

/* Bottom row */
.sifency-pos-bottom-left {
    bottom: 30px;
    left: 30px;
    flex-direction: row;
    align-items: flex-end;
}

.sifency-pos-bottom-center {
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    align-items: center;
}

.sifency-pos-bottom-right {
    bottom: 30px;
    right: 30px;
    flex-direction: row-reverse;
    align-items: flex-end;
}

/* Top row */
.sifency-pos-top-left {
    top: 30px;
    left: 30px;
    flex-direction: row;
    align-items: flex-start;
}

.sifency-pos-top-center {
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column-reverse;
    align-items: center;
}

.sifency-pos-top-right {
    top: 30px;
    right: 30px;
    flex-direction: row-reverse;
    align-items: flex-start;
}

/* Middle row */
.sifency-pos-middle-left {
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
    flex-direction: row;
    align-items: center;
}

.sifency-pos-middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    align-items: center;
}

.sifency-pos-middle-right {
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    flex-direction: row-reverse;
    align-items: center;
}

/* ─────────────────────────────────────────────────────────────
   Chat Bubble
   ───────────────────────────────────────────────────────────── */
.sifency-va-bubble {
    position: relative;
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    max-width: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
    will-change: transform;
}

/* Tail arrow — base */
.sifency-va-bubble::after {
    content: '';
    position: absolute;
    border: 10px solid transparent;
}

/* Right-side positions: tail points right */
.sifency-pos-bottom-right .sifency-va-bubble::after,
.sifency-pos-top-right .sifency-va-bubble::after,
.sifency-pos-middle-right .sifency-va-bubble::after {
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #fff;
}

/* Left-side positions: tail points left */
.sifency-pos-bottom-left .sifency-va-bubble::after,
.sifency-pos-top-left .sifency-va-bubble::after,
.sifency-pos-middle-left .sifency-va-bubble::after {
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #fff;
}

/* Bottom-center: tail points down (bubble is above avatar) */
.sifency-pos-bottom-center .sifency-va-bubble::after {
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #fff;
}

/* Top-center: tail points up (bubble is below avatar) */
.sifency-pos-top-center .sifency-va-bubble::after {
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #fff;
}

/* Middle-center: tail points down by default */
.sifency-pos-middle-center .sifency-va-bubble::after {
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #fff;
}

/* Bubble typography */
.sifency-va-b-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.sifency-va-b-desc {
    font-size: .9rem;
    opacity: .8;
    line-height: 1.4;
}

/* Close × button inside bubble */
.sifency-va-bubble-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: .4;
    transition: opacity .3s;
}

.sifency-va-bubble-close:hover {
    opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   Video Wrap (mini avatar → expanded player)
   ───────────────────────────────────────────────────────────── */
.sifency-va-video-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    will-change: width, height, border-radius;
    flex-shrink: 0;
    background: #000;
}

/* Native <video> player */
.sifency-va-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* Iframe player (YouTube / Vimeo) */
.sifency-va-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    pointer-events: none;
}

.sifency-va-is-expanded .sifency-va-iframe {
    pointer-events: auto;
}

/* ─────────────────────────────────────────────────────────────
   Video Overlay
   ───────────────────────────────────────────────────────────── */
.sifency-va-mini-overlay {
    --sifency-va-overlay-color: rgba(0, 0, 0, 0.6);
    --sifency-va-overlay-opacity: 1;

    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top,
            var(--sifency-va-overlay-color, rgba(0, 0, 0, .6)) 0%,
            transparent 70%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    pointer-events: none;
    opacity: var(--sifency-va-overlay-opacity, 1);
}

.sifency-va-tap-text {
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    animation: 2s infinite sifencyPulse;
}

@keyframes sifencyPulse {

    0%,
    100% {
        opacity: .5;
    }

    50% {
        opacity: 1;
    }
}

/* ─────────────────────────────────────────────────────────────
   Main Close Button
   ───────────────────────────────────────────────────────────── */
.sifency-va-close-main {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: background .3s;
    cursor: pointer;
}

.sifency-va-close-main:hover {
    background: rgba(0, 0, 0, .8);
}

/* ─────────────────────────────────────────────────────────────
   Mobile overrides
   ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    .sifency-video-avatar-wrapper:not(.sifency-pos-relative) {
        bottom: 20px !important;
        right: 20px !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        flex-direction: row-reverse !important;
        align-items: flex-end !important;
    }

    .sifency-va-bubble {
        display: none;
    }
}