/* Globally hide the old overlapping widgets */
.WA_Chat_Widget, .back-to-top, #topBtn {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Chat Hub Wrapper */
.chat-hub-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

/* The Options (WhatsApp & AI) */
.chat-hub-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px) scale(0.5);
    transform-origin: bottom center;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chat-hub-options.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-hub-option { width: 70px; height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 35px; color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s;
    text-decoration: none;
}
.chat-hub-option:hover {
    transform: scale(1.15);
    text-decoration: none;
    color: white;
}
.chat-hub-option.whatsapp {
    background-color: #25D366;
}
.chat-hub-option.whatsapp:hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}
.chat-hub-option.ai {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fbbf24;
    border: 2px solid #fbbf24;
}

/* Main Hub Button */
.chat-hub-btn { width: 80px; height: 80px;
    background-color: #fbbf24;
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px; cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transition: all 0.4s ease;
    border: 2px solid #ffffff;
}
.chat-hub-btn i {
    transition: transform 0.4s;
}
.chat-hub-btn.active {
    background-color: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}
.chat-hub-btn.active i {
    transform: rotate(360deg) scale(0.9);
}
.chat-hub-btn.active i::before {
    content: "\f00d"; /* FontAwesome times (X) icon */
}

/* AI Chat Window overrides */
.ai-chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    left: auto;
    width: 360px;
    height: 520px;
    max-height: 75vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.9);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #e2e8f0;
}
.ai-chat-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ai-header { background: linear-gradient(135deg, #0f172a, #1e293b); color: #fbbf24; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; }
.ai-header h3 { margin: 0; font-size: 1.15rem; color: #fbbf24; font-weight: 800; display:flex; align-items:center; }
.ai-header i { cursor:pointer; font-size: 1.4rem; transition:color 0.3s; }
.ai-header i:hover { color: #ffffff; }

.ai-body { flex: 1; padding: 20px; overflow-y: auto; background: #f8fafc; display: flex; flex-direction: column; gap: 12px; }
.ai-bubble { max-width: 85%; padding: 12px 18px; border-radius: 16px; font-size: 0.95rem; line-height: 1.5; animation: fadeIn 0.3s ease; }
.ai-bubble.bot { background: #e2e8f0; color: #0f172a; align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-bubble.user { background: #fbbf24; color: #0f172a; align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 600; }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-suggestion-btn { background: #ffffff; border: 1px solid #cbd5e1; color: #0f172a; padding: 8px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.ai-suggestion-btn:hover { background: #fbbf24; color: #0f172a; border-color: #fbbf24; }

.ai-input-area { padding: 15px 20px; background: #ffffff; border-top: 1px solid #e2e8f0; display: flex; gap: 12px; }
.ai-input-area input { flex: 1; border: 2px solid #e2e8f0; border-radius: 25px; padding: 10px 18px; outline: none; font-size: 0.95rem; transition: border-color 0.3s; }
.ai-input-area input:focus { border-color: #fbbf24; }
.ai-input-area button { background: #0f172a; color: #fbbf24; border: none; border-radius: 50%; width: 45px; height: 45px; cursor: pointer; display:flex; justify-content:center; align-items:center; transition: all 0.3s; font-size: 18px; }
.ai-input-area button:hover { background: #fbbf24; color: #0f172a; transform: scale(1.05); }

@keyframes fadeIn { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }
/* Responsive Enhancements for Mobile Devices */
@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 40px) !important;
        right: 20px !important;
        bottom: 110px !important;
        height: 60vh !important;
    }
    .chat-hub-wrapper {
        right: 20px !important;
        bottom: 20px !important;
        transform: scale(0.85) !important;
        transform-origin: bottom right !important;
    }
}
