/* --- AI Chatbot Styles --- */
.chatbot-container {
    position: fixed;
    bottom: 15px;
    left: 70px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: 'Outfit', sans-serif;
    pointer-events: none;
}

.chat-robot-trigger {
    width: 108px;
    height: 108px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4));
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.robot-welcome-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(180, 144, 65, 0.5);
    color: #fff;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 10001;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.robot-welcome-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(180, 144, 65, 0.5);
}

.robot-welcome-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-20px);
}

.chat-robot-trigger:hover {
    transform: scale(1.05);
}

.chat-robot-trigger model-viewer {
    --poster-color: transparent;
    background: transparent !important;
}

.chat-window {
    width: 350px;
    height: 500px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    transform-origin: bottom left;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

.chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.chat-header {
    padding: 15px 20px;
    background: rgba(180, 144, 65, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    color: #b49041;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.chat-close {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    transition: color 0.2s;
}

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

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    animation: msg-slide 0.3s ease-out;
}

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

.message.bot {
    background: rgba(255, 255, 255, 0.1);
    color: #eee;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message.user {
    background: #b49041;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 10px 15px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus { border-color: #b49041; }

.chat-send-btn {
    background: #b49041;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-send-btn:hover { transform: scale(1.1); }

.typing { display: flex; gap: 4px; padding: 5px; }
.typing span {
    width: 6px; height: 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    animation: typing-blink 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* --- Mini Unit Card Styles --- */
.chat-unit-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(180, 144, 65, 0.3);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 5px;
    width: 100%;
}

.chat-unit-img-placeholder {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-unit-img-placeholder.apartments { background-image: url('../images/phase1/apartments.png'); }
.chat-unit-img-placeholder.duplex { background-image: url('../images/phase1/duplex.png'); }
.chat-unit-img-placeholder.twin-house { background-image: url('../images/phase1/twinHouse.png'); }
.chat-unit-img-placeholder.town-house { background-image: url('../images/phase1/townHouse6.png'); }
.chat-unit-img-placeholder.stand-alone-a { background-image: url('../images/phase1/standAlone_A.png'); }
.chat-unit-img-placeholder.stand-alone-b { background-image: url('../images/phase1/standAlone_B.png'); }
.chat-unit-img-placeholder.stand-alone-c { background-image: url('../images/phase1/standAlone_C.png'); }
.chat-unit-img-placeholder.stand-alone-d { background-image: url('../images/phase1/standAlone_D.png'); }

.chat-unit-details {
    padding: 12px;
    font-size: 13px;
}

.chat-unit-details h4 {
    margin: 0 0 8px 0;
    color: #b49041;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-unit-code {
    background: rgba(180, 144, 65, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #fdf6e3;
}

.chat-unit-details p {
    margin: 4px 0;
    color: #ccc;
}

.status-available { color: #4CAF50; font-weight: bold; }
.status-sold { color: #f44336; font-weight: bold; }
.status-reserved { color: #FF9800; font-weight: bold; }
.status-unlaunched { color: #9E9E9E; font-weight: bold; }

.chat-unit-btn {
    width: 100%;
    padding: 10px;
    background: #b49041;
    border: none;
    color: white;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-unit-btn:hover {
    background: #cba856;
}

@media (max-width: 768px) {
    .chatbot-container { bottom: 10px; left: 60px; }
    .chat-robot-trigger { width: 60px; height: 60px; }
    .chat-window { width: 280px; height: 400px; }
}
