/* ============================================
   AiBoss Chat Widget V2 — Value-First Funnel
   ============================================ */

:root {
    --ab-purple: #7823b1;
    --ab-pink: #e930c9;
    --ab-violet: #a855f7;
    --ab-dark: #0f0a1a;
    --ab-surface: #1a0f2e;
    --ab-surface-light: #2d1854;
    --ab-text: #f0e6ff;
    --ab-text-muted: rgba(240, 230, 255, 0.6);
    --ab-gradient: linear-gradient(135deg, #7823b1, #e930c9);
    --ab-gradient-reverse: linear-gradient(135deg, #e930c9, #7823b1);
    --ab-shadow: 0 20px 60px rgba(120, 35, 177, 0.3);
    --ab-radius: 20px;
    --ab-radius-sm: 12px;
    --ab-green: #22c55e;
    --ab-red: #ef4444;
    --ab-amber: #f59e0b;
}

/* ---- Reset within widget scope ---- */
#ab-chat-widget * {
    box-sizing: border-box;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Floating Trigger Button ---- */
#ab-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ab-gradient);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(120, 35, 177, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: ab-pulse 2s ease-in-out infinite;
}

#ab-chat-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(120, 35, 177, 0.5);
}

#ab-chat-trigger:active {
    transform: scale(0.95);
}

#ab-chat-trigger.ab-hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

#ab-chat-trigger svg {
    width: 28px;
    height: 28px;
    fill: white;
    transition: transform 0.3s ease;
}

/* Notification badge */
#ab-chat-trigger .ab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: var(--ab-red);
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    animation: ab-badge-bounce 0.5s ease;
}

@keyframes ab-pulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(120, 35, 177, 0.4); }
    50% { box-shadow: 0 8px 48px rgba(120, 35, 177, 0.6), 0 0 0 8px rgba(120, 35, 177, 0.1); }
}

@keyframes ab-badge-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ---- Chat Modal Overlay ---- */
#ab-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#ab-chat-overlay.ab-active {
    opacity: 1;
    visibility: visible;
}

/* ---- Chat Modal Container ---- */
#ab-chat-modal {
    position: fixed;
    z-index: 1000000;
    background: var(--ab-dark);
    border-radius: var(--ab-radius);
    overflow: hidden;
    box-shadow: var(--ab-shadow), 0 0 0 1px rgba(168, 85, 247, 0.15);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Desktop: bottom-right */
    bottom: 100px;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 660px;
    max-height: calc(100vh - 120px);
}

#ab-chat-modal.ab-closed {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

/* Mobile: full screen */
@media (max-width: 480px) {
    #ab-chat-modal {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* ---- Modal Header ---- */
#ab-chat-header {
    background: var(--ab-gradient);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    flex-shrink: 0;
}

#ab-chat-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--ab-dark));
    pointer-events: none;
    z-index: 0;
}

/* Close button on LEFT, Avatar on RIGHT */
/* HTML order handles this: close | info | avatar */

.ab-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

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

.ab-header-name {
    font-size: 16px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
}

.ab-header-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ab-header-status .ab-online-dot {
    width: 7px;
    height: 7px;
    background: var(--ab-green);
    border-radius: 50%;
    animation: ab-dot-pulse 1.5s ease-in-out infinite;
}

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

#ab-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

#ab-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ---- Chat Body ---- */
#ab-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
}

#ab-chat-body::-webkit-scrollbar {
    width: 4px;
}

#ab-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

#ab-chat-body::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

/* ---- Message Bubbles ---- */
.ab-msg {
    max-width: 90%;
    animation: ab-msg-in 0.3s ease;
}

.ab-msg-bot { align-self: flex-start; }
.ab-msg-user { align-self: flex-end; }

