/* AG ONE Experion — placement/visibility only; orb + eyes styled by SDK (same as chatbot) */

/* Reset ai-chat.css generic button wrapper */
.ai-chat-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 0;
    border: none;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: inherit;
    cursor: pointer;
    z-index: 100;
    align-items: stretch;
    justify-content: stretch;
}

/* Bottom-right floating orb on every page except home (hero docks the same SDK button) */
body:not(.is-home-page) .ai-chat-btn {
    display: flex !important;
}

/* Home: real SDK button in hero — wrap blocks :hover so eyes keep animating */
body.is-home-page .experion-section > .experion-hero-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 288px;
    height: 288px;
    margin-top: -20px;
    flex-shrink: 0;
    --exp-sphere-size: 288px;
    animation: exp-float 5s ease-in-out infinite;
    z-index: 10;
}

body.is-home-page .experion-section > .experion-hero-wrap > .ai-chat-btn.home-sdk-source {
    display: flex !important;
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none !important;
    width: 100% !important;
    height: 100% !important;
    margin-top: 0;
    animation: none;
}

body.is-home-page .experion-section > .experion-hero-wrap > .ai-chat-btn.home-sdk-source .experion {
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    transform: scale(1) !important;
}

body.is-home-page .experion-hero-wrap > .experion-hero-hit {
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 1;
}

/* Home only: keep hero orb visible while chat sidebar has the live ball in its header */
body.is-home-page .experion-hero-sidebar-clone {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    width: 288px;
    height: 288px;
    margin-top: -20px;
    flex-shrink: 0;
    --exp-sphere-size: 288px;
    animation: exp-float 5s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
}

body.is-home-page .experion-hero-sidebar-clone .experion {
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    transform: scale(1) !important;
}

body.is-home-page.exp-sidebar-open .experion-section > .experion-hero-wrap {
    display: none !important;
}

body.is-home-page.exp-sidebar-open .experion-hero-sidebar-clone {
    display: flex !important;
}

body:not(.is-home-page) .ai-chat-btn:hover {
    transform: none;
    box-shadow: none !important;
}

/* Cart page: shrink Experion when order/pricing bar is expanded; hover restores larger size */
:root {
    --exp-cart-mini-width: 31px;
    --exp-cart-mini-height: 40px;
    --exp-cart-hover-width: 93px;
    --exp-cart-hover-height: 120px;
}

body.is-cart-page.exp-cart-order-expanded:not(.is-home-page):not(.exp-sidebar-open) .ai-chat-btn {
    bottom: 16px !important;
    right: 20px !important;
    display: flex !important;
    width: var(--exp-cart-mini-width) !important;
    height: var(--exp-cart-mini-height) !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 31 / 40;
    animation: none;
    transition:
        width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.is-cart-page.exp-cart-order-expanded:not(.is-home-page):not(.exp-sidebar-open) .ai-chat-btn .experion {
    width: 100% !important;
    height: 100% !important;
}

body.is-cart-page.exp-cart-order-expanded:not(.is-home-page):not(.exp-sidebar-open) .ai-chat-btn:hover {
    display: flex !important;
    width: var(--exp-cart-hover-width) !important;
    height: var(--exp-cart-hover-height) !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 31 / 40;
    box-shadow: none !important;
}

body.is-cart-page.exp-cart-order-expanded:not(.is-home-page):not(.exp-sidebar-open) .ai-chat-btn:hover .experion {
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
}

/* Mobile: flow the hero orb inside the section column, always centred */
@media (max-width: 768px) {
    body.is-home-page .experion-section > .experion-hero-wrap,
    body.is-home-page .experion-hero-sidebar-clone {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 180px !important;
        height: 180px !important;
        --exp-sphere-size: 110px !important;
        margin: 0 auto !important;
        flex-shrink: 0 !important;
        align-self: center !important;
        order: -1 !important;
    }
}


/* Mobile: Nexa sidebar opens full-width without squeezing the page body */
@media (max-width: 768px) {
    body.exp-sidebar-open,
    body.exp-sidebar-open:not(.exp-sidebar-wide-mode):not(.exp-sidebar-left-mode) {
        width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .exp-chat-sidebar,
    #agone-sidebar {
        transition: none !important;
        animation: none !important;
    }

    body.exp-sidebar-open .exp-chat-sidebar,
    body.exp-sidebar-open #agone-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        right: 0 !important;
        width: 88vw !important;
        max-width: 420px !important;
        min-width: 0 !important;
        height: 100dvh !important;
        transform: none !important;
        z-index: 9999 !important;
    }
}

/* Login / Register: hide floating Experion orb on mobile only */
@media (max-width: 768px) {
    body.is-auth-page .ai-chat-btn {
        display: none !important;
    }
}

