/* ═══════════════════════════════════════════════════════
   CHATBOT FLOATING WIDGET — Zone-All Troubleshooting
   Place in: assets/css/chatbot.css
═══════════════════════════════════════════════════════ */

/* ─── FAB TOGGLE BUTTON ──────────────────────────────── */

.chatbot-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    background: #e53935;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.45);
    z-index: 9000;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-fab:hover {
    background: #c62828;
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(229, 57, 53, 0.55);
}

.chatbot-fab svg {
    width: 26px;
    height: 26px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.chatbot-fab .icon-chat  { position: absolute; }
.chatbot-fab .icon-close { position: absolute; opacity: 0; transform: rotate(-90deg); }

.chatbot-fab.is-open .icon-chat  { opacity: 0; transform: rotate(90deg); }
.chatbot-fab.is-open .icon-close { opacity: 1; transform: rotate(0deg); }

/* ─── CHAT PANEL ─────────────────────────────────────── */

.chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 420px;
    height: 620px;
    background: #0b1f2e;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(11, 31, 46, 0.35), 0 2px 8px rgba(11, 31, 46, 0.15);
    z-index: 8999;
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform-origin: bottom right;
}

.chatbot-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ─── HEADER ─────────────────────────────────────────── */

.chatbot-header {
    background: #0b1f2e;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.chatbot-brand {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    line-height: 1;
}

.chatbot-brand-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #e53935;
    border-radius: 50%;
    margin: 0 3px;
    vertical-align: middle;
}

.chatbot-brand-sub {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    margin-top: 3px;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-restart {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.chatbot-restart:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ─── MESSAGES ───────────────────────────────────────── */

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f5f6f8;
}

.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(11, 31, 46, 0.2);
    border-radius: 4px;
}

/* ─── MESSAGE BUBBLES ────────────────────────────────── */

.chatbot-msg {
    display: flex;
    flex-direction: column;
    gap: 3px;
    animation: chatFadeUp 0.22s ease;
}

@keyframes chatFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chatbot-msg.bot  { align-self: flex-start; max-width: 90%; }
.chatbot-msg.user { align-self: flex-end;   max-width: 78%; }

.chatbot-msg-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(11, 31, 46, 0.32);
    padding: 0 4px;
    font-family: Arial, Helvetica, sans-serif;
}

.chatbot-msg.user .chatbot-msg-label { text-align: right; }

.chatbot-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.65;
    font-family: Arial, Helvetica, sans-serif;
}

.chatbot-msg.bot .chatbot-bubble {
    background: white;
    color: #0b1f2e;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(11, 31, 46, 0.08);
}

.chatbot-msg.user .chatbot-bubble {
    background: #0b1f2e;
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-bubble b { color: #e53935; }

.chatbot-bubble .cb-step {
    display: flex;
    gap: 8px;
    margin: 5px 0;
}

.chatbot-bubble .cb-stepnum {
    background: rgba(229, 57, 53, 0.12);
    color: #e53935;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
    flex-shrink: 0;
}

.chatbot-bubble .cb-warn {
    background: rgba(229, 57, 53, 0.06);
    border-left: 3px solid #e53935;
    border-radius: 0;
    padding: 8px 10px;
    margin-top: 8px;
    font-size: 13px;
    color: rgba(11, 31, 46, 0.7);
}

.chatbot-bubble .cb-ok {
    background: rgba(46, 125, 50, 0.06);
    border-left: 3px solid #2e7d32;
    border-radius: 0;
    padding: 8px 10px;
    margin-top: 8px;
    font-size: 13px;
    color: rgba(11, 31, 46, 0.7);
}

.chatbot-bubble .cb-contact-link {
    display: inline-block;
    margin-top: 10px;
    background: #e53935;
    color: white;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.chatbot-bubble .cb-contact-link:hover { background: #c62828; }

/* ─── CHOICES ────────────────────────────────────────── */

.chatbot-choices {
    background: #0b1f2e;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.chatbot-choice {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    text-align: left;
    line-height: 1.3;
}

.chatbot-choice:hover {
    background: #e53935;
    border-color: #e53935;
}

.chatbot-choice.wide { width: 100%; }

/* ─── RESPONSIVE ─────────────────────────────────────── */

@media (max-width: 480px) {
    .chatbot-panel {
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }
    .chatbot-fab {
        bottom: 20px;
        right: 20px;
    }
}