/* Vaani — FAQ / intent chatbot (no LLM) */

.sc-bot {
    position: fixed;
    right: 18px;
    bottom: 78px;
    z-index: 10000;
    width: 56px;
    height: 56px;
    font-family: var(--sc-display, "Space Grotesk", sans-serif);
    pointer-events: none;
}

.sc-bot > * {
    pointer-events: auto;
}

.sc-bot__fab {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #041018;
    background: var(--sc-gradient-cta);
    box-shadow:
        0 12px 30px rgba(var(--sc-shadow-rgb), 0.45),
        0 0 0 1px rgba(var(--sc-cyan-rgb), 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: sc-bot-bob 3.2s ease-in-out infinite;
}

.sc-bot__fab:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow:
        0 16px 36px rgba(var(--sc-cyan-rgb), 0.28),
        0 0 24px rgba(var(--sc-violet-rgb), 0.18);
    animation-play-state: paused;
}

.sc-bot__fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(var(--sc-cyan-rgb), 0.45);
    animation: sc-bot-pulse 2.4s ease-out infinite;
    pointer-events: none;
}

.sc-bot__fab-wave {
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 0.95rem;
    opacity: 0;
    transform: scale(0.4) rotate(-20deg);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.sc-bot.is-waving .sc-bot__fab-wave {
    opacity: 1;
    transform: scale(1) rotate(12deg);
    animation: sc-bot-wave-hand 0.9s ease-in-out 2;
}

.sc-bot__fab-icon {
    position: absolute;
    font-size: 1.35rem;
    display: grid;
    place-items: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sc-bot__mark {
    width: 1.55rem;
    height: 1.55rem;
    display: block;
}

.sc-bot__nudge-avatar .sc-bot__mark,
.sc-bot__avatar .sc-bot__mark {
    width: 1.35rem;
    height: 1.35rem;
}

.sc-bot__mark-spark {
    transform-origin: 25.2px 10.2px;
    animation: sc-bot-spark 2.8s ease-in-out infinite;
}

.sc-bot__mark-spark--sm {
    transform-origin: 6.4px 12.2px;
    animation-delay: 0.7s;
}

.sc-bot__mark-eye {
    transform-box: fill-box;
    transform-origin: center;
    animation: sc-bot-blink 5.5s ease-in-out infinite;
}

.sc-bot__fab-icon--open {
    animation: sc-bot-icon-tilt 4s ease-in-out infinite;
}

.sc-bot__fab-icon--close {
    opacity: 0;
    transform: scale(0.6) rotate(-40deg);
}

.sc-bot.is-open .sc-bot__fab {
    animation: none;
}

.sc-bot.is-open .sc-bot__fab-icon--open {
    opacity: 0;
    transform: scale(0.6) rotate(40deg);
    animation: none;
}

.sc-bot.is-open .sc-bot__fab-icon--close {
    opacity: 1;
    transform: none;
}

.sc-bot.is-open .sc-bot__fab-pulse,
.sc-bot.is-open .sc-bot__fab-wave {
    animation: none;
    opacity: 0;
}

/* Welcome nudge — fixed width so it never collapses to the FAB */
.sc-bot__nudge {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    width: min(300px, calc(100vw - 2rem));
    animation: sc-bot-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.sc-bot__nudge[hidden] {
    display: none !important;
}

.sc-bot.is-open .sc-bot__nudge {
    display: none !important;
}

.sc-bot__nudge-card {
    position: relative;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    padding: 0.85rem 2.1rem 0.85rem 0.85rem;
    border-radius: 18px;
    border: 1px solid rgba(var(--sc-cyan-rgb), 0.28);
    background: linear-gradient(145deg, rgba(var(--sc-surface-rgb), 0.98), rgba(var(--sc-chrome-rgb), 0.95));
    box-shadow:
        0 18px 40px rgba(var(--sc-shadow-rgb), 0.45),
        0 0 0 1px rgba(var(--sc-border-rgb), 0.08);
    color: inherit;
    text-align: left;
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.sc-bot__nudge-card:hover {
    border-color: rgba(var(--sc-cyan-rgb), 0.45);
}

.sc-bot__nudge-avatar {
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--sc-gradient-cta);
    color: #041018;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(var(--sc-cyan-rgb), 0.25);
}

.sc-bot__nudge-copy {
    min-width: 0;
}

.sc-bot__nudge-copy strong {
    display: block;
    font-size: 0.88rem;
    color: var(--sc-text-bright);
    line-height: 1.2;
}

.sc-bot__nudge-copy small {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--sc-muted);
    line-height: 1.4;
    white-space: normal;
}

.sc-bot__nudge-dismiss {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 1.45rem;
    height: 1.45rem;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(var(--sc-bg-rgb), 0.55);
    border: 1px solid rgba(var(--sc-border-rgb), 0.2);
    color: var(--sc-muted);
    cursor: pointer;
    z-index: 2;
}

.sc-bot__nudge-dismiss:hover {
    color: var(--sc-text-bright);
    background: rgba(var(--sc-cyan-rgb), 0.14);
}

.sc-bot__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    width: min(360px, calc(100vw - 2rem));
    height: min(520px, calc(100vh - 7.5rem));
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    border: 1px solid rgba(var(--sc-border-rgb), 0.28);
    background:
        linear-gradient(165deg, rgba(var(--sc-surface-rgb), 0.96), rgba(var(--sc-chrome-rgb), 0.94));
    box-shadow: 0 24px 60px rgba(var(--sc-shadow-rgb), 0.5);
    overflow: hidden;
    transform-origin: bottom right;
    animation: sc-bot-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sc-bot__panel[hidden] {
    display: none !important;
}

.sc-bot__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(var(--sc-border-rgb), 0.18);
    background: linear-gradient(120deg, rgba(var(--sc-cyan-rgb), 0.1), rgba(var(--sc-violet-rgb), 0.08));
}

.sc-bot__identity {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.sc-bot__avatar {
    position: relative;
    width: 2.55rem;
    height: 2.55rem;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--sc-gradient-cta);
    color: #041018;
    font-size: 1.25rem;
    border: 1px solid rgba(var(--sc-border-rgb), 0.2);
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(var(--sc-cyan-rgb), 0.25);
}

.sc-bot__status {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--sc-green);
    border: 2px solid rgba(var(--sc-surface-rgb), 0.95);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
    animation: sc-bot-live 2s ease-out infinite;
}

