/* RoundKart AI Chatbot - Premium Glassmorphic Styles v2 */

:root {
    --rk-ai-bubble: #2874f0;
    --rk-ai-header: #0f172a;
    --rk-glass: rgba(255, 255, 255, 0.85);
    --rk-glass-border: rgba(255, 255, 255, 0.4);
    --rk-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.2);
}

/* Floating Launcher */
#rk-ai-launcher {
    position: fixed;
    bottom: 30px;
    width: 65px;
    height: 65px;
    background: var(--rk-ai-bubble);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#rk-ai-launcher.pos-right { right: 30px; }
#rk-ai-launcher.pos-left { left: 30px; }

#rk-ai-launcher:hover { transform: scale(1.1) rotate(5deg); }
#rk-ai-launcher svg { width: 28px; height: 28px; }

/* Chat Window */
#rk-ai-window {
    position: fixed;
    bottom: 110px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: var(--rk-glass);
    backdrop-filter: blur(15px);
    border: 1px solid var(--rk-glass-border);
    border-radius: 20px;
    box-shadow: var(--rk-shadow);
    z-index: 999998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
    font-family: 'Inter', 'Outfit', sans-serif;
}

#rk-ai-window.pos-right { right: 30px; }
#rk-ai-window.pos-left { left: 30px; }

#rk-ai-window.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

/* Header */
.rk-ai-header {
    padding: 24px;
    background: var(--rk-ai-header);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rk-ai-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: 0.1em;
}

.rk-ai-close { cursor: pointer; opacity: 0.7; transition: 0.3s; font-size: 24px; line-height: 1; }
.rk-ai-close:hover { opacity: 1; }

/* Messages Area */
#rk-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rk-ai-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.rk-ai-msg.bot {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.rk-ai-msg.user {
    align-self: flex-end;
    background: var(--rk-ai-bubble);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Typing Indicator */
.rk-ai-typing {
    display: none;
    align-self: flex-start;
    padding: 12px 16px;
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
    margin-left: 20px;
    margin-bottom: 20px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--rk-ai-bubble);
    border-radius: 50%;
    display: inline-block;
    animation: typing 1s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; margin: 0 4px; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Input Area */
.rk-ai-footer {
    padding: 20px;
    background: white;
    border-top: 1px solid #f1f5f9;
}

.rk-ai-input-wrap {
    display: flex;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 5px 15px;
    align-items: center;
}

#rk-ai-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    color: #0f172a;
}

.rk-ai-send { color: var(--rk-ai-bubble); cursor: pointer; transition: 0.3s; }
.rk-ai-send:hover { opacity: 0.7; transform: translateX(2px); }

/* Mobile Optimization */
@media (max-width: 480px) {
    #rk-ai-window {
        right: 0 !important;
        left: 0 !important;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}
