/* ==========================================================================
   VIRA Contact Button - Frontend
   Desktop: vertical column with HOTLINE bubble (unchanged)
   Mobile : full-width bottom bar with icon + label below
   ========================================================================== */

.vira-cb {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ==========================================================================
   DESKTOP
   ========================================================================== */

.vira-cb__desktop {
    position: fixed;
    bottom: 30px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.vira-cb--right .vira-cb__desktop { right: 20px; }
.vira-cb--left  .vira-cb__desktop { left: 20px; }

/* ---------- Main button (HOTLINE) ---------- */
.vira-cb__main-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.vira-cb__hotline {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2a44;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 7px 14px;
    border-radius: 6px;
    white-space: nowrap;
}
.vira-cb__hotline::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
}
/* Position bubble on the SIDE OPPOSITE the screen edge */
.vira-cb--right .vira-cb__hotline { right: calc(100% + 14px); }
.vira-cb--right .vira-cb__hotline::after {
    left: 100%;
    border-left-color: #1f2a44;
}
.vira-cb--left .vira-cb__hotline { left: calc(100% + 14px); }
.vira-cb--left .vira-cb__hotline::after {
    right: 100%;
    border-right-color: #1f2a44;
}

/* ---------- Buttons (shared desktop) ---------- */
.vira-cb__btn {
    --vira-bg: #0068ff;
    position: relative; /* anchor for absolute-positioned tooltip */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
}

.vira-cb__btn:focus { outline: none; }
.vira-cb__btn:focus-visible .vira-cb__circle {
    box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.4);
}

.vira-cb__circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--vira-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vira-cb__circle img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.vira-cb__btn:hover .vira-cb__circle {
    transform: scale(1.08);
}

/* Main button bigger + pulse rings */
.vira-cb__btn--main .vira-cb__circle {
    width: 60px;
    height: 60px;
}
.vira-cb__btn--main .vira-cb__circle img {
    width: 32px;
    height: 32px;
    animation: vira-cb-ring 1.8s infinite ease-in-out;
}
.vira-cb__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--vira-bg);
    opacity: 0.4;
    animation: vira-cb-pulse 1.6s ease-out infinite;
    pointer-events: none;
}
.vira-cb__ring--2 {
    animation-delay: 0.8s;
}

@keyframes vira-cb-pulse {
    0%   { transform: scale(1);   opacity: 0.45; }
    100% { transform: scale(1.8); opacity: 0;    }
}
@keyframes vira-cb-ring {
    0%, 50%, 100% { transform: rotate(0); }
    10%, 30%      { transform: rotate(-15deg); }
    20%, 40%      { transform: rotate(15deg); }
}

/* ---------- Secondary list (white pill column) ---------- */
.vira-cb__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, padding 0.25s ease;
    max-height: 600px;
    /* IMPORTANT: keep overflow visible so per-button tooltips can escape the pill.
       overflow:hidden is only applied when the list is collapsed (animation). */
    overflow: visible;
}
.vira-cb.is-collapsed .vira-cb__list {
    opacity: 0;
    transform: translateY(10px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.vira-cb__list .vira-cb__circle {
    width: 46px;
    height: 46px;
}
.vira-cb__list .vira-cb__circle img {
    width: 26px;
    height: 26px;
}

/* ---------- Tooltip per button (HOTLINE-style bubble) ---------- */
/* Points INTO the screen: right-positioned bar => tooltip on the LEFT of icon */
.vira-cb__tip {
    position: absolute;
    top: 50%;
    z-index: 2;
    background: #1f2a44;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.vira-cb__tip::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
}

.vira-cb--right .vira-cb__tip {
    right: calc(100% + 14px);
    transform: translateY(-50%) translateX(6px);
}
.vira-cb--right .vira-cb__tip::after {
    left: 100%;
    border-left-color: #1f2a44;
}

.vira-cb--left .vira-cb__tip {
    left: calc(100% + 14px);
    transform: translateY(-50%) translateX(-6px);
}
.vira-cb--left .vira-cb__tip::after {
    right: 100%;
    border-right-color: #1f2a44;
}

.vira-cb__btn:hover .vira-cb__tip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ---------- Toggle button (chevron) ---------- */
.vira-cb__toggle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.vira-cb__chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid #555;
    border-bottom: 2px solid #555;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.25s ease;
}
.vira-cb.is-collapsed .vira-cb__chevron {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* ==========================================================================
   MOBILE (bottom bar)
   ========================================================================== */

.vira-cb__mobile {
    display: none; /* shown only on mobile */
}

@media (max-width: 768px) {
    /* Hide desktop column on mobile */
    .vira-cb__desktop {
        display: none;
    }

    /* Push the page up so the fixed bottom bar doesn't cover content.
       Height = padding (16) + icon (32) + gap (4) + label line (~16) ≈ 68px,
       rounded up to 72px for a safety margin. The bar is ~68px tall in practice. */
    body {
        padding-bottom: 72px;
    }

    /* Show bottom bar */
    .vira-cb__mobile {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 99999;
        background: #1f2a44;
        padding: 8px 4px;
        justify-content: space-around;
        align-items: stretch;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    }

    .vira-cb__m-btn {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 4px 2px;
        text-decoration: none;
        color: #fff;
    }

    .vira-cb__m-icon {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .vira-cb__m-icon img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }

    .vira-cb__m-label {
        font-size: 12px;
        font-weight: 600;
        color: #fff;
        text-align: center;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .vira-cb__m-btn:active .vira-cb__m-icon {
        transform: scale(0.92);
    }

    /* Add safe-area padding for iOS notch (devices with home indicator) */
    @supports (padding: env(safe-area-inset-bottom)) {
        body {
            padding-bottom: calc(72px + env(safe-area-inset-bottom));
        }
        .vira-cb__mobile {
            padding-bottom: calc(8px + env(safe-area-inset-bottom));
        }
    }
}
