/* AI Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 9999;
    font-family: 'Outfit', sans-serif;
}

/* Chat Toggle Button */
.chatbot-toggler {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary, #0056D2);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggler:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: var(--primary-dark, #0043a6);
}

.chatbot-toggler svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chatbot-toggler .close-icon {
    position: absolute;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

.chatbot-container.is-open .chatbot-toggler .chat-icon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.chatbot-container.is-open .chatbot-toggler .close-icon {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chatbot-container.is-open .chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Chat Header */
.chat-header {
    background: var(--primary, #0056D2);
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-bot-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

/* Chat Body (Messages) */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar for chat body */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message-user {
    align-self: flex-end;
    background: var(--primary, #0056D2);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 86, 210, 0.2);
}

/* Typing Indicator */
.chat-typing {
    display: flex;
    gap: 4px;
    padding: 14px 16px;
    align-self: flex-start;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.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;
}

@keyframes typing {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Chat Input Area */
.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: #f1f3f5;
    border-radius: 20px;
    padding: 5px 15px;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    outline: none;
    color: #333;
}

.chat-send-btn {
    background: transparent;
    border: none;
    color: var(--primary, #0056D2);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: transform 0.2s ease;
}

.chat-send-btn:hover {
    transform: scale(1.1);
}

.chat-send-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 80px;
        right: -10px;
        width: calc(100vw - 40px);
        height: 60vh;
    }
}