/* ========================================================
   JENNIFER GORI — GUIDED CHATBOT
   ======================================================== */

.site-chatbot {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 2600;
}


/* ========================================================
   LAUNCHER
   ======================================================== */

.chatbot-launcher {
    min-height: 52px;
    padding: 0 16px 0 15px;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;

    background: var(--olive);
    color: white;

    box-shadow:
        0 16px 38px rgba(31,30,27,.18);

    cursor: pointer;

    transition:
        transform .3s ease,
        background .3s ease,
        box-shadow .3s ease;
}

.chatbot-launcher:hover {
    transform: translateY(-2px);

    background: var(--olive-dark);

    box-shadow:
        0 20px 45px rgba(31,30,27,.22);
}

.chatbot-launcher-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #d7c3a6;

    box-shadow:
        0 0 0 5px rgba(215,195,166,.10);
}

.chatbot-launcher-text {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.4px;
}

.chatbot-launcher-icon {
    width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: rgba(255,255,255,.08);

    font-family: var(--serif);
    font-size: 18px;
    line-height: 1;

    transition: transform .35s ease;
}

.site-chatbot.is-open .chatbot-launcher-icon {
    transform: rotate(45deg);
}


/* ========================================================
   PANEL
   ======================================================== */

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 68px;

    width: min(390px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 110px));

    display: flex;
    flex-direction: column;

    background: var(--cream);

    border: 1px solid rgba(82,77,69,.16);
    border-radius: 22px 22px 8px 22px;

    box-shadow:
        0 24px 70px rgba(31,30,27,.20);

    overflow: hidden;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform:
        translateY(16px)
        scale(.985);

    transform-origin: bottom right;

    transition:
        opacity .35s ease,
        visibility .35s ease,
        transform .42s cubic-bezier(.16,1,.3,1);
}

.site-chatbot.is-open .chatbot-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform:
        translateY(0)
        scale(1);
}


/* ========================================================
   HEADER
   ======================================================== */

.chatbot-header {
    padding: 24px 24px 20px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    background: var(--olive);
    color: white;
}

.chatbot-eyebrow {
    display: block;

    margin-bottom: 6px;

    color: #d7c3a6;

    font-size: 7px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.2px;
}

.chatbot-header h2 {
    max-width: 260px;

    font-family: var(--serif);
    font-size: 25px;
    font-weight: 500;
    line-height: 1.15;
}

.chatbot-close {
    flex-shrink: 0;

    width: 34px;
    height: 34px;

    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;

    background: transparent;
    color: white;

    font-size: 24px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .3s ease,
        transform .3s ease;
}

.chatbot-close:hover {
    background: rgba(255,255,255,.08);
    transform: rotate(5deg);
}


/* ========================================================
   BODY
   ======================================================== */

.chatbot-body {
    padding: 22px;

    overflow-y: auto;
}

.chatbot-message {
    margin-bottom: 18px;
}

.chatbot-message p {
    color: var(--muted);

    font-size: 13px;
    line-height: 1.75;
}


/* ========================================================
   OPTIONS
   ======================================================== */

.chatbot-options {
    display: grid;
    gap: 9px;
}

.chatbot-option {
    width: 100%;

    padding: 13px 14px;

    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: center;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: rgba(255,255,255,.36);
    color: var(--ink);

    cursor: pointer;
    text-align: left;

    font-size: 12px;
    font-weight: 500;

    transition:
        border-color .3s ease,
        background .3s ease,
        transform .3s ease;
}

.chatbot-option span {
    color: var(--champagne);

    font-family: var(--serif);
    font-size: 13px;
}

.chatbot-option:hover {
    transform: translateX(3px);

    border-color: rgba(152,125,93,.46);

    background: rgba(255,255,255,.70);
}


/* ========================================================
   RESPONSE
   ======================================================== */

.chatbot-response {
    display: none;
}

.chatbot-response.is-visible {
    display: block;

    animation:
        chatbotResponseIn
        .42s
        cubic-bezier(.16,1,.3,1);
}

@keyframes chatbotResponseIn {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}

.chatbot-response-card {
    padding: 18px;

    border: 1px solid var(--line);
    border-radius: 12px;

    background: #eee8de;
}

.chatbot-response-card span {
    display: block;

    margin-bottom: 7px;

    color: var(--champagne);

    font-size: 7px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.8px;
}

.chatbot-response-card h3 {
    margin-bottom: 10px;

    font-family: var(--serif);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
}

.chatbot-response-card p {
    color: var(--muted);

    font-size: 13px;
    line-height: 1.75;
}

.chatbot-response-actions {
    margin-top: 16px;

    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatbot-response-actions a {
    min-height: 38px;
    padding: 0 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--olive);
    border-radius: 999px;

    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;

    transition:
        background .3s ease,
        color .3s ease;
}

.chatbot-response-actions a:first-child {
    background: var(--olive);
    color: white;
}

.chatbot-response-actions a:hover {
    background: var(--olive-dark);
    border-color: var(--olive-dark);
    color: white;
}


/* ========================================================
   FOOTER
   ======================================================== */

.chatbot-footer {
    padding: 14px 22px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    border-top: 1px solid var(--line);
}

.chatbot-footer > span {
    color: #8a857c;

    font-size: 7px;
    line-height: 1.4;
    text-align: right;
}

.chatbot-back {
    padding: 0;

    border: 0;
    background: transparent;

    color: var(--champagne);

    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;

    cursor: pointer;
}

