/* Arena Aptrack - AI Chatbot Widget */
#arena-chat-wrapper * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* Toggle Button */
.arena-chat-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#arena-chat-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    box-shadow: none !important;
    transition: transform 0.2s;
    position: relative;
    padding: 0;
}

#arena-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,0.3);
}

/* Chat Window */
#arena-chat-window {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 360px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: arenaChatOpen 0.2s ease-out;
}

@keyframes arenaChatOpen {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    #arena-chat-window {
        width: calc(100vw - 24px);
        right: -12px;
        height: 460px;
    }
}

/* Header */
#arena-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #fff;
    flex-shrink: 0;
}

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

.arena-chat-avatar {
    font-size: 1.6rem;
    line-height: 1;
}

.arena-chat-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.arena-chat-status {
    font-size: 0.75rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}

.arena-chat-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: arenaPulse 2s infinite;
}

@keyframes arenaPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

#arena-chat-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#arena-chat-close-btn:hover { background: rgba(255,255,255,0.35); }

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

#arena-chat-messages::-webkit-scrollbar { width: 4px; }
#arena-chat-messages::-webkit-scrollbar-track { background: #f1f1f1; }
#arena-chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.arena-chat-msg { display: flex; }
.arena-chat-msg--bot  { justify-content: flex-start; }
.arena-chat-msg--user { justify-content: flex-end; }

.arena-chat-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.arena-chat-msg--bot  .arena-chat-bubble { background: #f1f3f5; color: #333; border-bottom-left-radius: 4px; }
.arena-chat-msg--user .arena-chat-bubble { background: #e8431a; color: #fff; border-bottom-right-radius: 4px; }

/* Typing indicator */
#arena-chat-typing { padding: 0 16px 8px; }

.arena-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.arena-typing-indicator span {
    width: 7px;
    height: 7px;
    background: #999;
    border-radius: 50%;
    animation: arenaTypingBounce 1.2s infinite;
}

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

@keyframes arenaTypingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-6px); }
}

/* Quick Reply Buttons */
#arena-chat-buttons-container {
    padding: 0 12px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.arena-quick-btn {
    border: 1.5px solid #e8431a;
    color: #e8431a;
    background: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.arena-quick-btn:hover {
    background: #e8431a;
    color: #fff;
}

/* Input Area */
#arena-chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

#arena-chat-input {
    flex: 1;
    border: 1.5px solid #ddd;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    color: #333;
}

#arena-chat-input:focus { border-color: #e8431a; }

#arena-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s;
}

#arena-chat-send:hover { transform: scale(1.1); }
#arena-chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
