/* ═══════════════════════════════════════════
   SCOOP BOT CHAT WIDGET v4
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --scoop-primary: #6366f1;
    --scoop-secondary: #ec4899;
    --scoop-bg: rgba(255, 255, 255, 0.95);
    --scoop-surface: #f8fafc;
    --scoop-border: #e2e8f0;
    --scoop-text: #1e293b;
    --scoop-text-muted: #94a3b8;
    --scoop-radius: 16px;
    --scoop-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

/* ─── Launcher Orb ─── */
#scoop-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--scoop-primary), var(--scoop-secondary));
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 99999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scoop-chat-launcher::after {
    content: '';
    width: 26px;
    height: 26px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z'/%3E%3C/svg%3E") center/contain no-repeat;
}

#scoop-chat-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5);
}

/* Pulse animation */
#scoop-chat-launcher::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--scoop-primary), var(--scoop-secondary));
    opacity: 0;
    z-index: -1;
    animation: scoop-pulse 3s infinite;
}

@keyframes scoop-pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.15); }
}

/* ─── Chat Window ─── */
.scoop-chat {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 620px;
    max-height: calc(100vh - 120px);
    background: var(--scoop-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--scoop-radius);
    box-shadow: var(--scoop-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99998;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.scoop-chat.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Mobile */
@media (max-width: 480px) {
    .scoop-chat {
        width: calc(100vw - 16px);
        height: calc(100vh - 80px);
        bottom: 8px;
        right: 8px;
        border-radius: 16px;
    }
    #scoop-chat-launcher {
        bottom: 16px;
        right: 16px;
    }
}

/* ─── Header ─── */
.scoop-head {
    background: linear-gradient(135deg, var(--scoop-primary), var(--scoop-secondary));
    padding: 16px 18px;
    color: white;
    flex-shrink: 0;
}

.scoop-head-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scoop-head-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scoop-avatar-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.scoop-avatar-letter {
    font-size: 18px;
    font-weight: 700;
}

.scoop-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.scoop-head p {
    margin: 4px 0 0;
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.scoop-status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: scoop-dot-pulse 2s infinite;
}

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

.scoop-head-actions {
    display: flex;
    gap: 6px;
}

.scoop-head-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.scoop-head-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ─── Message Log ─── */
.scoop-log {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: var(--scoop-surface);
    display: flex;
    flex-direction: column;
    gap: 3px;
    scroll-behavior: smooth;
}

.scoop-log::-webkit-scrollbar {
    width: 4px;
}

.scoop-log::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* ─── Messages ─── */
.scoop-msg {
    max-width: 82%;
    padding: 11px 15px;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.5;
    animation: scoop-msg-in 0.3s ease;
    word-break: break-word;
}

.scoop-msg p {
    margin: 0;
}

.scoop-msg.user {
    align-self: flex-end;
    background: var(--scoop-primary);
    color: white;
    margin-left: auto;
    border-radius: 14px 14px 4px 14px;
}

.scoop-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: var(--scoop-text);
    margin-right: auto;
    border-radius: 14px 14px 14px 4px;
    border: 1px solid var(--scoop-border);
}

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

/* ─── Product Cards ─── */
.scoop-products-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: thin;
}

.scoop-products-grid::-webkit-scrollbar {
    height: 4px;
}

.scoop-product-card {
    min-width: 150px;
    max-width: 150px;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid var(--scoop-border);
    flex-shrink: 0;
    transition: box-shadow 0.2s;
}

