﻿/* ══════════════════════════════════════════
   CHATBOT — Masterworx Professional UI
══════════════════════════════════════════ */

/* ── Container ── */
.chatbot {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 580px;
    border-radius: 16px;
    background: #111;
    border: 1px solid rgba(212, 165, 116, 0.18);
    box-shadow: 0 24px 64px rgba(0,0,0,0.65);
    overflow: hidden;
    display: none;
    flex-direction: column;
    font-family: var(--font-main);
}

/* ── Header ── */
.chatbot-header {
    background: #0d0d0d;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    flex-shrink: 0;
}

.chatbot-logo {
    height: 26px;
    width: auto;
}

.chatbot-header h2 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--color-primary);
    flex-grow: 1;
}

.chatbot-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
    margin-right: 30px;
}

.chatbot-header-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
}

.chatbot-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 0.9rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.chatbot-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* ── Body ── */
.chatbot-body {
    flex-grow: 1;
    padding: 16px 14px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(212,165,116,0.25) transparent;
}

.chatbot-body::-webkit-scrollbar { width: 3px; }
.chatbot-body::-webkit-scrollbar-track { background: transparent; }
.chatbot-body::-webkit-scrollbar-thumb {
    background: rgba(212,165,116,0.3);
    border-radius: 3px;
}

/* ── Messages ── */
.chatbot-message {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    animation: msgIn 0.28s ease-out;
}

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

.chatbot-message p {
    margin: 0;
    padding: 10px 14px;
    font-size: 0.875rem;
    max-width: 84%;
    word-wrap: break-word;
    line-height: 1.55;
}

.chatbot-message p a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(212,165,116,0.4);
    transition: border-color 0.2s;
}

.chatbot-message p a:hover {
    border-color: var(--color-primary);
}

.chatbot-message-bot { align-items: flex-start; }
.chatbot-message-bot p {
    background: #1c1c1c;
    color: rgba(255,255,255,0.85);
    border-radius: 3px 12px 12px 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.chatbot-message-user { align-items: flex-end; }
.chatbot-message-user p {
    background: linear-gradient(135deg, var(--color-primary), #b8843f);
    color: #0e0e0e;
    font-weight: 600;
    border-radius: 12px 3px 12px 12px;
}

/* ── Typing indicator ── */
.chatbot-typing {
    flex-direction: row;
    align-items: center;
    padding: 11px 14px;
    gap: 5px;
    background: #1c1c1c;
    border-radius: 3px 12px 12px 12px;
    border: 1px solid rgba(255,255,255,0.05);
    width: fit-content;
    margin-bottom: 10px;
}

.chatbot-typing span {
    display: block;
    width: 7px;
    height: 7px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.chatbot-typing span:nth-child(1) { animation-delay: 0s; }
.chatbot-typing span:nth-child(2) { animation-delay: 0.18s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: 0.35; }
    30%            { transform: translateY(-6px); opacity: 1; }
}

/* ── Suggestion chips ── */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid rgba(212, 165, 116, 0.12);
    background: #0d0d0d;
    flex-shrink: 0;
}

.chatbot-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(212, 165, 116, 0.28);
    color: rgba(255,255,255,0.65);
    font-family: var(--font-main);
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.chatbot-chip i {
    color: var(--color-primary);
    font-size: 0.68rem;
}

.chatbot-chip:hover {
    background: rgba(212, 165, 116, 0.1);
    border-color: rgba(212,165,116,0.65);
    color: #fff;
}

/* ── Footer ── */
.chatbot-footer {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
    background: #0d0d0d;
    border-top: 1px solid rgba(212, 165, 116, 0.12);
    flex-shrink: 0;
}

.chatbot-footer input {
    flex-grow: 1;
    border: 1px solid rgba(255,255,255,0.08);
    background: #1a1a1a;
    color: rgba(255,255,255,0.9);
    padding: 10px 13px;
    border-radius: 8px;
    outline: none;
    font-size: 0.875rem;
    font-family: var(--font-main);
    transition: border-color 0.2s;
    min-width: 0;
}

.chatbot-footer input::placeholder {
    color: rgba(255,255,255,0.28);
}

.chatbot-footer input:focus {
    border-color: rgba(212,165,116,0.45);
}

.chatbot-footer button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #0e0e0e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chatbot-footer button:hover {
    background: #c49050;
    box-shadow: 0 3px 10px rgba(212,165,116,0.35);
}

.chatbot-footer input:disabled,
.chatbot-footer button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Toggle button ── */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--color-primary);
    color: #0e0e0e;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(212,165,116,0.3);
}
