/* AI Chat Bubble Styles */
:root {
    --chat-navy: #0f172a;
    --chat-gold: #c5a059;
    --chat-white: #ffffff;
    --chat-glass: rgba(255, 255, 255, 0.05);
    --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.chat-widget-container {
    position: fixed;
    bottom: 20px;
    left: 20px; /* Positioned on the left to avoid conflict with WhatsApp button */
    z-index: 9999;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    background: var(--chat-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0) translateY(20px);
}

.chat-bubble.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(197, 160, 89, 0.5);
}

.chat-window {
    position: absolute;
    bottom: 75px;
    left: 0;
    width: 350px;
    height: 500px;
    background: var(--chat-navy);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--chat-shadow);
    border: 1px solid rgba(197, 160, 89, 0.3);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom left;
}

.chat-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--chat-gold);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 35px;
    height: 35px;
    background: var(--chat-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.chat-header-text h4 {
    margin: 0;
    color: white;
    font-size: 1rem;
}

.chat-header-text span {
    font-size: 0.75rem;
    color: #94a3b8;
}

.close-chat {
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

.close-chat:hover {
    color: white;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0f172a;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    animation: messageEntry 0.3s ease;
}

@keyframes messageEntry {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-glass);
    color: #e2e8f0;
    border-top-right-radius: 2px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-gold);
    color: white;
    border-top-left-radius: 2px;
}

.chat-input-area {
    padding: 12px;
    background: #1e293b;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(197, 160, 89, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    outline: none;
    transition: 0.3s;
    font-size: 0.9rem;
}

.chat-input:focus {
    border-color: var(--chat-gold);
}

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

.send-btn:hover {
    transform: rotate(-15deg) scale(1.1);
}

/* Scrollbar Style */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(197, 160, 89, 0.2);
    border-radius: 10px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-widget-container {
        bottom: 15px;
        left: 15px;
    }
    
    .chat-bubble {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .chat-window {
        width: calc(100vw - 30px);
        height: 60vh;
        bottom: 70px;
    }
}
