/* ============================================================
   EUREGIOBYTE CHATBOT WIDGET
   ============================================================ */

/* Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9000;
    width: 60px;
    height: 60px;
    background: var(--orange);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(255,77,0,0.4);
    transition: background 0.2s, transform 0.2s, bottom 0.2s ease;
}

.chat-toggle:hover {
    background: var(--orange-light);
    transform: translateY(-2px);
}

.chat-toggle svg {
    width: 26px;
    height: 26px;
    fill: white;
    transition: opacity 0.2s;
}

.chat-toggle .icon-close { display: none; }
.chat-toggle.open .icon-chat { display: none; }
.chat-toggle.open .icon-close { display: block; }

/* Notification dot */
.chat-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--dark);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 108px;
    right: 32px;
    z-index: 8999;
    width: 360px;
    max-height: 520px;
    background: var(--dark2);
    border: 1px solid var(--gray);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s, bottom 0.2s ease;
}

.chat-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chat-header {
    background: var(--orange);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 14px;
    color: white;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.chat-header-info { flex: 1; }

.chat-header-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    color: white;
    letter-spacing: 1px;
    line-height: 1;
}

.chat-header-status {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: rgba(255,255,255,0.75);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

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

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: msgIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

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

.chat-msg.bot  { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }

.chat-bubble {
    padding: 11px 14px;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 2px;
}

.chat-msg.bot .chat-bubble {
    background: var(--dark3);
    color: var(--text);
    border-left: 2px solid var(--orange);
}

.chat-msg.user .chat-bubble {
    background: var(--orange);
    color: white;
}

.chat-msg-time {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 4px;
    padding: 0 2px;
}

.chat-msg.user .chat-msg-time { text-align: right; }

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 11px 14px;
    background: var(--dark3);
    border-left: 2px solid var(--orange);
    width: fit-content;
    border-radius: 2px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
    animation: typing 1.2s infinite;
}

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

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

/* Quick replies */
.chat-quick {
    padding: 0 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.quick-btn {
    background: transparent;
    border: 1px solid var(--gray);
    color: var(--text-muted);
    padding: 6px 12px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.quick-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
}

/* Input */
.chat-input-area {
    border-top: 1px solid var(--gray);
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: var(--dark3);
    border: 1px solid var(--gray);
    color: var(--text);
    padding: 10px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--orange); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send {
    width: 40px;
    height: 40px;
    background: var(--orange);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-send:hover { background: var(--orange-light); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-send svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Mobile */
@media (max-width: 768px) {
    .chat-window {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 96px;
    }
    .chat-toggle {
        right: 16px;
        bottom: 24px;
    }
}