/* ==========================================================================
   Landmark Kia - Interactive Conversational Chatbot Styles
   ========================================================================== */

:root {
    --kia-red: #ea0029;
    --kia-red-hover: #c40022;
    --kia-black: #05141f;
    --kia-dark: #0f172a;
    --kia-light-bg: #f8fafc;
    --kia-border: #e2e8f0;
    --kia-text: #1e293b;
    --kia-muted: #64748b;
    --kia-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Floating Launcher Button */
.kia-chatbot-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #05141f;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(5, 20, 31, 0.35);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    outline: none;
}

.kia-chatbot-launcher:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(234, 0, 41, 0.35);
    background: #000000;
}

.kia-chatbot-launcher .launcher-icon-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--kia-red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.kia-chatbot-launcher .pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--kia-red);
    animation: launcherPulse 2s infinite cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes launcherPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.kia-chatbot-launcher .launcher-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.kia-chatbot-launcher .launcher-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #22c55e;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #05141f;
}

/* Chatbot Main Container */
.kia-chatbot-container {
    position: fixed;
    right: 20px;
    bottom: 85px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: var(--kia-shadow);
    display: flex;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
    font-family: inherit;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.kia-chatbot-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.kia-chat-header {
    background: linear-gradient(135deg, #05141f 0%, #111827 100%);
    color: #ffffff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--kia-red);
}

.kia-chat-header .header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kia-chat-header .bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.kia-chat-header .bot-avatar img {
    width: 28px;
    height: auto;
}

.kia-chat-header .bot-avatar .online-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #05141f;
}

.kia-chat-header .header-text h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.kia-chat-header .header-text p {
    margin: 2px 0 0;
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kia-chat-header .header-actions {
    display: flex;
    gap: 6px;
}

.kia-chat-header .header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.kia-chat-header .header-btn:hover {
    background: var(--kia-red);
    color: #ffffff;
}

/* Chat Body / Messages Area */
.kia-chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.kia-chat-body::-webkit-scrollbar {
    width: 5px;
}

.kia-chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Message Bubble Styles */
.kia-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: msgFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.kia-msg.bot-msg {
    align-self: flex-start;
}

.kia-msg.user-msg {
    align-self: flex-end;
}

.kia-msg .bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}

.kia-msg.bot-msg .bubble {
    background: #ffffff;
    color: var(--kia-text);
    border-top-left-radius: 4px;
    border: 1px solid var(--kia-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.kia-msg.user-msg .bubble {
    background: var(--kia-black);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(5, 20, 31, 0.2);
}

.kia-msg .time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    align-self: flex-start;
}

.kia-msg.user-msg .time {
    align-self: flex-end;
}

/* Car Model Interactive Selection Grid */
.kia-model-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.kia-model-card {
    background: #ffffff;
    border: 1.5px solid var(--kia-border);
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 105px;
}

.kia-model-card:hover {
    border-color: var(--kia-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 0, 41, 0.12);
}

.kia-model-card img {
    max-width: 90%;
    height: 48px;
    object-fit: contain;
    margin-bottom: 6px;
}

.kia-model-card .model-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.kia-model-card .model-badge {
    font-size: 10px;
    color: var(--kia-red);
    font-weight: 600;
    margin-top: 2px;
}

/* Quick Action Chips */
.kia-action-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.kia-action-chip {
    background: #ffffff;
    border: 1px solid var(--kia-border);
    color: var(--kia-text);
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.kia-action-chip:hover {
    background: var(--kia-red);
    color: #ffffff;
    border-color: var(--kia-red);
}

.kia-action-chip.chip-whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
    color: #fff;
}

.kia-action-chip.chip-call:hover {
    background: #05141f;
    border-color: #05141f;
    color: #fff;
}

/* Typing Indicator */
.kia-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--kia-border);
    border-radius: 16px;
    border-top-left-radius: 4px;
    width: fit-content;
}

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

.kia-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.kia-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.kia-typing-indicator span:nth-child(3) { animation-delay: 0s; }

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

/* Chat Input Footer */
.kia-chat-footer {
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid var(--kia-border);
}

.kia-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1.5px solid transparent;
    border-radius: 30px;
    padding: 4px 6px 4px 14px;
    transition: all 0.2s ease;
}

.kia-chat-form:focus-within {
    background: #ffffff;
    border-color: var(--kia-red);
    box-shadow: 0 0 0 3px rgba(234, 0, 41, 0.1);
}

.kia-chat-form input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13.5px;
    outline: none;
    color: var(--kia-text);
    padding: 6px 0;
    font-family: inherit;
}

.kia-chat-form input::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.kia-chat-form button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--kia-red);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.kia-chat-form button:hover {
    background: var(--kia-red-hover);
    transform: scale(1.05);
}

.kia-chat-form button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Validation Hint */
.kia-chat-hint {
    font-size: 11px;
    color: #dc2626;
    margin-top: 5px;
    margin-left: 12px;
    display: none;
}

/* Responsive adjustment for Mobile */
@media (max-width: 480px) {
    .kia-chatbot-container {
        right: 10px;
        bottom: 75px;
        width: calc(100vw - 20px);
        height: calc(100vh - 90px);
        border-radius: 16px;
    }
    .kia-chatbot-launcher {
        right: 12px;
        bottom: 12px;
        padding: 8px 14px;
    }
    .kia-model-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
}
