/* ==========================================================================
   FluxLabs.Co — AI Scale Advisor & Chatbot Styles (Gemini 3.6 Flash)
   ========================================================================== */

/* Floating Launcher Trigger */
.ai-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4), 0 0 20px rgba(139, 92, 246, 0.3);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    user-select: none;
}

.ai-chat-launcher:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 40px rgba(59, 130, 246, 0.55), 0 0 25px rgba(139, 92, 246, 0.4);
}

.ai-chat-launcher .pulse-sparkle {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: sparkleSpin 4s infinite linear;
}

@keyframes sparkleSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chatbot Floating Window */
.ai-chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 440px;
    max-width: calc(100vw - 32px);
    height: 620px;
    max-height: calc(100vh - 120px);
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(59, 130, 246, 0.2);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ai-chat-window.active {
    display: flex;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.ai-chat-header {
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.ai-header-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gemini-badge {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c084fc;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.ai-header-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 2px 0 0 0;
}

.ai-header-actions {
    display: flex;
    gap: 4px;
}

.ai-action-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

/* Client Context Pill Bar */
.ai-context-bar {
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    color: #94a3b8;
}

.context-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

/* Chat Messages Stream */
.ai-chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.chat-bubble {
    max-width: 88%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.chat-bubble.ai h3, .chat-bubble.ai h4 {
    margin: 8px 0 4px 0;
    color: #38bdf8;
    font-size: 0.95rem;
}

.chat-bubble.ai ul {
    margin: 6px 0;
    padding-left: 20px;
}

.chat-bubble.ai li {
    margin-bottom: 4px;
}

/* Bundle Recommendation Card Inside Chat */
.bundle-recommend-card {
    margin-top: 12px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bundle-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.bundle-badge {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

.bundle-price-tag {
    font-size: 1.1rem;
    font-weight: 800;
    color: #10b981;
}

.bundle-name-header {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.bundle-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

.bundle-apps-list {
    font-size: 0.76rem;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bundle-book-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 700;
    font-size: 0.86rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.bundle-book-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

/* Suggestion Prompt Chips */
.ai-prompt-chips {
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.ai-prompt-chips::-webkit-scrollbar {
    display: none;
}

.prompt-chip {
    white-space: nowrap;
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border-radius: 999px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-chip:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #f1f5f9;
}

/* Chat Input Bar */
.ai-chat-input-bar {
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.ai-input:focus {
    border-color: #3b82f6;
}

.ai-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-send-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.05);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Dots animation */
.ai-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
