/* ─────────────────────────────────────────────────────
   Properties Bangalore - AI Chatbot Widget
   ───────────────────────────────────────────────────── */

#pb-chat-launcher {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #C9A84C, #b59540);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(201, 168, 76, 0.5);
    z-index: 99998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    outline: none;
}

#pb-chat-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(201, 168, 76, 0.65);
}

#pb-chat-launcher svg {
    width: 28px;
    height: 28px;
    fill: white;
}

#pb-chat-launcher .pb-notif {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid white;
    animation: pb-pulse 2s infinite;
}

/* ── Speech Bubble Tooltip ───────────────────────────────── */
#pb-chat-tooltip {
    position: fixed;
    bottom: 105px;
    right: 28px;
    background: white;
    border-radius: 16px 16px 4px 16px;
    padding: 14px 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    z-index: 99997;
    max-width: 220px;
    transform: scale(0.8) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

#pb-chat-tooltip.pb-tooltip-visible {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
    cursor: pointer;
}

#pb-chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 22px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 0px solid transparent;
    border-top: 8px solid white;
}

#pb-chat-tooltip p {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: #1A1A2E;
    font-weight: 600;
    line-height: 1.4;
}

#pb-chat-tooltip span {
    font-size: 0.78rem;
    color: #888;
    font-weight: 400;
    display: block;
    margin-top: 3px;
}

#pb-chat-tooltip .pb-tooltip-close {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.75rem;
    color: #bbb;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    padding: 2px 4px;
}

#pb-chat-tooltip .pb-tooltip-close:hover { color: #888; }

@keyframes pb-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#pb-chat-window {
    position: fixed;
    bottom: 105px;
    right: 28px;
    width: 440px;
    min-height: 520px;
    max-height: 720px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

#pb-chat-window.pb-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.pb-chat-header {
    background: linear-gradient(135deg, #1A1A2E, #2d2d50);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.pb-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C9A84C, #b59540);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.pb-chat-header-info h4 {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    font-family: 'DM Sans', sans-serif;
}

.pb-chat-header-info span {
    color: #C9A84C;
    font-size: 0.78rem;
}

.pb-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.pb-close-btn:hover { color: white; }

.pb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f9f9f9;
    scroll-behavior: smooth;
}

.pb-chat-messages::-webkit-scrollbar { width: 4px; }
.pb-chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.pb-msg {
    max-width: 82%;
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.6;
    font-family: 'DM Sans', sans-serif;
    animation: pb-msg-in 0.3s ease;
}

@keyframes pb-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pb-msg.bot {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pb-msg.user {
    background: linear-gradient(135deg, #C9A84C, #b59540);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.pb-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pb-typing span {
    width: 7px;
    height: 7px;
    background: #C9A84C;
    border-radius: 50%;
    animation: pb-typing-bounce 1.2s infinite;
}

.pb-typing span:nth-child(2) { animation-delay: 0.2s; }
.pb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pb-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.pb-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.pb-quick-btn {
    padding: 6px 12px;
    border: 1.5px solid #C9A84C;
    border-radius: 20px;
    font-size: 0.78rem;
    color: #C9A84C;
    cursor: pointer;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
}

.pb-quick-btn:hover {
    background: #C9A84C;
    color: white;
}

.pb-capture-form {
    background: linear-gradient(135deg, #1A1A2E, #2d2d50);
    border-radius: 12px;
    padding: 15px;
    align-self: flex-start;
    width: 100%;
    max-width: 85%;
}

.pb-capture-form p {
    color: #C9A84C;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: 'DM Sans', sans-serif;
}

.pb-capture-form input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.82rem;
    margin-bottom: 8px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
}

.pb-capture-form input::placeholder { color: rgba(255,255,255,0.4); }

.pb-capture-form button {
    width: 100%;
    padding: 9px;
    background: linear-gradient(135deg, #C9A84C, #b59540);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: opacity 0.2s;
}

.pb-capture-form button:hover { opacity: 0.9; }

.pb-chat-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    background: white;
}

.pb-chat-footer textarea {
    flex: 1;
    border: 1.5px solid #eee;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 16px; /* 16px prevents iOS auto-zoom */
    resize: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    max-height: 90px;
    transition: border-color 0.2s;
    line-height: 1.4;
}

.pb-chat-footer textarea:focus { border-color: #C9A84C; }

.pb-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #C9A84C, #b59540);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.2s;
    align-self: flex-end;
}

.pb-send-btn:hover { opacity: 0.9; transform: scale(1.05); }
.pb-send-btn svg { width: 18px; height: 18px; fill: white; }

@media (max-width: 520px) {
    #pb-chat-window {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 88px;
        max-height: 72vh;
    }
    #pb-chat-launcher {
        right: 16px;
        bottom: 20px;
    }
    #pb-chat-tooltip {
        right: 10px;
    }
}
