/**
 * Sahan AI — Voice Orb overlay
 * Covers the chat surface while the microphone is listening.
 */

.sahan-orb-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px;
    background: radial-gradient(ellipse at 50% 45%, #041a1c 0%, #021019 62%, #010a10 100%);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity .28s ease, transform .28s ease, visibility .28s;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.sahan-orb-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* --- orb stage --- */
.sahan-orb-stage {
    position: relative;
    width: min(260px, 62%);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.sahan-orb-canvas {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: block;
}

/* Soft halo that scales with the loudest recent sound. */
.sahan-orb-ring {
    position: absolute;
    inset: 12%;
    z-index: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 214, 143, .30) 0%, rgba(0, 140, 170, .14) 55%, transparent 72%);
    filter: blur(14px);
    opacity: .25;
    transition: transform .12s ease-out, opacity .12s ease-out;
    will-change: transform, opacity;
    pointer-events: none;
}

/* --- text --- */
.sahan-orb-status {
    margin-top: 6px;
    color: #57e6b4;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .4px;
    text-shadow: 0 0 14px rgba(0, 214, 143, .45);
}

.sahan-orb-transcript {
    min-height: 34px;
    max-height: 72px;
    overflow-y: auto;
    padding: 0 6px;
    color: #e6fff6;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
    text-wrap: balance;
}

.sahan-orb-transcript:empty::before {
    content: 'Start speaking…';
    color: rgba(160, 220, 200, .40);
}

/* --- stop button --- */
.sahan-orb-stop {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
    padding: 9px 20px;
    border: 1px solid rgba(0, 214, 143, .34);
    border-radius: 999px;
    background: rgba(0, 45, 45, .55);
    color: #d6fff0;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .12s ease;
}

.sahan-orb-stop:hover {
    background: rgba(0, 70, 62, .72);
    border-color: rgba(0, 214, 143, .60);
}

.sahan-orb-stop:active { transform: scale(.96); }

.sahan-orb-stop svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* On the standalone assistant page the orb takes the whole viewport. */
body.sahan-ai-assistant-page .sahan-orb-overlay {
    position: fixed;
    z-index: 60;
}

body.sahan-ai-assistant-page .sahan-orb-stage { width: min(360px, 46vmin); }

/* --- compact layout inside the floating widget --- */
.sahan-ai-chatbox .sahan-orb-stage { width: min(210px, 58%); }
.sahan-ai-chatbox .sahan-orb-transcript { font-size: 13px; max-height: 56px; }

@media (max-height: 620px) {
    .sahan-orb-stage { width: min(170px, 50%); }
    .sahan-orb-transcript { max-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .sahan-orb-overlay { transition: opacity .01s; }
    .sahan-orb-ring { transition: none; }
}
