/* AI Chat Support Styles */

/* Chat Widget Container */
.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Chat Button */
.ai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color, #40196D);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.ai-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ai-chat-button i {
    font-size: 24px;
}

.ai-chat-button.hidden {
    display: none;
}

/* Chat Container */
.ai-chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s ease;
}

.ai-chat-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--primary-color, #40196D);
    color: white;
}

.ai-chat-title {
    font-weight: 600;
    font-size: 16px;
}

.ai-chat-controls {
    display: flex;
    gap: 10px;
}

.ai-chat-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ai-chat-controls button:hover {
    opacity: 1;
}

/* Chat Messages Area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
}

/* Message Bubbles */
.ai-message {
    display: flex;
    margin-bottom: 15px;
    max-width: 85%;
}

.ai-message.outgoing {
    margin-left: auto;
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color, #40196D);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    flex-shrink: 0;
}

.ai-message-avatar i {
    font-size: 16px;
    color: white;
}

.ai-message.outgoing .ai-message-avatar {
    background-color: #e0e0e0;
}

.ai-message-content {
    background-color: #e6e6e6;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.ai-message.outgoing .ai-message-content {
    background-color: var(--primary-color, #40196D);
    color: white;
}

.ai-message-text {
    word-break: break-word;
}

.ai-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.ai-message.outgoing .ai-message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Chat Input Area */
.ai-chat-input-container {
    display: flex;
    padding: 15px;
    background-color: white;
    border-top: 1px solid #eee;
}

#ai-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    height: 42px;
    outline: none;
    transition: border-color 0.3s;
}

#ai-chat-input:focus {
    border-color: var(--primary-color, #40196D);
}

#ai-send-chat-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--primary-color, #40196D);
    color: white;
    border: none;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

#ai-send-chat-btn:hover {
    background-color: var(--primary-dark, #321357);
}

#ai-send-chat-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator .ai-message-text {
    display: flex;
    align-items: center;
    height: 20px;
}

.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    margin-right: 4px;
    animation: typing-animation 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

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

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing-animation {

    0%,
    100% {
        transform: scale(0.7);
        opacity: 0.5;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .ai-chat-container {
        width: 300px;
        height: 400px;
        bottom: 70px;
    }

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

    .ai-chat-button i {
        font-size: 20px;
    }
}