.ab-msg-bubble {
    padding: 8px 4px 8px 10px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.ab-msg-bot .ab-msg-bubble {
    background: var(--ab-surface);
    color: var(--ab-text);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(168, 85, 247, 0.1);
    margin-left: 4px;
}

.ab-msg-user .ab-msg-bubble {
    background: var(--ab-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    margin-right: 4px;
}

.ab-msg-time {
    font-size: 11px;
    color: var(--ab-text-muted);
    margin-top: 8px;
    padding: 0 4px;
    opacity: 0.7;
}

.ab-msg-user .ab-msg-time { text-align: right; }

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

/* ---- Typing Indicator ---- */
.ab-typing {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    align-self: flex-start;
}

.ab-typing-dot {
    width: 7px;
    height: 7px;
    background: var(--ab-violet);
    border-radius: 50%;
    animation: ab-typing-bounce 1.2s ease-in-out infinite;
}

.ab-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.ab-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes ab-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ---- Quick Reply Chips ---- */
.ab-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    animation: ab-msg-in 0.3s ease;
}

.ab-quick-reply {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: var(--ab-violet);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ab-quick-reply:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--ab-violet);
    transform: translateY(-1px);
}

.ab-quick-reply:active {
    transform: scale(0.97);
}

/* ---- Industry Selector (Micro-commitment Step 1) ---- */
.ab-industry-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: ab-msg-in 0.3s ease;
}

.ab-industry-option {
    background: var(--ab-surface);
    border: 1.5px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--ab-radius-sm);
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ab-text);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.ab-industry-option:hover {
    border-color: var(--ab-violet);
    background: rgba(168, 85, 247, 0.08);
    transform: translateX(4px);
}

.ab-industry-option:active {
    transform: scale(0.98);
}

.ab-industry-option .ab-industry-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ab-industry-option .ab-industry-label {
    flex: 1;
}

.ab-industry-option .ab-industry-label small {
    display: block;
    font-size: 11px;
    color: var(--ab-text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.ab-industry-option.ab-selected {
    border-color: var(--ab-green);
    background: rgba(34, 197, 94, 0.08);
}

.ab-industry-option.ab-selected .ab-industry-icon {
    background: rgba(34, 197, 94, 0.15);
}

/* ---- Case Study Card (Value-First) ---- */
.ab-case-study {
    background: var(--ab-surface);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--ab-radius-sm);
    overflow: hidden;
    animation: ab-msg-in 0.3s ease;
}

.ab-case-study-header {
    padding: 16px 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ab-case-study-badge {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--ab-green);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ab-case-study-industry {
    font-size: 11px;
    color: var(--ab-text-muted);
}

.ab-case-study-body {
    padding: 14px 16px;
}

.ab-case-study-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ab-text);
    margin-bottom: 6px;
}

.ab-case-study-desc {
    font-size: 13px;
    color: var(--ab-text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.ab-case-study-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ab-case-stat {
    text-align: center;
}

.ab-case-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--ab-violet);
}

.ab-case-stat-label {
    font-size: 11px;
    color: var(--ab-text-muted);
}

.ab-case-study-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ab-case-study-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ab-case-study-video .ab-video-play {
    position: absolute;
    width: 56px;
    height: 56px;
    background: rgba(120, 35, 177, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.ab-case-study-video .ab-video-play svg {
    width: 24px;
    height: 24px;
    fill: white;
    margin-left: 3px;
}

.ab-case-study-video:hover .ab-video-play {
    transform: scale(1.1);
    background: var(--ab-gradient);
}

.ab-case-study-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(168, 85, 247, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ab-case-study-result {
    font-size: 12px;
    color: var(--ab-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Video Player (Inline) ---- */
.ab-video-player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--ab-radius-sm);
    overflow: hidden;
    animation: ab-msg-in 0.3s ease;
}

.ab-video-player-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ab-video-player-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}

/* ---- Lead Capture Form ---- */
#ab-lead-form {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: ab-msg-in 0.3s ease;
}

.ab-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ab-form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ab-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ab-form-input {
    background: var(--ab-surface);
    border: 1.5px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--ab-radius-sm);
    padding: 16px 18px;
    font-size: 15px;
    color: var(--ab-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    font-family: inherit;
}

.ab-form-input::placeholder {
    color: rgba(240, 230, 255, 0.3);
}

.ab-form-input:focus {
    border-color: var(--ab-violet);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.ab-form-input.ab-error {
    border-color: var(--ab-red);
    animation: ab-shake 0.4s ease;
}

.ab-form-error {
    font-size: 12px;
    color: var(--ab-red);
    display: none;
}

.ab-form-error.ab-visible {
    display: block;
}

/* ---- Submit Button ---- */
#ab-lead-submit {
    background: var(--ab-gradient);
    border: none;
    border-radius: var(--ab-radius-sm);
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    letter-spacing: -0.01em;
}

#ab-lead-submit:hover {
    box-shadow: 0 8px 24px rgba(120, 35, 177, 0.4);
    transform: translateY(-1px);
}

