/*
 * LAHORE AUTO — AI Chatbot Widget
 * Premium dark glass-morphism design matching site theme
 * Neon-lime (#d6ff00) primary, cyan (#00e5ff) accent
 */

/* ── FLOATING TRIGGER BUTTON ────────────────────────────────────────────── */
.la-chatbot-btn {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d6ff00 0%, #b8e600 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 20px rgba(214, 255, 0, 0.4),
        0 0 0 0 rgba(214, 255, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                opacity 0.3s ease;
    animation: la-btn-pulse 3s ease-in-out infinite;
}

.la-chatbot-btn:hover {
    transform: scale(1.12);
    box-shadow:
        0 6px 30px rgba(214, 255, 0, 0.6),
        0 0 0 8px rgba(214, 255, 0, 0.12);
    animation: none;
}

.la-chatbot-btn:focus-visible {
    outline: 2px solid #d6ff00;
    outline-offset: 4px;
}

.la-chatbot-btn svg {
    width: 28px;
    height: 28px;
    fill: #0d0d12;
    transition: transform 0.3s ease;
}

.la-chatbot-btn:hover svg {
    transform: scale(1.1) rotate(-5deg);
}

/* Hide button when window is open */
.la-chatbot-btn.la-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Notification badge */
.la-chatbot-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    background: #00e5ff;
    border-radius: 50%;
    border: 2px solid #0d0d12;
    display: none;
}

.la-chatbot-badge.la-show {
    display: block;
    animation: la-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes la-btn-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(214,255,0,0.4), 0 0 0 0 rgba(214,255,0,0.35); }
    50%       { box-shadow: 0 4px 20px rgba(214,255,0,0.5), 0 0 0 10px rgba(214,255,0,0); }
}

@keyframes la-badge-pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ── CHAT WINDOW ────────────────────────────────────────────────────────── */
.la-chatbot-window {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9999;
    width: 380px;
    height: 570px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 30px);
    border-radius: 22px;
    background: rgba(13, 13, 18, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(214, 255, 0, 0.15);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255,255,255,0.04),
        0 0 40px rgba(214, 255, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* Closed state */
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85) translateY(20px);
    transform-origin: bottom right;
    transition:
        opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.la-chatbot-window.la-open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.la-chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg,
        rgba(214, 255, 0, 0.1) 0%,
        rgba(0, 229, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.la-chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d6ff00 0%, #b8e600 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(214, 255, 0, 0.35);
}

.la-chatbot-avatar svg {
    width: 22px;
    height: 22px;
    fill: #0d0d12;
}

.la-chatbot-header-info {
    flex: 1;
    min-width: 0;
}

.la-chatbot-header-name {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.la-chatbot-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #aaa;
    margin-top: 2px;
}

.la-chatbot-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    animation: la-status-pulse 2.5s ease-in-out infinite;
}

@keyframes la-status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.la-chatbot-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.la-chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.1);
}

.la-chatbot-close-btn:focus-visible {
    outline: 2px solid #d6ff00;
    outline-offset: 2px;
}

/* ── MESSAGES AREA ──────────────────────────────────────────────────────── */
.la-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.la-chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.la-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.la-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(214, 255, 0, 0.25);
    border-radius: 4px;
}

/* ── MESSAGE BUBBLES ────────────────────────────────────────────────────── */
.la-msg {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    animation: la-msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes la-msg-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.la-msg-ai {
    align-self: flex-start;
    max-width: 85%;
}

.la-msg-user {
    align-self: flex-end;
    max-width: 85%;
    flex-direction: row-reverse;
}

.la-msg-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(214, 255, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.la-msg-icon svg {
    width: 14px;
    height: 14px;
    fill: #d6ff00;
}

.la-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.55;
    word-break: break-word;
}

/* AI bubble */
.la-msg-ai .la-msg-bubble {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

/* User bubble */
.la-msg-user .la-msg-bubble {
    background: linear-gradient(135deg, #d6ff00 0%, #c4ec00 100%);
    color: #0d0d12;
    font-weight: 500;
    border-bottom-right-radius: 4px;
}

.la-msg-time {
    font-size: 0.65rem;
    color: #555;
    margin-top: 4px;
    padding: 0 4px;
}

.la-msg-ai .la-msg-time { text-align: left; }
.la-msg-user .la-msg-time { text-align: right; }

/* Links inside AI messages */
.la-msg-bubble a {
    color: #d6ff00;
    text-decoration: underline;
    text-decoration-color: rgba(214, 255, 0, 0.4);
    text-underline-offset: 2px;
}

.la-msg-bubble a:hover {
    color: #e2ff4d;
}

/* ── TYPING INDICATOR ───────────────────────────────────────────────────── */
.la-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    align-self: flex-start;
    animation: la-msg-in 0.3s ease;
}

.la-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.la-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d6ff00;
    animation: la-dot-bounce 1.2s ease-in-out infinite;
}

.la-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.la-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes la-dot-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40%           { transform: translateY(-5px); opacity: 1; }
}

/* ── INPUT AREA ─────────────────────────────────────────────────────────── */
.la-chatbot-input-area {
    padding: 12px 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.la-chatbot-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 12px 10px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.la-chatbot-input-row:focus-within {
    border-color: rgba(214, 255, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(214, 255, 0, 0.08);
}

.la-chatbot-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    min-height: 22px;
    overflow-y: auto;
}

.la-chatbot-textarea::placeholder {
    color: #555;
}

.la-chatbot-textarea::-webkit-scrollbar { width: 3px; }
.la-chatbot-textarea::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.la-chatbot-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #d6ff00;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.la-chatbot-send-btn:hover:not(:disabled) {
    background: #e2ff4d;
    transform: scale(1.05);
}

.la-chatbot-send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.la-chatbot-send-btn:focus-visible {
    outline: 2px solid #d6ff00;
    outline-offset: 2px;
}

.la-chatbot-send-btn svg {
    width: 16px;
    height: 16px;
    fill: #0d0d12;
}

.la-chatbot-footer-text {
    text-align: center;
    font-size: 0.62rem;
    color: #404040;
    margin-top: 8px;
    letter-spacing: 0.3px;
}

/* ── RESPONSIVE: MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .la-chatbot-btn {
        right: 16px;
        bottom: 16px;
        width: 52px;
        height: 52px;
    }

    .la-chatbot-btn svg {
        width: 24px;
        height: 24px;
    }

    .la-chatbot-window {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        height: min(650px, calc(100vh - 20px));
        border-radius: 18px;
    }
}

/* ── REDUCED MOTION ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .la-chatbot-btn,
    .la-chatbot-window,
    .la-msg,
    .la-chatbot-btn:hover,
    .la-typing-dot {
        animation: none !important;
        transition: opacity 0.1s ease !important;
    }

    .la-chatbot-window {
        transform: none !important;
    }
}

/* ── EMPTY STATE ────────────────────────────────────────────────────────── */
.la-chatbot-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    gap: 12px;
}

.la-chatbot-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(214, 255, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.la-chatbot-empty-icon svg {
    width: 28px;
    height: 28px;
    fill: #d6ff00;
    opacity: 0.7;
}

.la-quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}

.la-quick-prompt-btn {
    background: rgba(214, 255, 0, 0.08);
    border: 1px solid rgba(214, 255, 0, 0.2);
    color: #ccc;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.la-quick-prompt-btn:hover {
    background: rgba(214, 255, 0, 0.15);
    border-color: rgba(214, 255, 0, 0.4);
    color: #fff;
}
