/* ----------------------
   Chat Launcher
----------------------- */
#orkah-chat-launcher,
.orkah-chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    border-radius: 50%;
}

    .orkah-chat-icon svg {
        width: 100%;
        height: 100%;
        opacity: 0.75;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }
    
    .orkah-chat-icon svg {
        transform: translateY(0);
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }
    
    .orkah-chat-icon:hover svg {
        transform: translateY(-5px);
        opacity: 1;
    }
    
    /* ----------------------
    Chat Icon
    ----------------------- */
    .orkah-chat-icon {
    width: 100px;
    height: 100px;
    position: relative;
    z-index: 1;
}

.orkah-launcher-animate .orkah-chat-icon svg {
    animation: orkah-wiggle 0.6s ease-in-out;
}

/* ----------------------
   CTA Bubble
----------------------- */
.orkah-chat-cta {
    position: absolute;
    height: 150px;
    width: 80vw;
    max-width: 500px;
    bottom: 30%; /* tail aligned with bottom of icon */
    right: 0%; /* tail aligned with right of icon */
    background: var(--chat--cta-bg-color);
    color: var(--chat--cta-font-color);
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform-origin: bottom right; /* scale from tail */
}

    .orkah-chat-cta::after {
        content: "";
        position: absolute;
        bottom: -10px; /* tail below bubble */
        right: 20px; /* horizontal offset from right edge of bubble to match icon */
        border-width: 12px 12px 0 12px;
        border-style: solid;
        border-color: var(--chat--cta-bg-color) transparent transparent transparent;
    }

.orkah-launcher-animate .orkah-chat-cta {
    opacity: 1;
    transform: scale(1); /* can animate scale if desired */
}

/* ----------------------
   CTA Flex Layout
----------------------- */
.orkah-chat-cta-flex-container {
    display: flex;
    flex-direction: row;
    align-items: center; /* vertical centering */
    gap: 10px; /* space between portrait and text */
    padding: 0.25em;
    height: 100%;
}

.orkah-chat-cta-left {
    flex: 1 1 30%;
    display: flex;
    align-items: center;
}

.orkah-chat-cta-portrait {
    height: 20vw;
    max-height: 100px;
    min-height: 60px;
    width: auto;
    border-radius: 50%;
    border-width: 2px;
    border-style: solid;
    border-color: var(--chat--cta-font-color);
}

.orkah-chat-cta-right {
    flex: 2 1 70%;
    display: flex;
    align-items: start;
    font-size: clamp(14px, 2.5vw, 18px);
    font-weight: 500;
    
}

.orkah-chat-cta-content {
    display: inline-block;
}

.orkah-chat-cta-close-topright {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    z-index: 10;
}

    .orkah-chat-cta-close-topright svg {
        width: 100% !important;
        height: 100% !important;
        opacity: 0.75;
        transition: opacity 0.3s ease-in-out;
        fill: #fff;
    }
#orkah-chat-cta-close:hover svg {
    opacity: 1; /* slightly brighter */
}

/* ----------------------
   Chat Window
----------------------- */
#orkah-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: var(--chat--window--width);
    height: var(--chat--window--height);
    max-height: var(--chat--window--max-height);
    background: var(--chat--color-light);
    border-radius: var(--chat--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    scrollbar-color: var(--chat--header--bg) var(--chat--color-light);
    display: none;
    flex-direction: column;
    z-index: 10000;
}

.orkah-chat-header {
    display: flex;
    align-items: center;
    height: var(--chat--header--h);
    background-color: var(--chat--header--bg);
    padding: var(--chat--header--p);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.orkah-chat-portrait {
    height: 50px;
    width: auto;
    border-radius: 50%;
}

    .orkah-chat-header svg {
        fill: var(--chat--header--icon-color) !important;
    }

    .orkah-chat-header span {
        font-size: var(--chat--header--font-size);
        color: var(--chat--header--font-color) !important;
        font-weight: var(--chat--header--font-weight);
        padding-left: 1rem;
    }

.orkah-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-message {
    border-radius: var(--chat--message--border-radius) !important;
}

.chat-inputs textarea[data-v-de5e7961] {
    background: var(--chat--input--background) !important;
}

.orkah-chat-input {
    display: flex;
    padding: 10px;
}

    .orkah-chat-input input[type=text] {
        flex: 1;
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 4px;
    }

    .orkah-chat-input button {
        margin-left: 8px;
        padding: 8px 12px;
        background-color: #0073aa;
        color: #ffffff;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }

/* ----------------------
   Avatars & Close
----------------------- */
.orkah-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 10px;
}

#orkah-close-chat {
    padding:0 !important;
    margin-left: auto;
    background: none;
    border: none;
    color: var(--chat--close-color);
    font-size: var(--chat--close-size);
    cursor: pointer;
    z-index: 99999;
}

/* ----------------------
   Loader / Spinner
----------------------- */
.orkah-chat-loader {
    position: absolute;
    inset: 48px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    z-index: 999;
}

.orkah-spinner svg {
    width: 48px;
    height: 48px;
    display: block;
}

.orkah-spinner .spinner-fg {
    stroke-dasharray: 90;
    stroke-dashoffset: 60;
    transform-origin: 50% 50%;
    animation: orkah-spin 1s linear infinite, orkah-dash 1.2s ease-in-out infinite;
}

/* ----------------------
   Keyframes
----------------------- */
@keyframes orkah-wiggle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(-10deg);
    }

    50% {
        transform: translateY(-8px) rotate(10deg);
    }

    75% {
        transform: translateY(-5px) rotate(-10deg);
    }
}

@keyframes orkah-shrink {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
}

@keyframes orkah-pop {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(0deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0;
    }
}

@keyframes cta-grow {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes orkah-spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes orkah-dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 200;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 200;
        stroke-dashoffset: -124;
    }
}