.scoop-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.scoop-p-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.scoop-p-title {
    font-size: 12px;
    font-weight: 600;
    margin: 6px 0 3px;
    color: var(--scoop-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scoop-p-price {
    color: var(--scoop-primary);
    font-weight: 700;
    font-size: 14px;
}

.scoop-stock {
    display: block;
    font-size: 10px;
    font-weight: 600;
    margin: 3px 0;
}
.scoop-stock.in { color: #16a34a; }
.scoop-stock.out { color: #dc2626; }

.scoop-view-btn {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--scoop-primary);
    text-decoration: none;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--scoop-primary);
    margin-top: 4px;
    transition: all 0.2s;
}

.scoop-view-btn:hover {
    background: var(--scoop-primary);
    color: #fff;
}

.scoop-cart-btn {
    background: var(--scoop-primary);
    color: white;
    border: none;
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    margin-top: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.scoop-cart-btn:hover { opacity: 0.9; }
.scoop-cart-btn.added { background: #16a34a; }

/* ─── Quick Chips ─── */
.scoop-chip-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.scoop-chip {
    background: #fff;
    border: 1px solid var(--scoop-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: var(--scoop-text);
}

.scoop-chip:hover {
    background: var(--scoop-primary);
    color: white;
    border-color: var(--scoop-primary);
}

/* FAQ suggestion chips */
.scoop-faq-suggestions {
    margin-top: 8px;
}

.scoop-faq-label {
    font-size: 11px;
    color: var(--scoop-text-muted);
    margin: 0 0 6px 0;
}

.scoop-faq-chip {
    font-size: 11px;
    padding: 5px 10px;
}

/* ─── Typing Indicator ─── */
.scoop-thinking {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    align-items: center;
}

.scoop-wave {
    width: 6px;
    height: 6px;
    background: var(--scoop-primary);
    border-radius: 50%;
    animation: scoop-bounce 1.2s infinite;
}

.scoop-wave:nth-child(2) { animation-delay: 0.15s; }
.scoop-wave:nth-child(3) { animation-delay: 0.3s; }

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

/* ─── Ad Banner ─── */
.scoop-ad-banner {
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-top: 1px solid #fbbf24;
    flex-shrink: 0;
    font-size: 12px;
    position: relative;
}

.scoop-ad-banner .scoop-ad-title {
    font-weight: 700;
    font-size: 13px;
    color: #92400e;
    margin: 0 0 3px 0;
}

.scoop-ad-banner .scoop-ad-text {
    color: #78350f;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.scoop-ad-banner .scoop-ad-cta {
    display: inline-block;
    padding: 4px 12px;
    background: #f59e0b;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    text-decoration: none;
    transition: background 0.2s;
}

.scoop-ad-banner .scoop-ad-cta:hover { background: #d97706; }

.scoop-ad-banner .scoop-ad-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: #92400e;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
}

.scoop-ad-banner .scoop-ad-close:hover { opacity: 1; }

.scoop-ad-badge {
    font-size: 9px;
    font-weight: 600;
    color: #b45309;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inline ad (appears in chat) */
.scoop-inline-ad {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 12px;
    margin: 8px 0;
    animation: scoop-msg-in 0.3s ease;
}

.scoop-inline-ad .scoop-ad-badge { color: #1d4ed8; }
.scoop-inline-ad .scoop-ad-title { color: #1e3a5f; font-weight: 600; font-size: 13px; margin: 4px 0; }
.scoop-inline-ad .scoop-ad-text { color: #374151; font-size: 12px; margin: 0 0 8px 0; }
.scoop-inline-ad img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }

.scoop-inline-ad .scoop-ad-cta {
    display: inline-block;
    padding: 5px 14px;
    background: #3b82f6;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
}

.scoop-inline-ad .scoop-ad-cta:hover { background: #2563eb; }

/* ─── Input Area ─── */
#scoop-form {
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid var(--scoop-border);
    flex-shrink: 0;
}

.scoop-input-box {
    display: flex;
    background: var(--scoop-surface);
    border-radius: 28px;
    padding: 4px;
    border: 1px solid var(--scoop-border);
    transition: border-color 0.2s;
}

.scoop-input-box:focus-within {
    border-color: var(--scoop-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#scoop-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--scoop-text);
}

#scoop-input::placeholder {
    color: var(--scoop-text-muted);
}

.scoop-send-btn {
    background: var(--scoop-primary);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.scoop-send-btn:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

/* ─── Powered By ─── */
.scoop-powered {
    text-align: center;
    padding: 6px;
    font-size: 10px;
    color: var(--scoop-text-muted);
    background: #fff;
}
