.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent; /* ব্যাকগ্রাউন্ড স্বচ্ছ করা হলো */
    z-index: 2000;
    display: none;
    pointer-events: none; /* পেজের অন্য জায়গায় ক্লিক করা যাবে */
}

.ai-modal-content {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: rgba(10, 10, 10, 0.75); /* ডার্ক গ্লাস ইফেক্ট */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    width: 350px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: aiPopupSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
}

@keyframes aiPopupSlide {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
        transform-origin: bottom right;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .ai-modal-content {
        bottom: 110px; /* কিবোর্ড ওপেন হলে যাতে উপরে থাকে */
        right: 15px;
        left: 15px; /* মোবাইলে ফুল উইডথ এর কাছাকাছি রাখা হলো */
        width: auto;
        max-height: 80dvh; /* স্ক্রিনের হাইটের সাথে ডাইনামিক অ্যাডজাস্ট হবে */
        transition: bottom 0.3s ease;
    }
    .ai-modal-body {
        height: 40dvh; /* বডি হাইটও ডাইনামিক করা হলো */
    }
}

.ai-modal-header {
    padding: 12px 20px; /* প্যাডিং কমিয়ে চিকন করা হলো */
    background: rgba(0, 210, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-header-info {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
}

.ai-popup-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-modal-header h3 {
    margin: 0;
    font-size: 16px; /* ফন্ট সাইজ কিছুটা কমানো হলো */
    color: #fff;
}

.ai-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    transition: 0.3s;
}

.ai-close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

.ai-modal-body {
    padding: 15px;
    height: 300px;
    display: flex;
    flex-direction: column;
    color: #fff;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 210, 255, 0.2) transparent;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.2);
    border-radius: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    animation: msgAppear 0.3s ease;
}

@keyframes msgAppear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 2px;
    color: #eee;
}

.user-msg {
    align-self: flex-end;
    background: #00d2ff;
    color: #1a1a1a;
    border-bottom-right-radius: 2px;
    font-weight: 500;
}

/* Typing Dots Animation */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: typing 1.4s infinite fill-mode;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

.ai-chat-input-container {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
}

#ai-user-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 15px;
    color: #fff;
    outline: none;
    transition: 0.3s;
}

#ai-user-input:focus {
    border-color: #00d2ff;
    background: rgba(255, 255, 255, 0.08);
}

#ai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #00d2ff;
    border: none;
    color: #1a1a1a;
    cursor: pointer;
    transition: 0.3s;
}

#ai-send-btn:hover {
    background: #00e5ff;
    transform: scale(1.05);
}

@keyframes aiFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes aiSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
