/* AYNIX Chatbot AI - Styles */

#aynix-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Toggle Button */
#aynix-chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
    transition: all 0.3s ease;
    color: white;
    pointer-events: auto;
}

#aynix-chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.5);
}

#aynix-chatbot-toggle svg {
    pointer-events: none;
}

#aynix-chatbot-toggle .close-icon {
    display: none;
}

#aynix-chatbot-toggle.active .chat-icon {
    display: none;
}

#aynix-chatbot-toggle.active .close-icon {
    display: block;
}

/* Widget Container */
#aynix-chatbot-widget {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

#aynix-chatbot-widget.active {
    display: flex;
}

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

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--aynix-primary-color), var(--aynix-secondary-color));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar svg {
    width: 24px;
    height: 24px;
}

.chatbot-minimize {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* Message Bubbles */
.message {
    display: flex;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease-out;
}

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

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

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

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

.user-message .message-content {
    background: linear-gradient(135deg, var(--aynix-primary-color), var(--aynix-secondary-color));
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typing 1.4s 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.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--aynix-primary-color);
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--aynix-primary-color), var(--aynix-secondary-color));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
}

.chatbot-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Links in messages */
.message-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.bot-message .message-content a {
    color: var(--aynix-primary-color);
}

.user-message .message-content a {
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    #aynix-chatbot-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    #aynix-chatbot-widget {
        width: 100%;
        max-width: 100%;
        height: 500px;
        bottom: 70px;
        right: 0;
        left: 0;
        border-radius: 16px 16px 0 0;
    }
    
    #aynix-chatbot-toggle {
        position: absolute;
        right: 10px;
        bottom: 80px;
    }
}

@media (max-width: 380px) {
    #aynix-chatbot-widget {
        height: 450px;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-messages {
        background: #1a202c;
    }
    
    .bot-message .message-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .chatbot-input-area {
        background: #2d3748;
        border-top-color: #4a5568;
    }
    
    .chatbot-input {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .chatbot-input::placeholder {
        color: #a0aec0;
    }
}
