:root {
    --axsa-primary: #1A1A1A;
    --axsa-accent: #D4AF37;
    --axsa-gold: #D4AF37;
    --axsa-cream: #F5F0E8;
    --axsa-dark: #000000;
    --axsa-white: #FFFFFF;
    --axsa-gray: #F4F4F4;
    --axsa-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --axsa-radius: 16px;
}

#axsa-chat-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

#axsa-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--axsa-primary);
    color: var(--axsa-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--axsa-shadow);
    transition: transform 0.2s, background 0.2s;
}

#axsa-chat-toggle:hover {
    background: var(--axsa-accent);
    transform: scale(1.08);
}

#axsa-chat-panel {
    display: none;
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: var(--axsa-white);
    border-radius: var(--axsa-radius);
    box-shadow: var(--axsa-shadow);
    overflow: hidden;
    flex-direction: column;
}

#axsa-chat-container.axsa-open #axsa-chat-panel {
    display: flex;
}

#axsa-chat-container.axsa-open #axsa-icon-chat {
    display: none;
}

#axsa-chat-container.axsa-open #axsa-icon-close {
    display: block;
}

#axsa-chat-container.axsa-closed #axsa-icon-close {
    display: none;
}

#axsa-chat-header {
    background: var(--axsa-primary);
    color: var(--axsa-white);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#axsa-chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#axsa-chat-header-info strong {
    font-size: 15px;
}

#axsa-chat-header-info span {
    font-size: 12px;
    opacity: 0.85;
}

#axsa-chat-close {
    background: none;
    border: none;
    color: var(--axsa-white);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

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

#axsa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 350px;
    background: var(--axsa-gray);
}

.axsa-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    animation: axsa-fade-in 0.3s ease;
}

@keyframes axsa-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.axsa-msg p {
    margin: 0 0 8px;
}

.axsa-msg p:last-child {
    margin-bottom: 0;
}

.axsa-msg a {
    color: var(--axsa-primary);
    text-decoration: underline;
    word-break: break-word;
}

.axsa-msg-bot a:hover {
    color: var(--axsa-accent);
}

.axsa-msg ul,
.axsa-msg ol {
    margin: 4px 0 8px;
    padding-left: 20px;
}

.axsa-msg li {
    margin-bottom: 6px;
    line-height: 1.45;
}

.axsa-msg li:last-child {
    margin-bottom: 0;
}

.axsa-msg strong {
    color: var(--axsa-primary);
    font-weight: 600;
}

.axsa-msg-user strong {
    color: inherit;
}

.axsa-msg-bot {
    background: var(--axsa-white);
    color: var(--axsa-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.axsa-msg-user {
    background: var(--axsa-primary);
    color: var(--axsa-white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.axsa-msg-user a {
    color: var(--axsa-cream);
}

.axsa-typing {
    align-self: flex-start;
    background: var(--axsa-white);
    padding: 10px 18px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.axsa-typing-dots {
    display: flex;
    gap: 4px;
}

.axsa-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--axsa-accent);
    border-radius: 50%;
    animation: axsa-bounce 1.4s infinite ease-in-out;
}

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

@keyframes axsa-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

#axsa-chat-input-area {
    display: flex;
    padding: 12px;
    gap: 8px;
    border-top: 1px solid #E5E5E5;
    background: var(--axsa-white);
    flex-shrink: 0;
}

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

#axsa-chat-input:focus {
    border-color: var(--axsa-primary);
}

#axsa-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--axsa-primary);
    color: var(--axsa-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

#axsa-chat-send:hover {
    background: var(--axsa-accent);
}

#axsa-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    #axsa-chat-container {
        bottom: 0;
        right: 0;
        left: 0;
    }

    #axsa-chat-container.axsa-open {
        top: 0;
    }

    #axsa-chat-container.axsa-open #axsa-chat-toggle {
        display: none;
    }

    #axsa-chat-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    #axsa-chat-messages {
        max-height: none;
        flex: 1;
    }

    #axsa-chat-toggle {
        position: fixed;
        bottom: 16px;
        right: 16px;
    }
}
