/* ===== LiveGood AI Widget ===== */

#lg-ai-box {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 360px;
    height: 480px;
    max-width: calc(100vw - 40px);
    display: none;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #dbe7d8;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    z-index: 9999;
}

#lg-ai-box.is-open {
    display: flex;
}

.lg-ai-box-header {
    position: relative;
    padding: 18px;
    background: linear-gradient(135deg, #ecfdf3 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
}

.lg-ai-box-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #15803d;
    margin-bottom: 8px;
}

.lg-ai-box-title {
    margin: 0 32px 8px 0;
    font-size: 22px;
    line-height: 1.15;
    font-weight: 800;
    color: #111827;
}

.lg-ai-box-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #4b5563;
}

#lg-ai-close {
    display: block;
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.lg-ai-quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 0 16px;
    background: #fff;
}

.lg-ai-quick-btn {
    border: 1px solid #d1fae5;
    background: #f0fdf4;
    color: #166534;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

#lg-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    background: #ffffff;
}

.lg-ai-msg {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 88%;
    word-wrap: break-word;
}

.lg-ai-msg.ai {
    background: #f3f4f6;
    color: #111827;
}

.lg-ai-msg.user {
    margin-left: auto;
    background: #dcfce7;
    color: #14532d;
}

.lg-ai-link {
    color: #15803d;
    text-decoration: underline;
    font-weight: 600;
}

.lg-ai-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

#lg-ai-text {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
}

#lg-ai-send {
    border: none;
    background: #22c55e;
    color: #fff;
    border-radius: 12px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}

#lg-ai-mobile-launcher,
#lg-ai-desktop-launcher {
    display: none;
}

/* Mobile */
@media (max-width: 900px) {
    html, body {
        overflow-x: hidden;
    }

    #lg-ai-box {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
        height: 68vh;
    }

    #lg-ai-mobile-launcher.is-visible {
        display: flex;
        position: fixed;
        right: 16px;
        bottom: 16px;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: #22c55e;
        color: #fff;
        font-size: 30px;
        font-weight: 800;
        align-items: center;
        justify-content: center;
        box-shadow: 0 12px 30px rgba(0,0,0,0.22);
        z-index: 10000;
        cursor: pointer;
    }

    .lg-ai-box-title {
        font-size: 18px;
    }

    .lg-ai-box-subtitle {
        font-size: 13px;
    }
}

/* Desktop */
@media (min-width: 901px) {
    #lg-ai-desktop-launcher.is-visible {
        display: inline-flex;
        position: fixed;
        right: 20px;
        bottom: 20px;
        z-index: 10000;
        background: #111827;
        color: #fff;
        padding: 12px 16px;
        border-radius: 999px;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 12px 30px rgba(0,0,0,0.22);
        border: 1px solid rgba(34,197,94,0.35);
    }
}