#ab-lead-submit:active {
    transform: translateY(0);
}

#ab-lead-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#ab-lead-submit .ab-btn-loading { display: none; }

#ab-lead-submit.ab-loading .ab-btn-text { display: none; }
#ab-lead-submit.ab-loading .ab-btn-loading { display: inline-flex; align-items: center; gap: 8px; }
#ab-lead-submit.ab-loading .ab-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ab-spin 0.6s linear infinite;
}

@keyframes ab-spin {
    to { transform: rotate(360deg); }
}

/* ---- Progress Steps ---- */
.ab-progress {
    display: flex;
    gap: 6px;
    padding: 12px 0 4px;
}

.ab-progress-step {
    flex: 1;
    height: 3px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.ab-progress-step.ab-active {
    background: var(--ab-gradient);
}

.ab-progress-step.ab-done {
    background: var(--ab-green);
}

/* ---- Social Proof Bar ---- */
.ab-social-proof {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    animation: ab-msg-in 0.3s ease;
}

.ab-social-proof-avatars {
    display: flex;
}

.ab-social-proof-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ab-surface-light);
    border: 2px solid var(--ab-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--ab-violet);
    margin-left: -6px;
}

.ab-social-proof-avatar:first-child {
    margin-left: 0;
}

.ab-social-proof-text {
    font-size: 12px;
    color: var(--ab-text-muted);
}

.ab-social-proof-text strong {
    color: var(--ab-text);
}

/* ---- Delivery Choice ---- */
#ab-delivery-sms:hover, #ab-delivery-email:hover {
    background: rgba(168, 85, 247, 0.08) !important;
}
#ab-delivery-sms:active, #ab-delivery-email:active {
    background: rgba(168, 85, 247, 0.15) !important;
}

/* ---- Trust Badges ---- */
.ab-trust-row {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    animation: ab-msg-in 0.3s ease;
}

.ab-trust-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--ab-text-muted);
}

.ab-trust-badge .ab-trust-icon {
    font-size: 13px;
}

/* ---- Testimonial Snippet ---- */
.ab-testimonial {
    background: rgba(168, 85, 247, 0.05);
    border-left: 3px solid var(--ab-violet);
    border-radius: 0 var(--ab-radius-sm) var(--ab-radius-sm) 0;
    padding: 12px 14px;
    animation: ab-msg-in 0.3s ease;
}

.ab-testimonial-text {
    font-size: 13px;
    color: var(--ab-text);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 6px;
}

.ab-testimonial-author {
    font-size: 11px;
    color: var(--ab-text-muted);
}

.ab-testimonial-author strong {
    color: var(--ab-violet);
}

/* ---- WhatsApp CTA (Mobile) ---- */
.ab-whatsapp-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: ab-msg-in 0.3s ease;
}

.ab-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25d366;
    border: none;
    border-radius: var(--ab-radius-sm);
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
}

.ab-whatsapp-btn:hover {
    background: #20bd5a;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
}

.ab-whatsapp-btn svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.ab-whatsapp-hint {
    font-size: 12px;
    color: var(--ab-text-muted);
    text-align: center;
}

/* ---- Close Phone Capture ---- */
#ab-close-phone-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: ab-msg-in 0.3s ease;
}

