/* ============================================
   GiáSố Bot — GenUI Design System
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --deep-space: #05070A;
    --surface: #0F1218;
    --neon-cyan: #00F0FF;
    --electric-purple: #BD00FF;
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-hover: rgba(255, 255, 255, 0.06);
    --text: #f1f5f9;
    --text-muted: #6b7280;
    --text-dim: #4b5563;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body {
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--deep-space);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #374151; }
::selection { background: var(--electric-purple); color: white; }

/* --- Background Effects --- */
.bg-grid {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    opacity: 0.03;
    background-image:
        linear-gradient(#ffffff 1px, transparent 1px),
        linear-gradient(90deg, #ffffff 1px, transparent 1px);
    background-size: 40px 40px;
}

.bg-blob {
    position: fixed; pointer-events: none; z-index: 0;
    border-radius: 50%; filter: blur(100px);
}
.bg-blob-1 {
    top: 20%; left: 20%; width: 400px; height: 400px;
    background: rgba(189, 0, 255, 0.08);
    animation: float 6s ease-in-out infinite;
}
.bg-blob-2 {
    bottom: 20%; right: 20%; width: 350px; height: 350px;
    background: rgba(0, 240, 255, 0.06);
    animation: float 6s ease-in-out infinite 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes liquid {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

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

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce-dots {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* --- Header --- */
#header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.header-left {
    display: flex; align-items: center; gap: 10px;
}

.orb-logo {
    position: relative; width: 32px; height: 32px;
}
.orb-logo-glow {
    position: absolute; inset: 0;
    background: var(--electric-purple);
    border-radius: 50%; filter: blur(8px);
    animation: pulse-slow 4s ease-in-out infinite;
}
.orb-logo-core {
    position: relative; width: 100%; height: 100%;
    background: var(--deep-space);
    border-radius: 50%; border: 1px solid #374151;
    display: flex; align-items: center; justify-content: center;
}
.orb-logo-core i { color: var(--neon-cyan); font-size: 12px; }

.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand-light { color: #6b7280; font-weight: 300; }

.header-right { display: flex; align-items: center; gap: 12px; }

.status-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
    animation: pulse-slow 2s ease-in-out infinite;
}
.status-badge span { font-size: 12px; color: #9ca3af; font-weight: 500; }

/* --- Chat Container --- */
.chat-container {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 80px 16px 200px;
    display: flex; flex-direction: column; gap: 20px;
    position: relative; z-index: 1;
    scroll-behavior: smooth;
}

/* --- Welcome Screen --- */
.welcome {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center;
    padding: 40px 20px; flex: 1;
    animation: fadeInUp 0.6s ease;
}

.ai-orb {
    position: relative; width: 140px; height: 140px; margin-bottom: 32px;
}
.orb-gradient {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.8), rgba(189, 0, 255, 0.6), transparent);
    filter: blur(20px);
    animation: liquid 8s ease-in-out infinite;
    mix-blend-mode: screen;
}
.orb-inner {
    position: absolute; inset: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    animation: liquid 8s ease-in-out infinite reverse;
}
.orb-core {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; z-index: 2;
}
.orb-core > div, .orb-core {
    display: flex; align-items: center; justify-content: center;
}
.orb-core i {
    font-size: 32px; color: rgba(255, 255, 255, 0.8);
    animation: pulse-slow 4s ease-in-out infinite;
}
.orb-particle {
    position: absolute; border-radius: 50%;
}
.orb-particle-1 {
    top: 0; left: 50%; width: 4px; height: 4px;
    background: white; box-shadow: 0 0 10px white;
    animation: spin 3s linear infinite;
    transform-origin: 0 70px;
}
.orb-particle-2 {
    bottom: 0; right: 50%; width: 5px; height: 5px;
    background: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan);
    animation: spin 4s linear infinite reverse;
    transform-origin: 0 -60px;
}

.welcome-title {
    font-size: 28px; font-weight: 500; text-align: center;
    line-height: 1.3; margin-bottom: 12px; letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(to right, var(--neon-cyan), var(--electric-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.welcome-subtitle {
    color: var(--text-muted); text-align: center;
    font-size: 16px; font-weight: 300; max-width: 420px;
}

/* --- Messages --- */
.message {
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}
.message.user { align-self: flex-end; }
.message.bot { align-self: flex-start; }

.message .bubble {
    padding: 14px 18px; border-radius: 20px;
    line-height: 1.6; font-size: 14px; word-wrap: break-word;
}

.message.user .bubble {
    background: linear-gradient(135deg, var(--electric-purple), #7B00FF);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(189, 0, 255, 0.3);
    color: white;
}

.message.bot .bubble {
    background: var(--glass-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

/* Bot message avatar */
.message.bot {
    padding-left: 0;
}
.bot-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.bot-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--electric-purple), #3b82f6);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(189, 0, 255, 0.3);
}
.bot-avatar i { color: white; font-size: 10px; }
.bot-label { font-size: 12px; color: var(--text-muted); }

/* Bot bubble markdown */
.message.bot .bubble h3 { margin: 8px 0 4px; font-size: 15px; font-weight: 600; }
.message.bot .bubble p { margin: 4px 0; }
.message.bot .bubble ul, .message.bot .bubble ol { padding-left: 20px; margin: 4px 0; }
.message.bot .bubble li { margin: 2px 0; }
.message.bot .bubble strong { color: var(--neon-cyan); }
.message.bot .bubble a { color: var(--electric-purple); text-decoration: none; }
.message.bot .bubble a:hover { text-decoration: underline; }
.message.bot .bubble code {
    background: rgba(255, 255, 255, 0.06); padding: 2px 6px;
    border-radius: 4px; font-size: 13px;
}
.message.bot .bubble em { color: var(--text-muted); font-style: italic; }

/* Tables in bot messages */
.message.bot .bubble table {
    width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px;
}
.message.bot .bubble th, .message.bot .bubble td {
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    text-align: left;
}
.message.bot .bubble th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600; font-size: 12px;
}

/* User message timestamp */
.msg-time {
    font-size: 10px; color: var(--text-dim); margin-top: 4px;
    text-align: right;
}
.message.bot .msg-time { text-align: left; }

/* --- Order Card (GenUI Bento Style) --- */
.order-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px; margin: 8px 0;
    max-width: 400px;
    position: relative; overflow: hidden;
}
.order-card::before {
    content: ''; position: absolute; top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: var(--electric-purple);
    opacity: 0.1; border-radius: 50%; filter: blur(40px);
    pointer-events: none;
}

.order-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.order-code {
    font-size: 16px; font-weight: 700;
    color: var(--neon-cyan);
    letter-spacing: -0.02em;
}
.order-status {
    padding: 4px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.02em;
}
.order-status.new { background: rgba(245, 158, 11, 0.2); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.order-status.paid { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.order-status.delivered { background: rgba(34, 197, 94, 0.2); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.order-status.cancelled { background: rgba(107, 114, 128, 0.2); color: var(--text-muted); border: 1px solid rgba(107, 114, 128, 0.3); }

.order-product {
    font-size: 16px; font-weight: 600; margin-bottom: 4px;
}
.order-price {
    font-size: 24px; font-weight: 700; margin: 8px 0;
    background: linear-gradient(to right, var(--neon-cyan), var(--success));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* QR Container */
.qr-container {
    text-align: center; margin: 16px 0;
    padding: 16px; border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
}
.qr-container img {
    width: 200px; height: 200px; border-radius: 12px;
    background: white; padding: 4px;
}
.qr-label {
    font-size: 13px; color: var(--text-muted); margin-top: 10px;
    line-height: 1.5;
}
.qr-label strong { color: var(--neon-cyan); }

/* Delivery Info */
.delivery-info {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 16px; padding: 16px; margin-top: 16px;
}
.delivery-info h4 {
    color: var(--success); margin-bottom: 10px; font-size: 14px;
}
.delivery-info .account-field {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 13px;
    border-bottom: 1px solid rgba(34, 197, 94, 0.1);
}
.delivery-info .account-field:last-child { border-bottom: none; }
.delivery-info .account-field .label { color: var(--text-muted); }
.delivery-info .account-field .value {
    font-weight: 600; font-family: 'JetBrains Mono', monospace;
    color: var(--neon-cyan);
}

/* Phone Verification */
.phone-verify { margin-top: 16px; }
.phone-verify p { font-size: 14px; margin-bottom: 10px; color: var(--text-muted); }
.phone-input-row { display: flex; gap: 8px; }
.phone-input {
    width: 100px; padding: 10px 14px; border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg); color: var(--text);
    font-size: 18px; text-align: center;
    letter-spacing: 6px; font-weight: 700;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s;
}
.phone-input:focus {
    outline: none;
    border-color: var(--electric-purple);
    box-shadow: 0 0 12px rgba(189, 0, 255, 0.2);
}
.verify-btn {
    padding: 10px 20px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, var(--electric-purple), #7B00FF);
    color: white; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(189, 0, 255, 0.3);
}
.verify-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(189, 0, 255, 0.4);
}
.verify-btn:active { transform: scale(0.97); }

/* --- Typing Indicator --- */
.typing {
    display: flex; gap: 5px; padding: 14px 18px;
}
.typing span {
    width: 8px; height: 8px;
    background: var(--text-muted); border-radius: 50%;
    animation: bounce-dots 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

/* --- Quick Actions --- */
.quick-actions {
    position: fixed; bottom: 100px; left: 0; right: 0;
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center;
    padding: 0 16px; z-index: 40;
}

.quick-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #d1d5db; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: center; gap: 6px;
    font-family: 'Inter Tight', sans-serif;
}
.quick-btn:hover {
    background: rgba(189, 0, 255, 0.15);
    border-color: rgba(189, 0, 255, 0.4);
    box-shadow: 0 0 15px rgba(189, 0, 255, 0.2);
    transform: translateY(-2px);
    color: white;
}
.quick-btn i { font-size: 12px; }

/* --- Omni Bar --- */
#omnibar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    padding: 16px 16px 12px;
    background: linear-gradient(to top, var(--deep-space) 60%, transparent);
}

.omni-wrapper {
    position: relative; max-width: 700px; margin: 0 auto;
}

.omni-glow {
    position: absolute; inset: -2px;
    background: linear-gradient(to right, var(--neon-cyan), var(--electric-purple));
    border-radius: 999px; opacity: 0.25; filter: blur(2px);
    transition: opacity 0.5s;
}
.omni-wrapper:focus-within .omni-glow { opacity: 0.6; }

.omni-bar {
    position: relative;
    display: flex; align-items: center;
    background: var(--surface);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    height: 52px; padding: 0 6px;
}

.omni-bar input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); padding: 0 16px;
    font-size: 15px; font-weight: 300;
    font-family: 'Inter Tight', sans-serif;
}
.omni-bar input::placeholder { color: #4b5563; }

.send-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px;
    transition: all 0.3s;
    flex-shrink: 0;
}
.send-btn:hover, .omni-wrapper:focus-within .send-btn {
    background: var(--electric-purple);
    box-shadow: 0 0 12px rgba(189, 0, 255, 0.4);
}
.send-btn:active { transform: scale(0.92); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.omni-hint {
    text-align: center; margin-top: 6px;
    font-size: 10px; color: #374151; font-weight: 500; letter-spacing: 0.04em;
}
.omni-hint kbd {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px; border-radius: 4px;
    color: #6b7280; border: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Inter Tight', sans-serif; font-size: 10px;
}

/* --- Product Cards (Bento Grid) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 12px 0;
    max-width: 500px;
}

.product-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover {
    border-color: rgba(189, 0, 255, 0.4);
    box-shadow: 0 8px 24px rgba(189, 0, 255, 0.15);
    transform: translateY(-2px);
}
.product-card::before {
    content: ''; position: absolute; top: -20px; right: -20px;
    width: 80px; height: 80px;
    background: var(--electric-purple);
    opacity: 0.08; border-radius: 50%; filter: blur(30px);
    pointer-events: none;
}

.product-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.product-icon i { font-size: 20px; }
.product-icon svg { width: 24px; height: 24px; flex-shrink: 0; }

.product-service {
    font-size: 11px; color: var(--text-muted); font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.product-name {
    font-size: 14px; font-weight: 600; color: var(--text);
    margin-bottom: 8px; line-height: 1.3;
}

.product-price {
    font-size: 22px; font-weight: 700;
    background: linear-gradient(to right, var(--neon-cyan), var(--success));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.product-badges {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.badge-savings {
    padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
    background: rgba(34, 197, 94, 0.15); color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge-stock {
    padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.badge-stock.in-stock {
    background: rgba(34, 197, 94, 0.15); color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge-stock.pre-order {
    background: rgba(245, 158, 11, 0.15); color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.product-buy-btn {
    width: 100%; padding: 10px; border: none; border-radius: 14px;
    background: linear-gradient(135deg, var(--electric-purple), #7B00FF);
    color: white; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(189, 0, 255, 0.3);
    font-family: 'Inter Tight', sans-serif;
}
.product-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(189, 0, 255, 0.4);
}
.product-buy-btn:active { transform: scale(0.97); }

/* --- Contextual Suggestions --- */
.suggestions {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 10px; max-width: 85%;
    animation: fadeInUp 0.3s ease;
}
.suggestion-chip {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #d1d5db; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter Tight', sans-serif;
    white-space: nowrap;
}
.suggestion-chip:hover {
    background: rgba(189, 0, 255, 0.15);
    border-color: rgba(189, 0, 255, 0.4);
    box-shadow: 0 0 12px rgba(189, 0, 255, 0.2);
    transform: translateY(-1px);
    color: white;
}

/* --- Header Action Link --- */
.header-action {
    padding: 6px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d5db; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; gap: 6px;
    font-family: 'Inter Tight', sans-serif;
    text-decoration: none;
}
.header-action:hover {
    background: rgba(189, 0, 255, 0.15);
    border-color: rgba(189, 0, 255, 0.4);
    color: white;
}
.header-action i { font-size: 11px; }

/* --- Responsive --- */
@media (min-width: 768px) {
    .chat-container { padding: 90px 24px 220px; }
    .welcome-title { font-size: 40px; }
    .ai-orb { width: 160px; height: 160px; }
    .omni-bar { height: 56px; }
    .message { max-width: 75%; }
}

@media (max-width: 600px) {
    .message { max-width: 92%; }
    .order-card { max-width: 100%; padding: 18px; }
    .product-grid { grid-template-columns: 1fr; max-width: 100%; }
    .suggestions { max-width: 92%; }
    .quick-actions { padding: 0 8px; gap: 6px; }
    .quick-btn { padding: 8px 14px; font-size: 12px; }
    #omnibar { padding: 12px 10px 8px; }
    .omni-bar { height: 48px; }
    .welcome-title { font-size: 24px; }
    .ai-orb { width: 100px; height: 100px; }
}
