/*AIIO templates*/
.gptconn-aiio-wrapper{
    padding:50px;
    max-width:1200px;
    margin:auto;
}
#gptconn-popup-player{
    width:800px;
}
.gptconn-carousel{
    max-width:500px;
    margin:auto;
}
.gptconn-bordered{
    border:4px solid;
}
.gptconn-icon-new{
    font-size:225px!important;
    padding:50px 0;
}

/* GPTCONN Global GPT Floating Button */
.gptconn-global-gpt-button {
    position: fixed;
    z-index: 9997;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #000;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.gptconn-global-gpt-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.gptconn-global-gpt-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.gptconn-global-gpt-button i {
    font-size: 28px;
}

/* Vertical positioning */
.gptconn-gpt-button-vertical-top {
    top: 20px;
}

.gptconn-gpt-button-vertical-center {
    top: 50%;
    transform: translateY(-50%);
}

.gptconn-gpt-button-vertical-center:hover {
    transform: translateY(-50%) scale(1.1);
}

.gptconn-gpt-button-vertical-bottom {
    bottom: 20px;
}

/* Horizontal positioning */
.gptconn-gpt-button-horizontal-left {
    left: 20px;
}

.gptconn-gpt-button-horizontal-center {
    left: 50%;
    transform: translateX(-50%);
}

.gptconn-gpt-button-horizontal-center:hover {
    transform: translateX(-50%) scale(1.1);
}

.gptconn-gpt-button-horizontal-right {
    right: 20px;
}

/* Combined center positioning */
.gptconn-gpt-button-vertical-center.gptconn-gpt-button-horizontal-center {
    transform: translate(-50%, -50%);
}

.gptconn-gpt-button-vertical-center.gptconn-gpt-button-horizontal-center:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gptconn-global-gpt-button {
        width: 50px;
        height: 50px;
    }
    
    .gptconn-gpt-button-vertical-top {
        top: 15px;
    }
    
    .gptconn-gpt-button-vertical-bottom {
        bottom: 15px;
    }
    
    .gptconn-gpt-button-horizontal-left {
        left: 15px;
    }
    
    .gptconn-gpt-button-horizontal-right {
        right: 15px;
    }
    
    .gptconn-global-gpt-button i {
        font-size: 24px;
    }
}

/* Popup chat adjustments */
.gptconn-popup .gptconn-chat-shortcode {
    width: 100% !important;
    height: auto !important;
    max-height: 80vh;
    margin: 0;
}

.gptconn-popup .gptconn-chat-container {
    max-height: 80vh;
    width: 100% !important;
    display: flex;
    flex-direction: column;
}

.gptconn-popup .gptconn-chat-messages {
    max-height: calc(80vh - 150px);
    overflow-y: auto;
}

/* Ensure popup is hidden by default */
.gptconn-popup.gptconn-display-none-soft {
    display: none !important;
}

/* Ensure popup is visible when active */
.gptconn-popup.gptconn-popup-active {
    display: block !important;
}

/* Hide chat block when floating button is present (using class for better compatibility) */
body.gptconn-has-floating-button .gptconn-block-wrapper .gptconn-chat-shortcode,
body:has(.gptconn-global-gpt-button) .gptconn-block-wrapper .gptconn-chat-shortcode {
    display: none !important;
    visibility: hidden !important;
}

/* Hide ALL inline chat shortcodes when floating button is present */
body.gptconn-has-floating-button .gptconn-chat-shortcode.gptconn-chat-position-inline,
body:has(.gptconn-global-gpt-button) .gptconn-chat-shortcode.gptconn-chat-position-inline {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure chats inside popups are ALWAYS visible (override the above rules) */
.gptconn-popup .gptconn-chat-shortcode,
.gptconn-popup .gptconn-chat-shortcode.gptconn-chat-position-inline,
.gptconn-popup .gptconn-chat-shortcode.gptconn-chat-position-popup {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    width: 100% !important;
    overflow: visible !important;
}

/* Alternative for browsers that don't support :has() */
.gptconn-global-gpt-button ~ * .gptconn-block-wrapper .gptconn-chat-shortcode,
.gptconn-global-gpt-button ~ .gptconn-block-wrapper .gptconn-chat-shortcode {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure chat in popup is visible when popup is active */
.gptconn-popup.gptconn-popup-active .gptconn-chat-shortcode {
    display: block !important;
}