/* Rivian Advisor Chatbot Styles */

/* FAB Button */
.chatbot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #48e5c2, #3dd4b0);
    box-shadow: 0 4px 20px rgba(72, 229, 194, 0.4), 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}
.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(72, 229, 194, 0.5), 0 4px 12px rgba(0,0,0,0.3);
}
.chatbot-fab.hidden {
    transform: scale(0);
    pointer-events: none;
}
.fab-icon {
    font-size: 28px;
    line-height: 1;
}
.fab-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(72, 229, 194, 0.3);
    animation: fabPulse 2s infinite;
}
@keyframes fabPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 48px);
    background: #1a1f2e;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(72, 229, 194, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 10001;
    transform: scale(0) translateY(20px);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    overflow: hidden;
}
.chatbot-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e2538, #252d42);
    border-bottom: 1px solid rgba(72, 229, 194, 0.15);
}
.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #48e5c2, #3dd4b0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.chatbot-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
}
.chatbot-status {
    font-size: 0.75rem;
    color: #48e5c2;
}
.chatbot-close {
    background: none;
    border: none;
    color: #8892a4;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.chatbot-close:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}
.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(72, 229, 194, 0.2);
    border-radius: 4px;
}

/* Messages */
.chat-msg {
    display: flex;
    animation: msgSlide 0.3s ease-out;
}
@keyframes msgSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg.bot {
    justify-content: flex-start;
}
.chat-msg.user {
    justify-content: flex-end;
}
.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.bot-bubble {
    background: #252d42;
    color: #e0e4ec;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(72, 229, 194, 0.08);
}
.user-bubble {
    background: linear-gradient(135deg, #48e5c2, #3dd4b0);
    color: #0d1117;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* Options */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
    animation: msgSlide 0.3s ease-out;
}
.chat-option-btn {
    background: #1e2538;
    border: 1px solid rgba(72, 229, 194, 0.2);
    color: #e0e4ec;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-family: inherit;
}
.chat-option-btn:hover {
    background: rgba(72, 229, 194, 0.08);
    border-color: rgba(72, 229, 194, 0.5);
    color: #48e5c2;
    transform: translateX(4px);
}

/* Result Cards */
.chat-result {
    background: #1e2538;
    border: 1px solid rgba(72, 229, 194, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 4px;
}
.chat-result-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #48e5c2;
    margin-bottom: 4px;
}
.chat-result-title.chat-result-lease {
    color: #a78bfa;
}
.chat-result-title.chat-result-finance {
    color: #fbbf24;
}
.chat-result-config {
    font-size: 0.85rem;
    color: #8892a4;
    margin-bottom: 8px;
}
.chat-result-points {
    font-size: 0.9rem;
    color: #fbbf24;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: rgba(251, 191, 36, 0.08);
    border-radius: 6px;
    display: inline-block;
}
.chat-result-reasons {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-reason {
    font-size: 0.82rem;
    color: #b0b8c8;
    line-height: 1.5;
}

/* Lease vs Finance Comparison */
.chat-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}
.chat-compare-col {
    background: #0d1117;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.chat-compare-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8892a4;
    margin-bottom: 8px;
}
.chat-compare-payment {
    font-size: 1.2rem;
    font-weight: 800;
    color: #48e5c2;
    margin-bottom: 4px;
}
.chat-compare-total {
    font-size: 0.75rem;
    color: #8892a4;
}
.chat-compare-note {
    font-size: 0.7rem;
    color: #a78bfa;
    margin-top: 6px;
    font-style: italic;
}

/* Input Area (reserved for future text input) */
.chatbot-input-area {
    padding: 0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .chatbot-fab {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    .fab-icon {
        font-size: 24px;
    }
}
