:root {
    --chat-primary: #d90202;
    --chat-secondary: #111111;
    --chat-bg: #ffffff;
    --chat-text: #333333;
    --chat-bot-msg: #f0f2f5;
    --chat-user-msg: #d90202;
}

.ai-chatbot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2147483646;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.ai-chatbot-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ai-chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--chat-primary), #a30101);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(217, 2, 2, 0.4);
    z-index: 2147483647;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(217, 2, 2, 0.5);
}

.ai-chatbot-toggle i {
    color: white;
    font-size: 24px;
}

.ai-chatbot-window {
    position: fixed;
    bottom: 95px;
    right: 30px;
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: var(--chat-bg);
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483647;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ai-chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ai-chatbot-header {
    background: linear-gradient(to right, #d90202, #b30202);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    color: white;
}

.ai-chatbot-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: white;
    object-fit: cover;
}

.ai-chatbot-header-info h4 {
    margin: 0;
    font-size: 16px;
    color: white;
    font-weight: 700;
}

.ai-chatbot-header-info span {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chatbot-header-info span::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #00ff0a;
    border-radius: 50%;
    display: inline-block;
}

.ai-chatbot-close {
    margin-left: auto;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.8;
    transition: 0.3s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chatbot-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

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

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

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

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

.ai-message {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 13.5px;
    line-height: 1.45;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message.bot {
    align-self: flex-start;
    background: #f1f3f5;
    color: #222;
    border-bottom-left-radius: 2px;
}

.ai-chatbot-input-area {
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-chatbot-input-area input {
    flex: 1;
    border: 1px solid #e8e8e8;
    padding: 10px 15px;
    border-radius: 20px;
    outline: none;
    transition: 0.3s;
    font-size: 13px;
    background: #fcfcfc;
}

.ai-chatbot-input-area input:focus {
    border-color: var(--chat-primary);
    background: white;
}

.ai-chatbot-send {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.ai-chatbot-send:hover {
    background: #a30101;
    transform: scale(1.05);
}

.ai-chatbot-send i {
    font-size: 14px;
}

@media (max-width: 480px) {
    .ai-chatbot-window {
        width: calc(100% - 30px);
        height: 480px;
        right: 15px;
        bottom: 85px;
    }

    .ai-chatbot-toggle {
        right: 15px;
        bottom: 20px;
        width: 50px;
        height: 50px;
    }
}