/* ============================================
   FLOATING CHAT WIDGET — BRUTALIST
   ============================================ */

.chat-widget-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--accent);
    border: 2px solid var(--accent);
    color: var(--bg);
    cursor: pointer;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    box-shadow: 4px 4px 0 rgba(255, 77, 0, 0.3);
}

.chat-widget-toggle:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(255, 77, 0, 0.3);
}

.chat-widget-toggle svg {
    width: 24px;
    height: 24px;
}

.chat-widget {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: var(--bg-card);
    border: 2px solid var(--border-hard);
    z-index: 901;
    display: none;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.2s;
}

.chat-widget.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.chat-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border);
}

.chat-widget-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-widget-status {
    width: 8px;
    height: 8px;
    background: var(--green);
}

.chat-widget-header-left span {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chat-widget-close {
    background: none;
    border: 1px solid var(--border-hard);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.chat-widget-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-widget-messages::-webkit-scrollbar { width: 4px; }
.chat-widget-messages::-webkit-scrollbar-track { background: transparent; }
.chat-widget-messages::-webkit-scrollbar-thumb { background: var(--border-hard); }

.widget-msg {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid var(--border);
}

.widget-msg.bot {
    align-self: flex-start;
    background: var(--bg-elevated);
    color: var(--text);
    border-left: 3px solid var(--accent);
}

.widget-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--bg);
    border: none;
    font-weight: 500;
}

.widget-msg a {
    color: var(--accent);
    text-decoration: underline;
    border-bottom: none;
}

.widget-msg.user a {
    color: var(--bg);
}

.widget-welcome {
    text-align: center;
    padding: 24px 12px;
}

.widget-welcome h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--white);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.widget-welcome p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.widget-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.widget-suggestions button {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-hard);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.15s;
}

.widget-suggestions button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chat-widget-input {
    display: flex;
    border-top: 2px solid var(--border);
}

.chat-widget-input input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 16px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
}

.chat-widget-input input::placeholder {
    color: var(--text-muted);
}

.chat-widget-input button {
    background: var(--accent);
    border: none;
    padding: 14px 18px;
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.15s;
}

.chat-widget-input button:hover {
    background: var(--accent-hover);
}

.widget-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}

.widget-typing span {
    width: 5px;
    height: 5px;
    background: var(--text-muted);
    animation: blink 1.2s infinite;
}

.widget-typing span:nth-child(2) { animation-delay: 0.2s; }
.widget-typing span:nth-child(3) { animation-delay: 0.4s; }

.chat-widget-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 899;
}

.chat-widget-overlay.active {
    display: block;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 640px) {
    .chat-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
    }

    .chat-widget-toggle {
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 380px) {
    .chat-widget-toggle {
        width: 48px;
        height: 48px;
    }
}
