/*=============  Material Symbols configuration =============*/
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/*=============  Shared color palette ============= */
:root {
    --adoc-navy: #202A55;
    --adoc-cyan: #63C7CD;
    --adoc-blue: #3F96D1;
    --adoc-purple: #704A9E;
    --adoc-bg: #F7FAFC;
    --adoc-border: #DDE6EE;
    --adoc-text: #111827;
}

/*============= Floating Action Button =============*/
#adoc-serenity-fab {
    position: fixed;
    left: auto !important;
    right: 410px !important;
    bottom: 95px !important;

    width: 64px;
    height: 64px;

    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;

    cursor: pointer;
    z-index: 999999;

    transition: all .25s ease;
    overflow: visible;
}
#adoc-serenity-fab:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: none;
}
#adoc-serenity-fab img {
    width: 110%;
    height: 110%;
    object-fit: contain;
    transform: scale(1.35) translateY(-0.5px);
    display: block;
    margin: auto;
}

/* ========== Main chatbot container ============ */
#adoc-serenity-panel {
    position: fixed;

    right: 480px;
    bottom: 95px;

    width: 390px;
    height: 600px;

    border-radius: 24px;
    overflow: hidden;

    z-index: 999999;

    background: var(--adoc-bg);
    display: none;
    flex-direction: column;

    box-shadow: 0 24px 60px rgba(32, 42, 85, .30);
    border: 1px solid rgba(255,255,255,.65);

    animation: adocChatOpen .22s ease;
}

/* ========== Panel entrance animation ============ */
@keyframes adocChatOpen {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0px) scale(1);
    }
}

/* ============= Logo, title and action buttons ================= */
#adoc-serenity-header {
    height: 74px;

    background:
        radial-gradient(circle at 15% 10%, rgba(255,255,255,.25), transparent 28%),
        linear-gradient(
            135deg,
            var(--adoc-navy) 0%,
            var(--adoc-blue) 45%,
            var(--adoc-cyan) 100%
        );

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;
    color: white;

    font-family: Inter, sans-serif;

    flex-shrink: 0;
    border-bottom: none;
}
#adoc-serenity-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
#adoc-serenity-header-logo {
    width: 40px;
    height: 40px;

    border-radius: 999px;
    background: rgba(255,255,255,.18);

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
    flex-shrink: 0;

    box-shadow: 0 8px 20px rgba(32,42,85,.18);
}
#adoc-serenity-header-logo img {
    width: 105%;
    height: 105%;
    object-fit: contain;
}
#adoc-serenity-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.2px;
}
#adoc-serenity-subtitle {
    font-size: 12px;
    opacity: .86;
    margin-top: 4px;
}
#adoc-serenity-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========== New chat, close and utility actions ============== */
.adoc-header-action-btn {
    width: 42px;
    height: 42px;

    border: 1px solid rgba(255,255,255,.20);
    border-radius: 14px;

    background: rgba(255,255,255,.18);
    backdrop-filter: blur(14px);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: .2s ease;
    flex-shrink: 0;

    color: white;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.18),
        0 8px 22px rgba(32,42,85,.18);
}
.adoc-header-action-btn:hover {
    background: rgba(255,255,255,.28);
}
.adoc-header-icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
}
.adoc-footer-icon-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
    filter: none;
}

