﻿/* floating toggle button */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #003366;
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1100;
}

    /* hover grow */
    .chat-toggle:hover {
        transform: scale(1.08);
        box-shadow: 0 12px 28px rgba(0,0,0,.22);
    }

/* close button in header */
.close-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* adjust chat-container so it floats above the toggle */
.chat-container {
    position: fixed;
    bottom: 20px; /* above toggle */
    right: 20px;
    width: 520px;
    height: 584px;
    margin: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    --composer-height: 64px;
    --status-gap: 8px;
    --status-height: 12px;
}

    /* header remains the same */
    .chat-container .header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        background: var(--fill-stroke-primary);
        color: #fff;
        font-size: 1rem;
        font-weight: 600;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

/* chat area fills the remainder of the card */
#chat-host {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    min-height: 0;
}

/* web chat uses internal scroll */
#webchat {
    height: 100%;
    overflow-y: auto;
    min-height: 0;
}

    /*    #webchat [role="log"] {
        padding-bottom: calc(var(--composer-height, 64px) + var(--status-gap, 8px) + 12px) !important;
    }*/

    /* clear stacked shadows */
    #webchat .webchat__bubble,
    #webchat .webchat__bubble__content,
    #webchat .ac-container,
    #webchat .ac-adaptiveCard {
        box-shadow: none !important;
        filter: none !important;
    }

    /* single subtle bubble shadow */
    #webchat .webchat__bubble__content {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
        border-radius: 12px !important;
        background-clip: padding-box;
    }

    /* adaptive card same shadow */
    #webchat .ac-adaptiveCard {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
        border-radius: 12px !important;
    }

    #webchat .webchat__avatar img {
        object-fit: contain;
        background: transparent !important;
    }

:global(#webchat .webchat__initialsAvatar__initials) {
    color: white !important;
}

#composer-status {
    position: absolute;
    left: 52px !important;
    right: 20px;
    top: auto !important;
    bottom: calc(var(--composer-height, 64px) + var(--status-gap, 8px)) !important;
    height: var(--status-height);
    line-height: var(--status-height);
    padding: 0 12px;
    font-size: 12px;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    visibility: hidden;
    z-index: 5;
    pointer-events: none;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    #composer-status.alt-loader {
        padding: 0;
        height: 6px;
        border-radius: 6px;
        overflow: hidden;
        bottom: calc(var(--composer-height) + var(--status-gap)) !important;
        z-index: 5;
        width: 108px;
    }


        #composer-status.alt-loader::before {
            content: '';
            display: block;
            height: 100%;
            width: 100%;
            background-image: repeating-linear-gradient( 90deg, rgba(0, 51, 102, 0.95) 0px, rgba(0, 51, 102, 0.80) 14px, transparent 14px 18px, rgba(0, 51, 102, 0.95) 18px, rgba(0, 51, 102, 0.80) 24px, transparent 24px 28px );
            background-size: 52px 100%;
            animation: slideBars 0.8s linear infinite alternate;
        }

@keyframes slideBars {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -52px 0;
    }
}

/* mobile full screen */
@media (max-width: 600px) {
    .chat-container {
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
}

.ai-btn-wrapper {
    display: inline-block;
    padding: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff4d4d, #ff8a00, #ffd300, #78d13a, #00c6ff, #6a5cff, #ff4dbe);
    border: none;
    cursor: pointer;
}

#webchat .webchat__bubble__content {
    font-size: var(--cm-font-info);
}


#webchat .webchat__suggested-actions__focus-indicator {
    border: none;
}

#webchat .webchat__suggested-action {
    border-radius: 24px;
    display: inline-flex;
    padding: 0px 8px;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--fill-stroke-primary);
    min-width: fit-content;
    color: var(--text-default-dark);
    font-size: var(--cm-font-body);
    line-height: 1.5rem;
    font-weight: 400;
}

    #webchat .webchat__suggested-action:active,
    #webchat .webchat__suggested-action:hover {
        background-color: var(--surface-primary);
    }

    #webchat .webchat__suggested-action:focus {
        box-shadow: 0px 0px 8px lightblue;
    }

#webchat .webchat__adaptive-card-renderer .ac-pushButton {
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-50);
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: #fff;
    height: 24px;
    box-sizing: content-box;
}


    #webchat .webchat__adaptive-card-renderer .ac-pushButton div {
        color: var(--primary-50);
        font-size: var(--cm-font-body);
        line-height: 1.5rem;
        font-weight: 400;
    }

    #webchat .webchat__adaptive-card-renderer .ac-pushButton:hover div,
    #webchat .webchat__adaptive-card-renderer .ac-pushButton:active div {
        color: white;
    }

    #webchat .webchat__adaptive-card-renderer .ac-pushButton:hover,
    #webchat .webchat__adaptive-card-renderer .ac-pushButton:active {
        border: 1px solid var(--primary-30);
        background-color: var(--primary-30);
        color: white;
    }
