/* WooCommerce Checkout Bot - Premium Glassmorphism Design System */

:root {
    --wc-bot-primary: #4F46E5;
    --wc-bot-primary-hover: #4338CA;
    --wc-bot-secondary: #7C3AED;
    --wc-bot-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --wc-bot-accent: #10B981;
    --wc-bot-bg-dark: #0F172A;
    --wc-bot-bg-card: rgba(30, 41, 59, 0.95);
    --wc-bot-glass-border: rgba(255, 255, 255, 0.12);
    --wc-bot-text-main: #F8FAFC;
    --wc-bot-text-muted: #94A3B8;
    --wc-bot-msg-user: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --wc-bot-msg-bot: rgba(51, 65, 85, 0.8);
    --wc-bot-radius-lg: 20px;
    --wc-bot-radius-md: 12px;
    --wc-bot-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

/* Container & Base Font */
.wc-bot-inline-wrap, .wc-bot-drawer-content {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--wc-bot-text-main);
    box-sizing: border-box;
}

.wc-bot-inline-wrap *, .wc-bot-drawer-content * {
    box-sizing: border-box;
}

.wc-bot-card {
    background: var(--wc-bot-bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--wc-bot-glass-border);
    border-radius: var(--wc-bot-radius-lg);
    box-shadow: var(--wc-bot-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 650px;
    margin: 25px auto;
    transition: all 0.3s ease;
}

/* Header */
.wc-bot-header {
    background: rgba(15, 23, 42, 0.8);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--wc-bot-glass-border);
}

.wc-bot-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
}

.wc-bot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.wc-bot-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background-color: var(--wc-bot-accent);
    border-radius: 50%;
    border: 2px solid #0F172A;
    box-shadow: 0 0 8px var(--wc-bot-accent);
    animation: wc-bot-pulse 2s infinite;
}

@keyframes wc-bot-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.wc-bot-title-area {
    flex: 1;
}

.wc-bot-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}

.wc-bot-subtitle {
    font-size: 0.78rem;
    color: var(--wc-bot-text-muted);
    display: block;
    margin-top: 2px;
}

.wc-bot-badge {
    background: rgba(79, 70, 229, 0.25);
    color: #A5B4FC;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Cart Banner */
.wc-bot-cart-banner {
    background: rgba(15, 23, 42, 0.5);
    padding: 12px 20px;
    border-bottom: 1px solid var(--wc-bot-glass-border);
}

.wc-bot-cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wc-bot-cart-items-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.wc-bot-cart-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wc-bot-cart-total-wrap {
    text-align: right;
}

.wc-bot-total-label {
    font-size: 0.78rem;
    color: var(--wc-bot-text-muted);
}

.wc-bot-total-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #34D399;
    margin-left: 6px;
}

/* Messages Area */
.wc-bot-messages {
    padding: 20px;
    height: 340px;
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.wc-bot-messages::-webkit-scrollbar {
    width: 6px;
}
.wc-bot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.wc-bot-msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: wc-bot-slide-up 0.25s ease-out forwards;
}

@keyframes wc-bot-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.wc-bot-msg-row.user {
    justify-content: flex-end;
}

.wc-bot-msg-bubble {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wc-bot-msg-row.bot .wc-bot-msg-bubble {
    background: var(--wc-bot-msg-bot);
    color: #E2E8F0;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.wc-bot-msg-row.user .wc-bot-msg-bubble {
    background: var(--wc-bot-msg-user);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.wc-bot-msg-time {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    display: block;
    text-align: right;
}

/* Typing Indicator */
.wc-bot-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
}

.wc-bot-typing-dot {
    width: 7px;
    height: 7px;
    background: #94A3B8;
    border-radius: 50%;
    animation: wc-bot-bounce 1.4s infinite ease-in-out both;
}

.wc-bot-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.wc-bot-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes wc-bot-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Order Approval Card */
.wc-bot-approval-card {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--wc-bot-glass-border);
    border-bottom: 1px solid var(--wc-bot-glass-border);
    padding: 16px 20px;
    animation: wc-bot-slide-up 0.3s ease-out;
}

.wc-bot-approval-header h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #F8FAFC;
    font-weight: 600;
}

.wc-bot-approval-body {
    background: rgba(30, 41, 59, 0.6);
    border-radius: var(--wc-bot-radius-md);
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #CBD5E1;
    margin-bottom: 14px;
}

.wc-bot-approval-body p {
    margin: 4px 0;
}

.wc-bot-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--wc-bot-radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
    text-transform: none;
}

.wc-bot-btn-approve {
    background: var(--wc-bot-gradient);
    color: #FFFFFF;
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.5);
}

.wc-bot-btn-approve:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(79, 70, 229, 0.7);
}

.wc-bot-btn-approve:active {
    transform: translateY(0);
}

/* Quick Chips */
.wc-bot-quick-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid var(--wc-bot-glass-border);
}

.wc-bot-chip {
    background: rgba(255, 255, 255, 0.08);
    color: #CBD5E1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.wc-bot-chip:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* Input Controls Bar */
.wc-bot-input-area {
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid var(--wc-bot-glass-border);
}

.wc-bot-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 41, 59, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 6px 6px 6px 14px;
    transition: border-color 0.25s ease;
}

.wc-bot-input-group:focus-within {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

#wc-bot-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    max-height: 80px;
}

#wc-bot-chat-input::placeholder {
    color: #64748B;
}

.wc-bot-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--wc-bot-gradient);
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.wc-bot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Floating Launcher Button */
.wc-bot-floating-trigger {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999990;
    background: var(--wc-bot-gradient);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-bot-floating-trigger:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.7);
}

.wc-bot-floating-label {
    font-weight: 700;
    font-size: 0.9rem;
}

.wc-bot-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0F172A;
}

/* Drawer / Modal Overlay */
.wc-bot-drawer-wrap {
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.wc-bot-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
}

.wc-bot-drawer-content {
    position: absolute;
    bottom: 25px;
    right: 25px;
    width: 420px;
    max-width: calc(100vw - 40px);
    z-index: 2;
}

.wc-bot-drawer-content .wc-bot-card {
    margin: 0;
}

.wc-bot-drawer-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    color: #94A3B8;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wc-bot-drawer-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

@media (max-width: 640px) {
    .wc-bot-drawer-content {
        right: 10px;
        left: 10px;
        bottom: 10px;
        width: auto;
    }
    .wc-bot-msg-bubble {
        max-width: 90%;
    }
}
