/*
 * Echelon Chatbot — Stylesheet
 * --ec-chatbot-z controls the stacking context for both the bubble and panel,
 * making it easy to resolve conflicts with other plugins.
 */
:root {
    --ec-chatbot-z: 9999;
}

.ec-chatbot-bubble-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1877f2;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(24,119,242,0.4);
    transition: transform 0.2s;
    z-index: var(--ec-chatbot-z);
}
.ec-chatbot-bubble-btn:hover { transform: scale(1.08); background-color: #d06535;}
.ec-chatbot-bubble-btn svg { width: 28px; height: 28px; }

.ec-chatbot-panel {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 100%;
    max-width: 350px;
    background: #1877f2;
    border-radius: 8px;
    padding: 20px 20px 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: var(--ec-chatbot-z);
    display: none;
    flex-direction: column;
    font-family: "Open Sans", sans-serif;
    color: #fff;
}

.ec-chatbot-close {
    position: relative;
    float: right;
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: none;
    background: transparent;
    /* display: block; */
    margin-bottom: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ec-chatbot-close svg { width: 16px; height: 16px; display: block; }

.ec-chatbot-panel-header {
    overflow: hidden;
    margin-bottom: 4px;
}
.ec-chatbot-header-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.3;
}
.ec-chatbot-header-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 14px;
    line-height: 1.4;
}

.ec-chatbot-messages {
    height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    padding-right: 4px;
}
.ec-chatbot-messages::-webkit-scrollbar { width: 4px; }
.ec-chatbot-messages::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 2px; }
.ec-chatbot-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.4); border-radius: 2px; }

.ec-chatbot-msg {
    max-width: 90%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.ec-chatbot-msg.bot {
    background: rgba(255,255,255,0.2);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.ec-chatbot-msg.user {
    background: #fff;
    color: #1877f2;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    font-weight: 600;
}
.ec-chatbot-msg.loading { opacity: 0.6; font-style: italic; }
.ec-chatbot-msg a { color: #FFD700; text-decoration: underline; }

.ec-chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.ec-chatbot-quick-btn {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.7);
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.ec-chatbot-quick-btn:hover { background: #fff; color: #1877f2; }
.ec-chatbot-quick-btn:focus { background-color: #d06535; }
.ec-chatbot-quick-btn.dismiss { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.6); }
.ec-chatbot-quick-btn.dismiss:hover { background: rgba(255,255,255,0.15); color: #fff; }

.ec-chatbot-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ec-chatbot-input {
    flex: 1;
    border: none !important;
    border-radius: 15px !important;
    padding: 10px 14px;
    font-size: 13px;
    outline: none;
    font-family: "Open Sans", sans-serif;
    background: #fff;
    color: #333;
}
.ec-chatbot-input::placeholder { color: #aaa; }
.ec-chatbot-send {
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px;
    transition: opacity 0.15s;
}
.ec-chatbot-send:hover { opacity: 0.85 !important; background-color: #fff; }
.ec-chatbot-send:disabled { opacity: 0.4 !important; cursor: not-allowed; }
.ec-chatbot-send svg { width: 16px; height: 16px; }
.ec-chatbot-send svg path { fill: #1877f2; }

/* ── Responsive: full-width panel on narrow viewports ── */
@media (max-width: 480px) {
    .ec-chatbot-bubble-btn {
        bottom: 10px;
        left: 10px;
    }
    .ec-chatbot-panel {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }
}