.sc-bot__identity strong {
    display: block;
    font-size: 0.95rem;
    color: var(--sc-text-bright);
    line-height: 1.2;
}

.sc-bot__identity small {
    display: block;
    font-size: 0.68rem;
    color: var(--sc-muted);
    letter-spacing: 0.03em;
}

.sc-bot__close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(var(--sc-bg-rgb), 0.45);
    color: var(--sc-text-soft);
    cursor: pointer;
}

.sc-bot__close:hover {
    color: var(--sc-text-bright);
    background: rgba(var(--sc-cyan-rgb), 0.14);
}

.sc-bot__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    scroll-behavior: smooth;
}

.sc-bot__bubble {
    max-width: 88%;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    animation: sc-bot-msg 0.28s ease;
}

.sc-bot__bubble--bot {
    align-self: flex-start;
    background: rgba(var(--sc-bg-rgb), 0.55);
    border: 1px solid rgba(var(--sc-border-rgb), 0.2);
    color: var(--sc-text-soft);
    border-bottom-left-radius: 5px;
    position: relative;
}

.sc-bot__bubble--bot::before {
    content: "Vaani";
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sc-cyan);
}

.sc-bot__bubble--user {
    align-self: flex-end;
    color: #041018;
    background: var(--sc-gradient-cta);
    border-bottom-right-radius: 5px;
}

