/* AI Content Chatbot - Frontend Styles */

#ai-chatbot-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

#ai-chatbot-container.chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

#ai-chatbot-container.chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toggle Button */
.ai-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073aa;
    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;
}

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

.ai-chatbot-button:active {
    transform: scale(0.95);
}

.ai-chatbot-button svg {
    position: absolute;
    transition: opacity 0.2s ease;
}

.ai-chatbot-button .chatbot-icon {
    opacity: 1;
}

.ai-chatbot-button .close-icon {
    opacity: 0;
}

.ai-chatbot-button.active .chatbot-icon {
    opacity: 0;
}

.ai-chatbot-button.active .close-icon {
    opacity: 1;
}

/* Chatbot Window */
.ai-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

#ai-chatbot-container.chatbot-bottom-left .ai-chatbot-window {
    left: 0;
    right: auto;
}

/* Header */
.ai-chatbot-header {
    background-color: #0073aa;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

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

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

.ai-chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

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

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

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

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

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

/* Message Bubbles */
.ai-chatbot-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    animation: messageSlide 0.3s ease;
}

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

.ai-chatbot-message.bot {
    background: #ffffff;
    color: #2d3748;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ai-chatbot-message.user {
    background: #0073aa;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-chatbot-message.error {
    background: #fc8181;
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.ai-chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ai-chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ai-chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input Container */
.ai-chatbot-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.ai-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.ai-chatbot-input:focus {
    border-color: #0073aa;
}

.ai-chatbot-send-btn {
    width: 44px;
    height: 44px;
    background-color: #0073aa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-chatbot-send-btn:hover {
    background-color: #005a87;
    transform: scale(1.05);
}

.ai-chatbot-send-btn:active {
    transform: scale(0.95);
}

.ai-chatbot-send-btn:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* Powered By */
.ai-chatbot-powered-by {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #a0aec0;
    background: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
    }
    
    #ai-chatbot-container.chatbot-bottom-right {
        right: 10px;
        bottom: 10px;
    }
    
    #ai-chatbot-container.chatbot-bottom-left {
        left: 10px;
        bottom: 10px;
    }
}

