/* =====================================================
   TruckSuvdha AI Launcher  (v2)
   Sab classes "tsai-" se shuru hoti hain taaki aapki
   website ki CSS se na takraayein.
   ===================================================== */

.tsai,
.tsai *,
.tsai *::before,
.tsai *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
}

.tsai {
    --tsai-accent: #635bff;
    --tsai-accent-2: #7c3aed;
    position: fixed;
    right: 24px;
    top: 110px; /* <-- upar se kitna niche chahiye, yahan badlein */
    z-index: 99999;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

    .tsai svg {
        display: block;
        flex: none;
        max-width: none;
        height: auto;
    }

/* ---------------- Main button (pill) ---------------- */
.tsai-btn {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 20px 0 16px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--tsai-accent), var(--tsai-accent-2));
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(99, 91, 255, .42), 0 2px 6px rgba(99, 91, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .tsai-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 34px rgba(99, 91, 255, .5), 0 2px 6px rgba(99, 91, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .28);
    }

    .tsai-btn:active {
        transform: scale(.97);
    }

    .tsai-btn:focus-visible,
    .tsai-opt:focus-visible {
        outline: 3px solid rgba(99, 91, 255, .5);
        outline-offset: 3px;
    }

    /* ek baar halki glow ring */
    .tsai-btn::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        border: 2px solid var(--tsai-accent);
        opacity: 0;
        pointer-events: none;
        animation: tsai-ring 2.2s ease-out 1.2s 2;
    }

@keyframes tsai-ring {
    0% {
        transform: scale(1);
        opacity: .5;
    }

    100% {
        transform: scale(1.18, 1.45);
        opacity: 0;
    }
}

/* sparkle / close icon (ek ke upar ek) */
.tsai-btn-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

    .tsai-btn-icon svg {
        position: absolute;
        inset: 0;
        width: 24px;
        height: 24px;
        transition: transform .3s ease, opacity .2s ease;
    }

.tsai-ico-close {
    opacity: 0;
    transform: rotate(-90deg) scale(.5);
}

.tsai.is-open .tsai-ico-spark {
    opacity: 0;
    transform: rotate(90deg) scale(.5);
}

.tsai.is-open .tsai-ico-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.tsai-btn-label {
    font-size: 15px;
    white-space: nowrap;
}

/* ---------------- Menu card ---------------- */
.tsai-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    width: 252px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e9e9f1;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(28, 22, 90, .18), 0 3px 10px rgba(28, 22, 90, .08);
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(.96);
    transition: opacity .18s ease, transform .22s ease, visibility 0s linear .22s;
}

.tsai.is-open .tsai-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition: opacity .18s ease, transform .22s cubic-bezier(.3, 1.3, .5, 1), visibility 0s;
}

/* button aur menu ke beech ka gap (mouse upar le jaate waqt band na ho) */
.tsai-menu::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 16px;
}

.tsai-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 10px;
    color: #6b6b7b;
    font-size: 13px;
    font-weight: 600;
}

    .tsai-head svg {
        width: 16px;
        height: 16px;
        color: var(--tsai-accent);
    }

/* ---------------- Options ---------------- */
.tsai-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 14px;
    background: transparent;
    color: #17171f !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s ease;
}

    .tsai-opt:hover {
        background: #f3f2ff;
    }

    .tsai-opt + .tsai-opt {
        margin-top: 2px;
    }

.tsai-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 3px 8px rgba(0, 0, 0, .12);
    transition: transform .2s ease;
}

    .tsai-tile svg {
        width: 22px;
        height: 22px;
    }

.tsai-opt:hover .tsai-tile {
    transform: scale(1.07);
}

.tsai-tile.chatgpt {
    background: linear-gradient(145deg, #25c19a, #0f8d6d);
}

.tsai-tile.claude {
    background: linear-gradient(145deg, #ea9577, #cc6b46);
}

.tsai-tile.perplexity {
    background: linear-gradient(145deg, #30a9b9, #186b79);
}

.tsai-name {
    flex: 1;
    min-width: 0;
}

.tsai-go {
    width: 16px;
    height: 16px;
    color: #8a8a9a;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .15s ease, transform .15s ease;
}

.tsai-opt:hover .tsai-go,
.tsai-opt:focus-visible .tsai-go {
    opacity: 1;
    transform: translateX(0);
}

.tsai-note {
    padding: 8px 8px 2px;
    color: #9a9aa8;
    font-size: 11.5px;
}

/* menu khulne par options ek-ek karke aate hain */
.tsai.is-open .tsai-opt {
    animation: tsai-in .3s ease both;
}

    .tsai.is-open .tsai-opt:nth-of-type(1) {
        animation-delay: .04s;
    }

    .tsai.is-open .tsai-opt:nth-of-type(2) {
        animation-delay: .09s;
    }

    .tsai.is-open .tsai-opt:nth-of-type(3) {
        animation-delay: .14s;
    }

@keyframes tsai-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------- Mobile: sirf gol button ---------------- */
@media (max-width: 600px) {
    .tsai {
        right: 16px;
        top: 90px;
    }

    .tsai-btn {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
    }

    .tsai-btn-label {
        display: none;
    }

    .tsai-menu {
        width: min(252px, calc(100vw - 32px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .tsai *,
    .tsai *::before,
    .tsai *::after {
        animation: none !important;
        transition-duration: .01ms !important;
    }
}
