/* AmmoDeck Chatbot Widget Styles */

#ammodeck-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle button */
#ammodeck-chat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a3a5c;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
    position: relative;
}

#ammodeck-chat-toggle:hover {
    background: #2a5a8c;
    transform: scale(1.05);
}

#ammodeck-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Chat window */
#ammodeck-chat-window {
    display: none;
    flex-direction: column;
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    overflow: hidden;
    margin-bottom: 8px;
}

/* Header */
#ammodeck-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1a3a5c;
    color: #fff;
}

#ammodeck-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

#ammodeck-chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    display: inline-block;
}

#ammodeck-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

#ammodeck-chat-close:hover {
    opacity: 1;
}

/* Messages area */
#ammodeck-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
    scroll-behavior: smooth;
}

#ammodeck-chat-messages::-webkit-scrollbar {
    width: 5px;
}

#ammodeck-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Message bubbles */
.ammodeck-chat-msg {
    margin-bottom: 12px;
    display: flex;
}

.ammodeck-chat-user {
    justify-content: flex-end;
}

.ammodeck-chat-assistant {
    justify-content: flex-start;
}

.ammodeck-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ammodeck-chat-user .ammodeck-chat-bubble {
    background: #1a3a5c;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ammodeck-chat-assistant .ammodeck-chat-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.ammodeck-chat-bubble strong {
    font-weight: 600;
}

.ammodeck-chat-bubble em {
    font-style: italic;
}

/* Typing indicator */
.ammodeck-chat-typing .ammodeck-chat-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ammodeck-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #999;
    animation: ammodeck-bounce 1.4s infinite;
}

.ammodeck-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ammodeck-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ammodeck-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input area */
#ammodeck-chat-input-area {
    display: flex;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

#ammodeck-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#ammodeck-chat-input:focus {
    border-color: #1a3a5c;
}

#ammodeck-chat-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

#ammodeck-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a3a5c;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

#ammodeck-chat-send:hover {
    background: #2a5a8c;
}

#ammodeck-chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #ammodeck-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        bottom: 0;
        right: 0;
        border-radius: 12px 12px 0 0;
    }

    #ammodeck-chat-widget {
        bottom: 10px;
        right: 10px;
    }

    #ammodeck-chat-toggle {
        width: 50px;
        height: 50px;
    }
}