/* Keep the Experion sidebar wrapper out of normal flow on mobile */
@media (max-width: 768px) {
    #agone-experion-sidebar-container,
    html > #agone-experion-sidebar-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: visible !important;
        pointer-events: none !important;
    }

    #agone-experion-sidebar-container .exp-chat-sidebar,
    #agone-experion-sidebar-container #agone-sidebar,
    .exp-chat-sidebar,
    #agone-sidebar {
        pointer-events: auto !important;
    }

    #agone-experion-sidebar-container .exp-chat-sidebar *,
    #agone-experion-sidebar-container #agone-sidebar *,
    .exp-chat-sidebar *,
    #agone-sidebar * {
        pointer-events: auto;
    }

    .exp-icon-btn-v2,
    #exp-close-btn,
    #exp-more-btn,
    #exp-more-close-btn,
    .exp-more-frame,
    .exp-option-item,
    .exp-options-close {
        pointer-events: auto !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
    }

    .exp-icon-btn-v2 svg,
    .exp-icon-btn-v2 path,
    .exp-icon-btn-v2 g {
        pointer-events: none !important;
    }
}


/* Mobile homepage: completely hide hero Experion (wrap + clone) when sidebar is open */
@media (max-width: 768px) {
    body.is-home-page.exp-sidebar-open .experion-section > .experion-hero-wrap,
    body.is-home-page.exp-sidebar-open .experion-hero-sidebar-clone {
        display: none !important;
    }
}

/* Expanded state for Questionnaire */
body.exp-sidebar-expanded #agone-sidebar,
body.exp-sidebar-expanded .exp-chat-sidebar {
    width: 850px !important;
    max-width: 850px !important;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Questionnaire Component styles */
.exp-questionnaire-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 16px 0px;
    gap: 16px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}


.exp-question-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 16px;
    gap: 4px;
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #C4DAFD;
    border-radius: 8px;
}

.exp-question-card h3 {
    font-family: 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    line-height: 140%;
    color: #296DF5;
    margin: 0;
}

.exp-options-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    padding: 0px;
    gap: 8px;
    width: 100%;
}

.exp-opt-btn {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 6px 16px;
    min-height: 29px;
    background: #FFFFFF;
    border: 0.5px solid #9FAEC6;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    line-height: 140%;
    color: #283243;
    transition: all 0.2s ease-in-out;
}

.exp-opt-btn:hover {
    background: #F1F5F9;
    border-color: #64748B;
}

.exp-opt-btn.active {
    border: 0.5px solid transparent !important;
    background: linear-gradient(114.99deg, #EBF3FF 15.98%, #EBFDFE 57.18%, #F8FED8 111.2%) !important;
    color: #296DF5 !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.exp-submit-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-top: 20px;
}

.exp-submit-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 0px 16px;
    width: 120px;
    height: 38px;
    background: linear-gradient(101.34deg, #296DF5 13.1%, #08C9D4 74.79%, #E2F76E 114.1%);
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-family: 'Noto Sans', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 13px;
    color: #FFFFFF;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 12px rgba(41, 109, 245, 0.25);
}

.exp-submit-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(41, 109, 245, 0.35);
}

.exp-submit-btn:active {
    transform: scale(0.98);
}

.exp-submit-btn:disabled, .exp-submit-btn.disabled {
    background: #E2E8F0 !important;
    color: #94A3B8 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.exp-opt-btn:disabled, .exp-opt-btn.disabled {
    cursor: not-allowed !important;
    pointer-events: none !important;
}


/* Questionnaire input styling */
.exp-text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #9FAEC6;
    border-radius: 8px;
    font-family: 'Noto Sans', sans-serif;
    font-size: 13px;
    color: #283243;
    outline: none;
    transition: all 0.2s ease-in-out;
}
.exp-text-input:focus {
    border-color: #296DF5;
    box-shadow: 0 0 0 3px rgba(41, 109, 245, 0.15);
}

.exp-spinner {
    animation: exp-spin 1s linear infinite;
}
@keyframes exp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide thinking indicator during questionnaire */
body.exp-sidebar-expanded .exp-chat-message.thinking,
body.exp-sidebar-expanded .thinking,
body.exp-sidebar-expanded .exp-thinking,
body.exp-sidebar-expanded [class*="thinking"],
body.exp-sidebar-expanded [class*="loading"],
body.exp-sidebar-expanded .exp-bubble-loading,
body.exp-sidebar-expanded .exp-message-loading,
body.exp-sidebar-expanded #exp-loader,
body.exp-sidebar-expanded .exp-loading-indicator,
body.exp-sidebar-expanded .exp-loading-msg {
    display: none !important;
}