.sc-bot__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.sc-bot__link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--sc-cyan-rgb), 0.35);
    background: rgba(var(--sc-cyan-rgb), 0.1);
    color: var(--sc-cyan-soft);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
}

.sc-bot__link:hover {
    color: var(--sc-text-bright);
    border-color: rgba(var(--sc-cyan-rgb), 0.55);
}

.sc-bot__typing {
    align-self: flex-start;
    display: inline-flex;
    gap: 4px;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    background: rgba(var(--sc-bg-rgb), 0.45);
    border: 1px solid rgba(var(--sc-border-rgb), 0.18);
}

.sc-bot__typing i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--sc-cyan);
    animation: sc-bot-dot 1.1s ease-in-out infinite;
}

.sc-bot__typing i:nth-child(2) { animation-delay: 0.15s; }
.sc-bot__typing i:nth-child(3) { animation-delay: 0.3s; }

.sc-bot__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 0.9rem 0.65rem;
}

.sc-bot__chip {
    border: 1px solid rgba(var(--sc-border-rgb), 0.25);
    background: rgba(var(--sc-bg-rgb), 0.4);
    color: var(--sc-text-soft);
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sc-bot__chip:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--sc-cyan-rgb), 0.45);
    color: var(--sc-text-bright);
    background: rgba(var(--sc-cyan-rgb), 0.1);
}

.sc-bot__composer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    padding: 0.75rem 0.85rem 0.9rem;
    border-top: 1px solid rgba(var(--sc-border-rgb), 0.18);
    background: rgba(var(--sc-bg-rgb), 0.35);
}

.sc-bot__composer input {
    width: 100%;
    min-width: 0;
    padding: 0.7rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--sc-border-rgb), 0.25);
    background: rgba(var(--sc-surface-rgb), 0.85);
    color: var(--sc-text-bright);
    font: inherit;
    font-size: 0.84rem;
    outline: none;
}

.sc-bot__composer input:focus {
    border-color: rgba(var(--sc-cyan-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--sc-cyan-rgb), 0.14);
}

.sc-bot__send {
    width: 2.6rem;
    height: 2.6rem;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #041018;
    background: var(--sc-gradient-cta);
}

.sc-bot__send:disabled {
    opacity: 0.55;
    cursor: wait;
}

@keyframes sc-bot-pulse {
    0% { transform: scale(0.92); opacity: 0.8; }
    100% { transform: scale(1.25); opacity: 0; }
}

@keyframes sc-bot-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes sc-bot-icon-tilt {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(-8deg); }
    60% { transform: rotate(8deg); }
}

@keyframes sc-bot-spark {
    0%, 100% { opacity: 0.7; transform: scale(0.9) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.15) rotate(18deg); }
}

@keyframes sc-bot-blink {
    0%, 42%, 48%, 100% { transform: scaleY(1); }
    45% { transform: scaleY(0.15); }
}

@keyframes sc-bot-wave-hand {
    0%, 100% { transform: scale(1) rotate(8deg); }
    50% { transform: scale(1.1) rotate(22deg); }
}

@keyframes sc-bot-live {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes sc-bot-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

@keyframes sc-bot-msg {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes sc-bot-dot {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 575.98px) {
    .sc-bot {
        right: 14px;
        bottom: 72px;
    }

    .sc-bot__nudge {
        width: min(280px, calc(100vw - 2rem));
    }

    .sc-bot__panel {
        width: calc(100vw - 1.75rem);
        height: min(70vh, 520px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sc-bot__fab,
    .sc-bot__fab-pulse,
    .sc-bot__fab-icon--open,
    .sc-bot__fab-wave,
    .sc-bot__panel,
    .sc-bot__bubble,
    .sc-bot__typing i,
    .sc-bot__status,
    .sc-bot__nudge,
    .sc-bot__mark-spark,
    .sc-bot__mark-eye {
        animation: none !important;
    }
}