/* ============= Serenity SDK wrapper ================ */
#adoc-serenity-widget {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#adoc-serenity-widget .sc-wrapper,
#adoc-serenity-widget .sc-wrapper-inner,
#adoc-serenity-widget .sc-chat {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* ============ Custom styling applied to Serenity components ============== */
.sc-chat {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;

    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;

    font-family: Inter, sans-serif !important;
}
.sc-header {
    display: none !important;
}
.sc-body {
    flex: 1 1 auto !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    background:
        linear-gradient(180deg, #FFFFFF 0%, #F7FAFC 100%) !important;

    padding: 18px 16px !important;

    min-height: 0 !important;
}

/* =========== Input area and action buttons =========== */
.sc-footer {
    display: block !important;
    flex-shrink: 0 !important;

    border-top: 1px solid var(--adoc-border) !important;
    padding: 12px !important;

    background: #FFFFFF !important;
}
.sc-footer-input-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.sc-footer-textarea {
    border-radius: 18px !important;
    border: 1px solid var(--adoc-border) !important;

    background: #FFFFFF !important;
    color: var(--adoc-text) !important;

    font-family: Inter, sans-serif !important;
    padding: 13px 14px !important;
    font-size: 14px !important;

    resize: none !important;
    outline: none !important;

    min-height: 48px !important;
    max-height: 120px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}
.sc-footer-textarea:focus {
    border-color: var(--adoc-cyan) !important;
    box-shadow: 0 0 0 4px rgba(99,199,205,.18) !important;
}
.sc-footer-send-btn {
    display: none !important;
}
.sc-footer-stop-btn {
    display: none !important;
}

/*============= Dynamic microphone/send button =============*/
.adoc-dynamic-action-btn {
    width: 48px;
    height: 48px;

    border: none !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}
.adoc-dynamic-action-btn:hover {
    transform: none;
    background: transparent !important;
}
.adoc-dynamic-action-btn .adoc-footer-icon-img {
    width: 42px;
    height: 42px;
    background: transparent !important;
}
.adoc-dynamic-action-btn.listening {
    transform: scale(1.08);
    opacity: 1;
}
.adoc-dynamic-action-btn.listening .adoc-footer-icon-img {
    filter: drop-shadow(0 0 8px rgba(99,199,205,.9));
}

/*=============  Prevents default button styling in all interaction states ============= */
.adoc-dynamic-action-btn,
.adoc-dynamic-action-btn:hover,
.adoc-dynamic-action-btn:focus,
.adoc-dynamic-action-btn:active {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    backdrop-filter: none !important;
}

/* ============== Messages ============== */
.sc-body {
    padding: 18px 16px 6px 16px !important;
}
.sc-body-inner,
.sc-messages,
[class*="messages"] {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
.sc-body > div:last-child {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* ============== User and assistant message styling ============== */
.sc-message-bubble--user {
    background: #3F96D1 !important;
    color: white !important;

    border-radius: 22px 22px 8px 22px !important;

    box-shadow: 0 8px 20px rgba(63,150,209,.20) !important;
}
.sc-message-bubble--user::before,
.sc-message-bubble--user::after {
    display: none !important;
}
.sc-message-bubble--agent {
    background: #FFFFFF !important;

    color: var(--adoc-text) !important;

    border: 1px solid var(--adoc-border) !important;
    border-radius: 22px 22px 22px 8px !important;

    box-shadow: 0 6px 18px rgba(32,42,85,.06) !important;
}
.sc-message-bubble--agent::before,
.sc-message-bubble--agent::after {
    display: none !important;
}
.sc-message-bubble a {
    color: var(--adoc-blue) !important;
    text-decoration: underline !important;
    font-weight: 700 !important;
}
.sc-message-bubble a:hover {
    color: var(--adoc-purple) !important;
}
.sc-message-bubble--user a {
    color: white !important;
}

/*============= Loading indicator =============*/
.sc-messages-typing-indicator {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;

    display: flex !important;
    align-items: center !important;

    padding: 4px 0 !important;
    min-height: 24px !important;
}
.sc-dots {
    display: flex !important;
    align-items: center !important;
    gap: 6px;

    margin-top: -8px;
    margin-left: 8px;
}
.sc-dot {
    width: 8px !important;
    height: 8px !important;

    animation: adocDotColors 1.5s infinite linear;
}
.sc-dot:nth-child(2) {
    animation-delay: .5s;
}
.sc-dot:nth-child(3) {
    animation-delay: 1s;
}
@keyframes adocDotColors {
    0% {
        background: var(--adoc-navy);
    }
    25% {
        background: var(--adoc-blue);
    }
    50% {
        background: var(--adoc-cyan);
    }
    75% {
        background: var(--adoc-purple);
    }
    100% {
        background: var(--adoc-navy);
    }
}

/* ============= Removes unused Serenity UI components ============== */
.sc-conversation-list {
    display: none !important;
}
.sc-load-previous {
    display: none !important;
}
[class*="powered"],
[class*="Powered"] {
    display: none !important;
}

/* ============= Mobile and small-screen adjustments ============== */
@media(max-width: 640px) {
    #adoc-serenity-panel {
        right: 10px;
        left: 10px;
        bottom: 84px;

        width: auto;
        height: calc(100vh - 110px);

        border-radius: 22px;
    }

    #adoc-serenity-fab {
        right: 20px !important;
        bottom: 20px !important;
    }

    #adoc-serenity-header {
        height: 70px;
        padding: 0 14px;
    }

    #adoc-serenity-header-logo {
        width: 58px;
        height: 58px;
    }

    #adoc-serenity-title {
        font-size: 14px;
    }

    #adoc-serenity-subtitle {
        font-size: 11px;
    }
}

/* TEMP: hide global chatbot for production release */
#adoc-serenity-fab,
#adoc-serenity-panel,
#adoc-chatbot-root,
#adoc-serenity-widget {
    display: none !important;
}