#ab-close-phone-skip {
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--ab-radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ab-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-family: inherit;
}

#ab-close-phone-skip:hover {
    border-color: rgba(168, 85, 247, 0.4);
    color: var(--ab-text);
}

/* ---- Calendar CTA ---- */
.ab-calendar-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: ab-msg-in 0.3s ease;
}

.ab-calendar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--ab-gradient);
    border: none;
    border-radius: var(--ab-radius-sm);
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
}

.ab-calendar-btn:hover {
    box-shadow: 0 8px 24px rgba(120, 35, 177, 0.4);
    transform: translateY(-1px);
}

.ab-calendar-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* ---- Success State ---- */
.ab-success-card {
    text-align: center;
    padding: 24px 16px;
    animation: ab-msg-in 0.4s ease;
}

.ab-success-icon {
    width: 64px;
    height: 64px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
}

.ab-success-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ab-text);
    margin-bottom: 8px;
}

.ab-success-text {
    font-size: 14px;
    color: var(--ab-text-muted);
    line-height: 1.5;
}

/* ---- Urgency Banner ---- */
.ab-urgency {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--ab-radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #fca5a5;
    animation: ab-msg-in 0.3s ease;
}

.ab-urgency-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* ---- Timer Badge ---- */
.ab-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fca5a5;
    margin-top: 8px;
}

.ab-timer-badge .ab-timer-icon {
    font-size: 13px;
}

/* ---- Gentle Close Nudge (replaces aggressive prevention) ---- */
#ab-gentle-nudge {
    position: fixed;
    z-index: 1000001;
    background: var(--ab-dark);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--ab-radius);
    padding: 28px 32px;
    width: 360px;
    max-width: calc(100vw - 48px);
    text-align: center;
    box-shadow: var(--ab-shadow);
    display: none;
}

#ab-gentle-nudge.ab-visible {
    display: block;
    animation: ab-confirm-in 0.3s ease;
}

.ab-nudge-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ab-text);
    margin-bottom: 6px;
}

.ab-nudge-text {
    font-size: 13px;
    color: var(--ab-text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}

.ab-nudge-buttons {
    display: flex;
    gap: 10px;
}

.ab-nudge-stay {
    flex: 1;
    background: var(--ab-gradient);
    border: none;
    border-radius: var(--ab-radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-nudge-stay:hover {
    box-shadow: 0 6px 20px rgba(120, 35, 177, 0.4);
}

.ab-nudge-close {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--ab-radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ab-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-nudge-close:hover {
    border-color: rgba(168, 85, 247, 0.4);
    color: var(--ab-text);
}

/* ---- Separator ---- */
.ab-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.ab-separator::before,
.ab-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(168, 85, 247, 0.1);
}

.ab-separator span {
    font-size: 11px;
    color: var(--ab-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* ---- Chat Footer / Input ---- */
#ab-chat-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(168, 85, 247, 0.08);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

#ab-chat-input {
    flex: 1;
    background: var(--ab-surface);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    color: var(--ab-text);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#ab-chat-input::placeholder {
    color: rgba(240, 230, 255, 0.3);
}

#ab-chat-input:focus {
    border-color: var(--ab-violet);
}

#ab-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ab-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#ab-chat-send:hover {
    transform: scale(1.05);
}

#ab-chat-send svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* ---- Powered By ---- */
.ab-powered-by {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: rgba(240, 230, 255, 0.25);
    flex-shrink: 0;
}

.ab-powered-by a {
    color: var(--ab-violet);
    text-decoration: none;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 480px) {
    #ab-chat-trigger {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    #ab-chat-header {
        padding: 16px 20px;
    }

    #ab-chat-body {
        padding: 16px;
    }

    .ab-msg {
        max-width: 92%;
    }
}

/* ---- Shake Animation ---- */
@keyframes ab-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.ab-shake {
    animation: ab-shake 0.4s ease;
}

@keyframes ab-confirm-in {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
