/* ═══════════════════════════════════════════════════════════════════════
   dm-ai-helpdesk.css
   Styles for the admin help desk chat panel (docked + floating modes).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Message bubbles ─────────────────────────────────────────────────── */
.dm-helpdesk-bubble {
    max-width: 90%;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.dm-helpdesk-bubble-user {
    background: var(--Color_Button_BG, #0d6efd);
    color: var(--Color_Button_Text, #fff);
    border-bottom-right-radius: 2px;
}

.dm-helpdesk-bubble-assistant {
    background: #f0f0f0;
    color: #212529;
    border-bottom-left-radius: 2px;
}

    /* ── Markdown inside assistant bubbles ───────────────────────────────── */
    .dm-helpdesk-bubble-assistant p {
        margin-bottom: 0.35em;
    }

        .dm-helpdesk-bubble-assistant p:last-child {
            margin-bottom: 0;
        }

    .dm-helpdesk-bubble-assistant code {
        background: rgba(0, 0, 0, 0.07);
        padding: 1px 3px;
        border-radius: 3px;
        font-size: 0.82em;
    }

    .dm-helpdesk-bubble-assistant pre {
        background: rgba(0, 0, 0, 0.05);
        padding: 6px;
        border-radius: 4px;
        overflow-x: auto;
        font-size: 0.82em;
        margin: 0.35em 0;
    }

        .dm-helpdesk-bubble-assistant pre code {
            background: none;
            padding: 0;
        }

    .dm-helpdesk-bubble-assistant ul,
    .dm-helpdesk-bubble-assistant ol {
        margin-bottom: 0.35em;
        padding-left: 1.3em;
    }

    .dm-helpdesk-bubble-assistant li {
        margin-bottom: 0.15em;
    }

    .dm-helpdesk-bubble-assistant h1,
    .dm-helpdesk-bubble-assistant h2,
    .dm-helpdesk-bubble-assistant h3,
    .dm-helpdesk-bubble-assistant h4,
    .dm-helpdesk-bubble-assistant h5,
    .dm-helpdesk-bubble-assistant h6 {
        font-size: 0.9em;
        font-weight: 600;
        margin-top: 0.5em;
        margin-bottom: 0.25em;
    }

        .dm-helpdesk-bubble-assistant h1:first-child,
        .dm-helpdesk-bubble-assistant h2:first-child,
        .dm-helpdesk-bubble-assistant h3:first-child {
            margin-top: 0;
        }

    .dm-helpdesk-bubble-assistant table {
        font-size: 0.82em;
        width: 100%;
        margin: 0.35em 0;
        border-collapse: collapse;
    }

    .dm-helpdesk-bubble-assistant th,
    .dm-helpdesk-bubble-assistant td {
        border: 1px solid rgba(0, 0, 0, 0.12);
        padding: 2px 5px;
    }

    .dm-helpdesk-bubble-assistant th {
        background: rgba(0, 0, 0, 0.04);
        font-weight: 600;
    }

/* ── Thinking dots ───────────────────────────────────────────────────── */
.dm-helpdesk-thinking {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

    .dm-helpdesk-thinking span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #999;
        animation: dm-helpdesk-bounce 1.2s infinite ease-in-out;
    }

        .dm-helpdesk-thinking span:nth-child(2) {
            animation-delay: 0.15s;
        }

        .dm-helpdesk-thinking span:nth-child(3) {
            animation-delay: 0.3s;
        }

@keyframes dm-helpdesk-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* ── Floating window ─────────────────────────────────────────────────── */
.dm-helpdesk-float {
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.25));
}

.dm-helpdesk-float-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
}

/* ── Drag handle (card-header in float mode) ─────────────────────────── */
.dm-helpdesk-drag-handle {
    cursor: move;
}

/* ── Resize grip (bottom-right corner) ───────────────────────────────── */
.dm-helpdesk-resize-grip {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    /* Visual indicator — diagonal lines */
    background: linear-gradient(135deg, transparent 30%, rgba(0,0,0,0.15) 30%, rgba(0,0,0,0.15) 40%, transparent 40%, transparent 55%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0.15) 65%, transparent 65%, transparent 80%, rgba(0,0,0,0.15) 80%, rgba(0,0,0,0.15) 90%, transparent 90%);
    border-radius: 0 0 6px 0;
}

.dm-helpdesk-notice {
    padding: 4px 12px;
    max-width: 90%;
    text-align: center;
}


.dm-userchat-docked {
    position: fixed;
    top: 50px; /* below toolbar */
    right: 0;
    width: 380px;
    z-index: 1050; /* above page content, below modals */
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
}
