/* assets/bot/bot.css */
* { box-sizing: border-box; margin:0; padding:0; }

body {
    font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(to right, #e3f3e8, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    height: auto;
    min-height: 100vh;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent: #579459;
    --message-bot: #e6ecf3;
    --message-user: #d2f4dc;
    --border: #e2e2e2;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --message-bot: #374151;
    --message-user: #2bf4bb;
    --border: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
}

.chat-wrapper {
    width: 100%;
    max-width: 600px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px var(--shadow);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-in-out;
}

/* HEADER */
.chat-header {
    background: #579459;
    color: #fff;
    padding: 15px 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    background: #000;
}

.header-text h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-top: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.status-dot.online { background: #22c55e; }
.status-dot.offline { background: #ef4444; }
.status-dot.typing { background: #f59e0b; }

/* QUICK MENUS */
.quick-menus {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-wrap: wrap;
}

.menu-btn {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
}

/* CHAT BODY */
.chat-body {
    padding: 20px;
    background: var(--bg-secondary);
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.message {
    max-width: 85%;
    padding: 6px 8px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    animation: floatIn 0.3s ease-out;
    box-shadow: 0 2px 8px var(--shadow);
}

.message-bot {
    align-self: flex-start;
    background: var(--message-bot);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-user {
    align-self: flex-end;
    background: var(--message-user);
    color: #1c452b;
    border-bottom-right-radius: 4px;
}



.message-product {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.product-info {
    flex: 1;
}

.product-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}


.product-excerpt {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
}

.product-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 8px;
}


/* CHIPS */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
}

/* CHAT FOOTER */
.chat-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quick-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: var(--accent);
    color: white;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

#queryInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

#queryInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(87, 148, 89, 0.2);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #417341;
    transform: translateY(-1px);
}


/* LOADERS & SKELETONS */
.loader {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.dots span {
    display: inline-block;
    animation: blink 1.5s infinite;
    opacity: 0.2;
}

.dots span:nth-child(1) { animation-delay: 0s; }
.dots span:nth-child(2) { animation-delay: 0.3s; }
.dots span:nth-child(3) { animation-delay: 0.6s; }

.skeleton {
    background: linear-gradient(90deg,
        var(--bg-secondary) 25%,
        var(--border) 50%,
        var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.message-skeleton {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-text {
    height: 12px;
    border-radius: 6px;
    flex: 1;
}

.skeleton-text.short {
    width: 60%;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floatIn {
    0% { opacity: 0; transform: translateY(10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bubble {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* RESPONSIVE */
@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .chat-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        max-width: 100%;
    }

    .chat-body {
        height: calc(100vh - 180px);
    }

    .fab {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--accent);
        color: white;
        border: none;
        box-shadow: 0 4px 16px var(--shadow);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
    }
}
