/**
 * Axsys Documentation Chatbot Widget Styles
 */

#axsys-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Toggle Button */
.axsys-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.axsys-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.axsys-chat-icon,
.axsys-close-icon {
    width: 28px;
    height: 28px;
    color: white;
    position: absolute;
    transition: all 0.3s ease;
}

.axsys-chat-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.axsys-close-icon {
    opacity: 0;
    transform: rotate(90deg);
}

#axsys-chatbot-container:not(.axsys-chatbot-closed) .axsys-chat-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

#axsys-chatbot-container:not(.axsys-chatbot-closed) .axsys-close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Chat Window */
.axsys-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: scale(1);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.axsys-chatbot-closed .axsys-chat-window {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

/* Chat Header */
.axsys-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
}

.axsys-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.axsys-chat-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Messages Container */
.axsys-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f8fa;
}

.axsys-message {
    margin-bottom: 16px;
    display: flex;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.axsys-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.axsys-user-message {
    justify-content: flex-end;
}

.axsys-user-message .axsys-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.axsys-bot-message {
    justify-content: flex-start;
}

.axsys-bot-message .axsys-message-content {
    background: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.axsys-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.axsys-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.axsys-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.axsys-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Input Container */
.axsys-chat-input-container {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    gap: 8px;
    align-items: flex-end;
}

.axsys-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

.axsys-chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.axsys-chat-input:disabled {
    background: #f7f8fa;
    cursor: not-allowed;
}

.axsys-send-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.axsys-send-button:hover:not(:disabled) {
    transform: scale(1.05);
}

.axsys-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.axsys-send-button svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Scrollbar Styling */
.axsys-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.axsys-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.axsys-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.axsys-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #axsys-chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .axsys-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
    }

    .axsys-chat-button {
        width: 50px;
        height: 50px;
    }

    .axsys-chat-icon,
    .axsys-close-icon {
        width: 24px;
        height: 24px;
    }
}