/* ========================================================
   DESKTOP — COMPACT LAUNCHER
   ======================================================== */

@media (min-width: 621px) {

    .chatbot-launcher {
        min-width: 126px;

        transition:
            width .45s cubic-bezier(.16,1,.3,1),
            min-width .45s cubic-bezier(.16,1,.3,1),
            padding .45s cubic-bezier(.16,1,.3,1),
            gap .45s cubic-bezier(.16,1,.3,1),
            transform .3s ease,
            background .3s ease,
            box-shadow .3s ease;
    }


    .chatbot-launcher-text {
        max-width: 100px;

        overflow: hidden;

        opacity: 1;

        white-space: nowrap;

        transition:
            max-width .4s cubic-bezier(.16,1,.3,1),
            opacity .25s ease;
    }


    .chatbot-launcher-dot {
        flex-shrink: 0;

        transition:
            width .35s ease,
            height .35s ease,
            opacity .25s ease,
            margin .35s ease;
    }


    .chatbot-launcher-icon {
        flex-shrink: 0;
    }


    /* Compact after 10 seconds */

    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher {
        width: 52px;
        min-width: 52px;

        height: 52px;
        min-height: 52px;

        padding: 0;

        gap: 0;

        justify-content: center;
    }


    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher-text {
        max-width: 0;

        opacity: 0;

        pointer-events: none;
    }


    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher-dot {
        width: 0;
        height: 0;

        margin: 0;

        opacity: 0;

        box-shadow: none;
    }


    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher-icon {
        width: 32px;
        height: 32px;

        font-size: 20px;
    }


    /* Expand again on hover */

    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher:hover {
        width: auto;
        min-width: 126px;

        padding:
            0 16px
            0 15px;

        gap: 10px;

        justify-content: flex-start;
    }


    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher:hover
    .chatbot-launcher-text {
        max-width: 100px;

        opacity: 1;
    }


    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher:hover
    .chatbot-launcher-dot {
        width: 8px;
        height: 8px;

        opacity: 1;

        box-shadow:
            0 0 0 5px
            rgba(215,195,166,.10);
    }

}


/* ========================================================
   MOBILE
   ======================================================== */

@media (max-width: 620px) {

    .site-chatbot {
        right: 14px;
        bottom: 14px;
    }


    /* ====================================================
       LAUNCHER — INITIAL STATE
       ==================================================== */

    .chatbot-launcher {
        min-width: 126px;
        min-height: 46px;

        padding:
            0 11px
            0 13px;

        gap: 8px;

        transition:
            width .45s cubic-bezier(.16,1,.3,1),
            min-width .45s cubic-bezier(.16,1,.3,1),
            height .45s cubic-bezier(.16,1,.3,1),
            min-height .45s cubic-bezier(.16,1,.3,1),
            padding .45s cubic-bezier(.16,1,.3,1),
            gap .45s cubic-bezier(.16,1,.3,1),
            transform .3s ease,
            background .3s ease,
            box-shadow .3s ease;
    }

    .chatbot-launcher-text {
        max-width: 90px;

        overflow: hidden;

        opacity: 1;

        white-space: nowrap;

        font-size: 7px;

        transition:
            max-width .4s cubic-bezier(.16,1,.3,1),
            opacity .25s ease;
    }

    .chatbot-launcher-dot {
        flex-shrink: 0;

        transition:
            width .35s ease,
            height .35s ease,
            opacity .25s ease,
            margin .35s ease;
    }

    .chatbot-launcher-icon {
        flex-shrink: 0;
    }


    /* ====================================================
       COMPACT STATE
       ==================================================== */

    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher {
        width: 46px;
        min-width: 46px;

        height: 46px;
        min-height: 46px;

        padding: 0;

        gap: 0;

        justify-content: center;
    }

    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher-text {
        max-width: 0;

        opacity: 0;

        pointer-events: none;
    }

    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher-dot {
        width: 0;
        height: 0;

        margin: 0;

        opacity: 0;

        box-shadow: none;
    }

    .site-chatbot.is-compact:not(.is-open)
    .chatbot-launcher-icon {
        width: 30px;
        height: 30px;

        background:
            rgba(255,255,255,.09);

        font-size: 20px;
    }


    /* ====================================================
       OPEN STATE
       ==================================================== */

    .site-chatbot.is-open
    .chatbot-launcher {
        width: 46px;
        min-width: 46px;

        height: 46px;
        min-height: 46px;

        padding: 0;

        justify-content: center;
    }

    .site-chatbot.is-open
    .chatbot-launcher-text,
    .site-chatbot.is-open
    .chatbot-launcher-dot {
        display: none;
    }


    /* ====================================================
       CHATBOT PANEL
       ==================================================== */

    .chatbot-panel {
        position: fixed;

        left: 12px;
        right: 12px;
        bottom: 72px;

        width: auto;

        max-height:
            calc(100dvh - 92px);

        border-radius:
            18px 18px
            8px 18px;
    }

}


/* ========================================================
   REDUCED MOTION
   ======================================================== */

@media (prefers-reduced-motion: reduce) {

    .chatbot-launcher,
    .chatbot-launcher-text,
    .chatbot-launcher-dot,
    .chatbot-launcher-icon,
    .chatbot-panel,
    .chatbot-option,
    .chatbot-close,
    .chatbot-response.is-visible {
        transition: none !important;
        animation: none !important;
    }

}
