/* Floating Contact Actions (Side by Side) */
.floating-contact-actions {
    position: fixed;
    right: 33px;
    bottom: 65px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999999;
}

.realestate-chat-toggle {
    width: 56px;
    height: 56px;
    border: 2.5px solid var(--Primary-color);
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 8px 24px rgba(241, 90, 36, 0.25);
    animation: pulse-avatar 2s infinite;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.realestate-chat-toggle:hover {
    transform: scale(1.1) rotate(5deg);
}

.realestate-chat-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.whatsapp-floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 30px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.25);
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease;
}

.whatsapp-floating-btn:hover {
    background: #20ba5a;
    transform: scale(1.1);
}

@keyframes pulse-avatar {
    0% {
        box-shadow: 0 0 0 0 rgba(241, 90, 36, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(241, 90, 36, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(241, 90, 36, 0);
    }
}

.realestate-chatbot {
    position: fixed;
    right: 25px;
    bottom: 135px;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 160px);
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    z-index: 999999;
    display: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.chat-header {
    background: linear-gradient(135deg, var(--Primary-color), #ff7842);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(241, 90, 36, 0.15);
    z-index: 10;
}

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

.chat-avatar-container {
    position: relative;
    width: 46px;
    height: 46px;
}

.chat-avatar-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.online-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background-color: #2ec4b6;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.advisor-status-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.status-pulse-dot {
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: statusPulse 1.8s infinite ease-in-out;
}

.status-text {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes statusPulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.chat-close {
    font-size: 24px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s, transform 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.chat-close:hover {
    color: #ffffff;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}

.chat-body {
    padding: 20px;
    background: #f8fafc;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Beautiful Scrollbar for Chat Body */
.chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-body::-webkit-scrollbar-track {
    background: transparent;
}
.chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.chat-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Message Bubbles styling */
.bot-msg {
    background: #ffffff;
    color: #1e293b;
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
    transform-origin: left bottom;
    animation: bubbleIntro 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
}

.user-msg {
    background: linear-gradient(135deg, var(--Primary-color), #ff6a33);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 16px 16px 4px 16px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    align-self: flex-end;
    box-shadow: 0 4px 12px rgba(241, 90, 36, 0.2);
    position: relative;
    transform-origin: right bottom;
    animation: bubbleIntro 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
}

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

/* Capsule options styling */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
    animation: bubbleIntro 0.4s ease-out;
}

.option-btn {
    background: #ffffff;
    border: 1.5px solid var(--Primary-color);
    color: var(--Primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.option-btn:hover {
    background: var(--Primary-color);
    color: #ffffff;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(241, 90, 36, 0.18);
}

.option-btn:active {
    transform: translateY(0);
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    padding: 12px 18px;
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    align-self: flex-start;
    animation: bubbleIntro 0.3s ease-out;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #94a3b8;
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.3); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Persistent Input Footer styling */
.chat-footer {
    display: flex;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.chat-footer input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #1e293b;
}

.chat-footer input:focus {
    border-color: var(--Primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.08);
}

.chat-footer input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.chat-footer button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--Primary-color);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    outline: none;
    box-shadow: 0 2px 6px rgba(241, 90, 36, 0.2);
}

.chat-footer button:hover:not(:disabled) {
    background: #d84513;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(241, 90, 36, 0.3);
}

.chat-footer button:active:not(:disabled) {
    transform: scale(0.95);
}

.chat-footer button:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.whatsapp-chat-direct {
    background: #25d366 !important;
    color: #ffffff !important;
    font-weight: bold;
    padding: 12px;
    border-radius: 14px;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    transition: all 0.2s ease;
    display: block;
    margin-top: 10px;
    animation: bubbleIntro 0.3s ease-out;
}
.whatsapp-chat-direct:hover {
    background: #20ba5a !important;
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

.whatsapp-chat-direct i {
    margin-right: 6px;
    font-size: 16px;
}

@media(max-width:768px) {
    .realestate-chatbot {
        width: calc(100% - 24px);
        height: 480px;
        right: 12px;
        bottom: 145px;
        max-height: calc(100vh - 170px);
    }

    .floating-contact-actions {
        right: 15px;
        bottom: 80px;
        gap: 8px;
    }

    .realestate-chat-toggle,
    .whatsapp-floating-btn {
        width: 48px;
        height: 48px;
    }

    .whatsapp-floating-btn {
        font-size: 26px;
    }
}
