/* ═══════════════════════════════════════════
   aurent AI Chatbot — Floating Widget Styles
   ═══════════════════════════════════════════ */

:root {
    --cb-primary: #5CB7AC;
    --cb-primary-dark: #4A9E94;
    --cb-primary-light: rgba(92, 183, 172, 0.12);
    --cb-bg: #ffffff;
    --cb-surface: #f5f7fa;
    --cb-text: #2d3748;
    --cb-text-light: #718096;
    --cb-bot-bubble: #f0f2f5;
    --cb-user-bubble: #5CB7AC;
    --cb-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    --cb-radius: 20px;
    --cb-font: 'Poppins', sans-serif;
}

/* ── Floating Toggle Button ── */
.chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-primary-dark));
    border: none;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(92, 183, 172, 0.45);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
    animation: chatbot-pulse 2.5s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(92, 183, 172, 0.55);
}

.chatbot-toggle.active {
    animation: none;
    transform: rotate(90deg);
}

.chatbot-toggle.active+.chatbot-badge {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.chatbot-toggle.active:hover {
    transform: rotate(90deg) scale(1.1);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
    transition: opacity 0.2s ease;
}

.chatbot-toggle .icon-close {
    display: none;
}

.chatbot-toggle.active .icon-chat {
    display: none;
}

.chatbot-toggle.active .icon-close {
    display: block;
}

@keyframes chatbot-pulse {

    0%,
    100% {
        box-shadow: 0 6px 24px rgba(92, 183, 172, 0.45);
    }

    50% {
        box-shadow: 0 6px 32px rgba(92, 183, 172, 0.7);
    }
}

/* ── Notification Badge ── */
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #e53e3e;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--cb-font);
    border: 2px solid #fff;
    animation: chatbot-badge-pop 0.3s ease;
    z-index: 10001;
    pointer-events: none;
}

@keyframes chatbot-badge-pop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

/* ── Chat Window ── */
.chatbot-window {
    position: fixed;
    bottom: 150px;
    right: 25px;
    width: 380px;
    height: 520px;
    background: var(--cb-bg);
    border-radius: var(--cb-radius);
    box-shadow: var(--cb-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10001;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--cb-font);
}

.chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ── Header ── */
.chatbot-header {
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-primary-dark));
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.chatbot-header-info h4 {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--cb-font);
    line-height: 1.3;
}

.chatbot-header-info span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-header-info span::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #68d391;
    border-radius: 50%;
    display: inline-block;
}

/* ── Close Button in Header ── */
.chatbot-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.chatbot-close svg {
    width: 16px;
    height: 16px;
    fill: #ffffff;
}

/* ── Messages Area ── */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--cb-surface);
    scroll-behavior: smooth;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

/* ── Message Bubbles ── */
.chatbot-msg {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: chatbot-msg-in 0.3s ease;
}

.chatbot-msg.bot {
    align-self: flex-start;
}

.chatbot-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--cb-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 4px;
}

.chatbot-msg.user .chatbot-msg-avatar {
    display: none;
}

.chatbot-msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--cb-text);
    word-wrap: break-word;
}

.chatbot-msg.bot .chatbot-msg-bubble {
    background: var(--cb-bot-bubble);
    border-bottom-left-radius: 6px;
}

.chatbot-msg.user .chatbot-msg-bubble {
    background: var(--cb-user-bubble);
    color: #ffffff;
    border-bottom-right-radius: 6px;
}

.chatbot-msg-bubble a {
    color: var(--cb-primary-dark);
    text-decoration: underline;
    font-weight: 500;
}

.chatbot-msg.user .chatbot-msg-bubble a {
    color: #ffffff;
    text-decoration: underline;
}

@keyframes chatbot-msg-in {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Typing Indicator ── */
.chatbot-typing {
    display: flex;
    gap: 8px;
    align-self: flex-start;
    max-width: 88%;
}

.chatbot-typing-dots {
    background: var(--cb-bot-bubble);
    padding: 14px 20px;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.chatbot-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a0aec0;
    animation: chatbot-dot-bounce 1.4s infinite;
}

.chatbot-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatbot-dot-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* ── Quick Reply Chips ── */
.chatbot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    animation: chatbot-msg-in 0.3s ease;
}

.chatbot-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--cb-primary);
    background: transparent;
    color: var(--cb-primary-dark);
    font-size: 12.5px;
    font-weight: 500;
    font-family: var(--cb-font);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chatbot-chip:hover {
    background: var(--cb-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ── Input Area ── */
.chatbot-input-area {
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--cb-bg);
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    padding: 0 18px;
    height: 40px;
    margin: 0;
    box-sizing: border-box;
    font-size: 13.5px;
    font-family: var(--cb-font);
    color: var(--cb-text);
    outline: none;
    transition: border-color 0.2s ease;
    background: var(--cb-surface);
}

.chatbot-input::placeholder {
    color: var(--cb-text-light);
}

.chatbot-input:focus {
    border-color: var(--cb-primary);
    background: var(--cb-bg);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--cb-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--cb-primary-dark);
    transform: scale(1.05);
}

.chatbot-send:active {
    transform: scale(0.95);
}

.chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

/* ── WhatsApp Button ── */
.chatbot-wa-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.85;
}

.chatbot-wa-btn:hover {
    transform: scale(1.12);
    opacity: 1;
}

.chatbot-wa-btn:active {
    transform: scale(0.95);
}

.chatbot-wa-btn svg {
    width: 26px;
    height: 26px;
}

/* ── Powered By Footer ── */
.chatbot-footer {
    text-align: center;
    padding: 6px;
    font-size: 10px;
    color: var(--cb-text-light);
    background: var(--cb-bg);
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* ── Mobile Responsive ── */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 220px);
        bottom: 90px;
        right: 10px;
        left: 10px;
        border-radius: 16px;
    }

    .chatbot-toggle-wrapper {
        bottom: 90px !important;
        right: 20px !important;
    }

    .chatbot-toggle {
        width: 54px;
        height: 54px;
    }

    .chatbot-toggle svg {
        width: 24px;
        height: 24px;
    }

    .chatbot-msg {
        max-width: 92%;
    }
}

@media (max-width: 380px) {
    .chatbot-window {
        width: calc(100vw - 12px);
        right: 6px;
        left: 6px;
    }
}

/* ── Property Card within chatbot ── */
.chatbot-property-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s ease;
}

.chatbot-property-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chatbot-property-card h5 {
    margin: 0 0 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cb-text);
}

.chatbot-property-card p {
    margin: 0;
    font-size: 12px;
    color: var(--cb-text-light);
    line-height: 1.5;
}

.chatbot-property-card .price {
    color: var(--cb-primary-dark);
    font-weight: 700;
    font-size: 14px;
    margin-top: 6px;
    display: block;
}

.chatbot-property-card a {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--cb-primary);
    font-weight: 600;
    text-decoration: none;
}

.chatbot-property-card a:hover {
    text-decoration: underline;
}