/* AI Estimator Chatbot Widget Stylesheet - MBEKTIW (Taman Kota Light Theme) */
.estimator-chat-card {
    background: var(--card, #fff);
    border: 1px solid var(--line, #E3E0D5);
    border-radius: var(--radius, 18px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 550px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.chat-header {
    background: var(--accent-tint, #FDEDDB);
    border-bottom: 1px solid var(--line, #E3E0D5);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card, #fff);
    border: 1.5px solid var(--accent, #F5871F);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: var(--accent-dark, #C96B14);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-header-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--ink, #1C1B18);
    font-family: 'Space Grotesk', sans-serif;
}

.status-indicator {
    font-size: 11px;
    color: var(--green, #5C8A5A);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--green, #5C8A5A);
    border-radius: 50%;
    animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
    background: var(--bg, #FBFAF7);
}

/* Scrollbar styles */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--line-strong, #CFCBBA);
    border-radius: 4px;
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 82%;
    border-radius: var(--radius, 18px);
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.6;
    animation: slide-up-chat 0.3s ease;
}

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

.bot-bubble {
    background: var(--card, #fff);
    border: 1px solid var(--line, #E3E0D5);
    align-self: flex-start;
    color: var(--ink, #1C1B18);
    border-top-left-radius: 4px;
}

.bot-bubble .bubble-content p {
    margin-bottom: 12px;
}
.bot-bubble .bubble-content p:last-child {
    margin-bottom: 0;
}
.bot-bubble .bubble-content ul, .bot-bubble .bubble-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}
.bot-bubble .bubble-content li {
    margin-bottom: 6px;
}

.user-bubble {
    background: var(--accent, #F5871F);
    color: #ffffff;
    font-weight: 500;
    align-self: flex-end;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(245, 135, 31, 0.2);
}

.error-bubble {
    background: #fff5f5;
    border: 1px solid rgba(229, 83, 75, 0.25);
    color: #e5534b;
    align-self: flex-start;
}

/* Quick chips */
.quick-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
    align-self: flex-start;
}

.quick-chip-btn {
    background: var(--card, #fff);
    border: 1px solid var(--line-strong, #CFCBBA);
    color: var(--ink-2, #5A594F);
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-chip-btn:hover {
    border-color: var(--accent, #F5871F);
    color: var(--accent-dark, #C96B14);
    background: var(--accent-tint, #FDEDDB);
}

/* Loader */
.dot-loader {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 4px 0;
}

.dot-loader span {
    width: 8px;
    height: 8px;
    background-color: var(--accent, #F5871F);
    border-radius: 50%;
    display: inline-block;
    animation: loader-bounce 1.4s infinite ease-in-out both;
}

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

@keyframes loader-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Chat Handoff Button */
.handoff-container {
    align-self: flex-start;
    animation: slide-up-chat 0.3s ease;
}

.btn-wa-handoff {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25d366 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    padding: 10px 18px !important;
    border-radius: 100px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
    border: none !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.btn-wa-handoff:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5) !important;
}

/* Input Area */
.chat-input-area {
    background: var(--card, #fff);
    border-top: 1px solid var(--line, #E3E0D5);
    padding: 16px 24px;
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-2, #F3F1EA);
    border: 1px solid var(--line, #E3E0D5);
    border-radius: 100px;
    padding: 8px 12px 8px 18px;
}

.chat-form:focus-within {
    border-color: var(--accent, #F5871F);
}

.chat-form textarea {
    flex-grow: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--ink, #1C1B18);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    padding: 6px 0;
    line-height: 1.4;
}

.chat-form textarea::placeholder {
    color: var(--ink-3, #8F8D80);
}

.chat-form button {
    background: var(--accent, #F5871F);
    border: none;
    outline: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    flex: none;
}

.chat-form button:hover {
    background: var(--accent-dark, #C96B14);
    transform: scale(1.05);
}

/* Tombol tutup panel drawer */
.chat-panel-close {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line, #E3E0D5);
    background: var(--card, #fff);
    color: var(--ink-2, #5A594F);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.chat-panel-close:hover {
    background: var(--bg-2, #F3F1EA);
    color: var(--ink, #1C1B18);
}
