/* ========== AI Chat Window Styles ========== */
/* Chatbot overlay styles - no global resets, safe for Antora pages */

/* === AI Search styles === */
#ai-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 998;
}

#ai-toggle:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#ai-chat {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 500px;
    height: 60vh;
    min-width: 350px;
    min-height: 250px;
    max-width: 80vw;
    max-height: 80vh;
    z-index: 999;
}

/* Ensure chat-container fills the ai-chat */
#ai-chat .chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Ensure resizable handles stay visible */
#ai-chat.ui-resizable {
    overflow: visible;
}

#ai-drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: transparent;
    cursor: move;
    z-index: 1001;
    user-select: none;
    pointer-events: auto;
}

#ai-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 14px;
    background: #fff;
}

#ai-input {
    display: flex;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

#ai-input input {
    flex: 1;
    padding: 10px 12px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
}

#ai-input input::placeholder {
    color: #999;
}

#ai-input button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

#ai-input button:hover {
    background: #5a6268;
}

/* Disable content interactions while resizing, keep chat element and resize handles active */
#ai-chat.resizing .chat-container {
    pointer-events: none;
    user-select: none;
}

/* jQuery UI custom styles - scoped to #ai-chat to avoid Antora conflicts */
#ai-chat.ui-resizable {
    outline: none !important;
    border: 1px solid #e0e0e0 !important;
}

#ai-chat.ui-resizable:focus {
    outline: none !important;
}

#ai-chat .ui-resizable-handle {
    background: transparent;
    border: none;
    z-index: 1001 !important;
}

/* Small handle styling - change cursor hints */
#ai-chat .ui-resizable-nw,
#ai-chat .ui-resizable-ne,
#ai-chat .ui-resizable-se,
#ai-chat .ui-resizable-sw {
    width: 8px;
    height: 8px;
    background: transparent;
    border: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#ai-chat .ui-resizable-nw:hover,
#ai-chat .ui-resizable-ne:hover,
#ai-chat .ui-resizable-se:hover,
#ai-chat .ui-resizable-sw:hover {
    opacity: 0.3;
    background: #4A90E2;
    border-radius: 50%;
}

/* Corner handle cursors */
#ai-chat .ui-resizable-nw { cursor: nw-resize; }
#ai-chat .ui-resizable-ne { cursor: ne-resize; }
#ai-chat .ui-resizable-se { cursor: se-resize; }
#ai-chat .ui-resizable-sw { cursor: sw-resize; }

#ai-chat .ui-resizable-n,
#ai-chat .ui-resizable-s {
    height: 4px;
    background: transparent;
    border: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#ai-chat .ui-resizable-e,
#ai-chat .ui-resizable-w {
    width: 4px;
    background: transparent;
    border: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#ai-chat .ui-resizable-n:hover,
#ai-chat .ui-resizable-s:hover,
#ai-chat .ui-resizable-e:hover,
#ai-chat .ui-resizable-w:hover {
    opacity: 0.3;
    background: #4A90E2;
}

/* Edge handle cursors */
#ai-chat .ui-resizable-n { cursor: n-resize; }
#ai-chat .ui-resizable-s { cursor: s-resize; }
#ai-chat .ui-resizable-e { cursor: e-resize; }
#ai-chat .ui-resizable-w { cursor: w-resize; }

/* Ensure no blue outlines on resizable parts */
#ai-chat .ui-resizable-handle {
    outline: none !important;
}

/* Remove any borders/outlines jQuery UI might add - scoped to #ai-chat */
#ai-chat.ui-widget-content {
    outline: none !important;
    border: 1px solid #e0e0e0 !important;
}

#ai-chat .ui-resizable-resizing {
    outline: none !important;
}

/* Keep AI chat window base style */
#ai-chat {
    outline: none !important;
}

#ai-chat:focus {
    outline: none !important;
}

#ai-chat:active {
    outline: none !important;
}

/* Visual feedback while resizing */
#ai-chat.resizing {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #4A90E2;
}

#ai-chat .ui-draggable-handle {
    cursor: move;
}

/* Extra visual feedback while resizing */
#ai-chat .ui-resizable-resizing {
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
