html.ai-chat-open body {
    position: relative;
}

html, body {
    touch-action: manipulation;
}

#ai-chat-widget-container {
    height: 56px;
    position: fixed;
    bottom: 20px;
    right: 50%;
    z-index: 20000;
    width: 180px;
    overflow: hidden;
    transition: all 0.3s ease, opacity 0.3s ease;
    transform: translateX(50%);
    opacity: 0;
    pointer-events: none;
}

#ai-chat-widget-container iframe{
    pointer-events: none;
}

#ai-chat-widget-container.open {
    width: 400px;
    transform: translateX(0);
    right: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    opacity: 1;
    pointer-events: auto;
    height: clamp(160px, 90vh, 640px);
}

#ai-chat-widget-container.open iframe{
    pointer-events: auto;
}

#ai-chat-iframe {
    height: 56px;
    border: none;
    width: 100%;
    transition: height 0.3s ease, width 0.3s ease;
    display: block;
    overflow: hidden;
    background: transparent !important;
    pointer-events: auto;
    touch-action: manipulation;
}

@media (min-width: 700px) {
    #ai-chat-widget-container.open, #ai-chat-widget-container.open #ai-chat-iframe {
        height: 640px;
        max-height: 90vh;
    }
}

#ai-chat-widget-container.closed {
    height: 56px !important;
    bottom: 20px;
}

/* Chat Trigger Styles */
.ai-chat-trigger {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: #ffffff;
    border: 2px solid #0066cc;
    border-radius: 100px;
    padding: 10px 20px 10px 12px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease, opacity 0.5s ease, visibility 0.5s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    width: auto;
    max-width: none;
}

/* Terms Modal Fix */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10001 !important; /* Higher than chat trigger */
    overflow: visible !important;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 98%;
    max-width: 32rem;
    max-height: 98vh;
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10002 !important;
}

.trigger-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 34px;
    width: auto;
    font-size: 14px;
}

.text-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 0 1 auto;
    align-items: flex-start;
}

.bot-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.company-name {
    font-size: 12px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    font-family: inherit;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    max-width: 150px;
}

.company-name::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
    flex-shrink: 0;
}

.bot-name {
    font-size: 12px;
    font-weight: 400;
    color: #666666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    font-family: inherit;
    transition: color 0.3s ease;
    text-align: left;
    align-self: flex-start;
    padding-left: 0;
    margin-top: -1px;
}

.bot-name::before {
    content: "Chat with ";
}

/* Mobile Styles */
@media (max-width: 700px) {
    html.ai-chat-open, html.ai-chat-open body {
        overflow: hidden !important;
    }

    html.ai-chat-open body {
        position: static !important;
    }

    .trigger-content{
        flex-direction: column;
        gap: 0;
    }

    .text-container{
        display: none;
    }

    #ai-chat-widget-container {
        width: 180px;
        bottom: env(safe-area-inset-bottom, 10px);
        transition: all 0.3s ease;
    }

    #ai-chat-widget-container.open {
        height: 100vw;
        height: 100dvh;
        left: 0;
        width: 100vw;
        bottom: 0;
    }
    
    #ai-chat-widget-container.open #ai-chat-iframe {
        border: none;
        width: 100%;
        display: block;
        overflow: auto;
        max-width: 100%;
        background: transparent !important;
    }
    
    .ai-chat-trigger {
        bottom: 30vh !important;
        left: auto !important;
        right: 0 !important;
        transform: none !important;
        padding: 7px 7px 7px 12px;
        border-radius: 30px 0 0 30px;
        min-width: 0;
    }
    
    .mobile-trigger .company-name {
        display: none !important;
    }
    
    .mobile-trigger .bot-name {
        font-size: 10px;
        margin-top: 0;
        display: flex;
        align-items: center;
    }
    
    .mobile-trigger .bot-name::before {
        content: "";
    }
    
    .mobile-trigger .bot-name::after {
        content: "Chat";
    }
    
    .mobile-trigger .bot-icon {
        width: 26px;
        height: 26px;
    }
    
    .chat-text-container {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 0;
    }
    
    .green-dot {
        color: #22c55e !important;
        font-size: 18px !important;
        line-height: 1;
    }
}

/* Hide trigger when chat is open */
html.ai-chat-open .ai-chat-trigger {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-50%) translateY(5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ai-chat-trigger {
        background: #ffffff;
        border-color: #0077dd;
    }
}

/* New Chat Button */
#ai-chat-trigger {
    font-size: 12px;
    padding: 8px 12px;
}

.chat-text-container {
    font-size: 10px;
} 

/*---------------------------------------------------------------------------------------------------------------*/
/*----Nightsbridge-----------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------*/

    .nova_ai_pulsing_logo{
        width: 206px;
        height: 62px;
        overflow: hidden;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        opacity: 0.7;
        pointer-events: none;
    }

    .nova_ai_pulsing_logo svg, .nova_ai_pulsing_logo svg *{
        fill: #000;
    }

    .nova_ai_pulsing_logo svg{
        width: 100%;
        height: 100%;
    }

    .nova_ai_pulsing_logo::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 50%;
        height: 100%;
        background: linear-gradient(
            to right,
            transparent,
            rgba(255, 255, 255, 0.6),
            transparent
        );
        transform: skewX(-25deg);
        animation: shimmer 2s infinite;
    }

    .nova_ai_pulsing_logo.fadeOut{
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    @keyframes shimmer {
        0% { left: -100%; }
        100% { left: 100%; }
    }

    #nova_nb_container{
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 22000;
    }
    .nova_nb_iframe_container{
        position: fixed;
        top: 0;
        left: 50%;
        bottom: 0;
        transform: translate(-50%,0);
        width: 100%;
        max-width: 1360px;
        background: #FFF;
    }

    #nova_nb_container .mi{
        padding: 32px;
        overflow: auto;
    }

    .nova_nb_close{
        position: fixed !important;
        right: 12px;
        top: 10px;
        width: 30px;
        height: 30px;
        line-height: 30px;
        background: #f44336;
        color: #FFF;
        text-align: center;
        border-radius: 100%;
        text-decoration: none;
        text-transform: uppercase;
        font-size: 16px;
        border: 1px solid #f44336;
        font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }

    .nova_nb_close:hover{
        background: #FFF;
        color: #f44336;
    }

    #nova_nb_container .nb_close{
        right: 0px;
        top: 0px;
    }

    #nova_nb_container .mi .nb_close{
        right: 8px;
        top: 8px;
    }

    .nova_nb_close .itdf {
        line-height: 50px;
        width: 50px;
        text-align: center;
        background: #f44336;
        color: #FFF;
        border-radius: 200px;
        display: block;
        font-size: 22px;
        border: 1px solid #f44336;
    }
    #nova_nb_container .nb_close .itdf {
        line-height: 30px;
        width: 30px;
        font-size: 16px;
    }
    .nova_nb_close .itdf:hover {
        background: #FFF;
        color: #f44336;
    }

    @media (max-width:1080px){
        #nova_nb_container .nova_nb_close{
            right: 0;
            top: 0px;
        }
    }

/*---------------------------------------------------------------------------------------------------------------*/
/*----END Nightsbridge-------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------*/