/* AI Chatbot Widget Styles - Main App (Blue Theme) */

/* Widget Container */
#ai-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

/* Toggle Button */
.ai-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.4);
    background-color: #0d6efd;
    /* Bootstrap Primary */
    color: white;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

.ai-chat-btn:hover {
    transform: scale(1.1);
    background-color: #0b5ed7;
}

/* Chat Window */
.ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f8f9fa;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #dee2e6;
    border-radius: 10px;
}

/* Message Bubbles */
.message {
    margin-bottom: 1rem;
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    background: #fff;
    color: #212529;
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-right: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message.user {
    background: #0d6efd;
    /* Primary Blue */
    color: #fff;
    border-bottom-right-radius: 0.25rem;
    margin-left: auto;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
    text-align: right;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing indicator */
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #adb5bd;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 1px;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Markdown Styling inside Chat */
.message.bot p {
    margin-bottom: 0.5rem;
}

.message.bot p:last-child {
    margin-bottom: 0;
}

.message.bot strong,
.message.bot b {
    color: #0d6efd;
    font-weight: 700;
}

.message.bot ul,
.message.bot ol {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.message.bot li {
    margin-bottom: 0.25rem;
}

.message.bot a {
    color: #0d6efd;
    text-decoration: underline;
}

.message.bot a:hover {
    color: #0a58ca;
}

/* Online Status Dot */
.online-status-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background-color: #28a745;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 10001;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Shake Animation for Alerts */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
}