/* owlchat.css - OwlOps Chat Drawer (Bootstrap 3) */

/* Chat drawer container */
.owl-chat-drawer,
#owlChatDrawer {
    position: fixed;
    top: 50px; /* below navbar */
    right: 0;
    width: 360px;
    height: calc(100% - 50px);
    background: #fff;
    border-left: 1px solid #ddd;
    box-shadow: -2px 0 6px rgba(0,0,0,.1);
    display: none;
    z-index: 1050;
}

/* Header */
.owl-chat-header {
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;
}

/* Messages */
.owl-chat-body {
    padding: 10px;
    overflow-y: auto;
    height: calc(100% - 110px);
}

/* Footer */
.owl-chat-footer {
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* Mobile default: bottom drawer */
@media (max-width: 768px) {
    #owlChatDrawer {
        width: 100%;
        height: 60%;
        top: auto;
        bottom: 0;
        right: 0;
        border-left: none;
        border-top: 1px solid #ddd;
        border-radius: 0;
    }
}

/* Mobile maximize mode */
@media (max-width: 768px) {
    #owlChatDrawer.owl-chat-max {
        height: calc(100% - 50px);
        top: 50px;
        bottom: auto;
    }

    /* If you want true full screen even over navbar, use this instead:
    #owlChatDrawer.owl-chat-max { height: 100%; top: 0; bottom: auto; }
    */
}

/* Drag handle (resizer) */
#owlChatDrawer {
    resize: none; /* disable native resize */
}

    #owlChatDrawer .owl-chat-resizer {
        position: absolute;
        left: 0;
        top: 0;
        width: 8px;
        height: 100%;
        cursor: ew-resize;
        z-index: 2;
    }

        #owlChatDrawer .owl-chat-resizer:hover {
            background: rgba(0,0,0,0.05);
        }

body.owl-chat-resizing {
    user-select: none;
    cursor: ew-resize;
}

/* Single-line thinking */
#owlChatDrawer .owl-thinking-inline {
    padding: 6px 10px;
    margin-bottom: 6px;
}

    #owlChatDrawer .owl-thinking-inline span,
    #owlChatDrawer .owl-thinking-inline strong {
        display: inline;
        padding-left: 0;
    }

/* OwlAI task list subline (used in JS ensureOwlAiStyles as well) */
.owl-ai-subline {
    color: #777;
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 560px;
}

@media (max-width:768px) {
    .owl-ai-subline {
        max-width: 320px;
    }
}

/* Table tightening */
#owlChatDrawer .table > thead > tr > th {
    font-weight: 600;
    padding: 6px 8px;
    vertical-align: middle;
}

#owlChatDrawer .table > tbody > tr > td {
    padding: 5px 8px;
    vertical-align: middle;
}

#owlChatDrawer .table td.text-right {
    font-weight: 500;
}

#owlChatDrawer .panel-heading {
    padding: 8px 10px;
}

/* Feedback */
.owl-feedback {
    margin-top: 6px;
}

    .owl-feedback .btn {
        padding: 2px 6px;
    }

/* TEMP: debug console */
.owl-debug-console {
    position: fixed;
    top: 50px; /* below navbar */
    left: 0;
    width: 420px;
    height: calc(100% - 50px);
    background: #111;
    color: #ddd;
    border-right: 1px solid #333;
    z-index: 2000;
    box-shadow: 2px 0 6px rgba(0,0,0,.3);
}

.owl-debug-header {
    padding: 8px 10px;
    background: #1b1b1b;
    border-bottom: 1px solid #333;
}

.owl-debug-log {
    padding: 10px;
    margin: 0;
    height: calc(100% - 42px);
    overflow: auto;
    white-space: pre-wrap;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: 12px;
    line-height: 1.35;
}

/* Keep header on one line */
#owlChatDrawer .owl-chat-header {
    display: -webkit-box; /* older iOS */
    display: -ms-flexbox; /* IE10 */
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 8px; /* safe spacing where supported */
}

/* Title should truncate instead of wrapping */
#owlChatDrawer .owl-chat-header > strong {
    display: block;
    min-width: 0; /* critical for truncation */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Button group should never wrap */
#owlChatDrawer .owl-chat-header .owl-chat-header-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}
