/* ==========================================================================
   SAFI AI PRO STUDIO — Stylesheet
   تصميم استثنائي احترافي عالي الفخامة لواجهة الذكاء الاصطناعي المستقلة
   ========================================================================== */

:root {
    --ai-bg-main: #070a13;
    --ai-bg-surface: #0d1222;
    --ai-bg-surface-elevated: #131a30;
    --ai-bg-card: rgba(19, 26, 48, 0.72);
    --ai-bg-glass: rgba(13, 18, 34, 0.78);
    --ai-border: rgba(0, 243, 255, 0.14);
    --ai-border-hover: rgba(0, 243, 255, 0.45);
    --ai-border-subtle: rgba(255, 255, 255, 0.08);

    --ai-cyan: #00f3ff;
    --ai-cyan-glow: rgba(0, 243, 255, 0.35);
    --ai-purple: #8c52ff;
    --ai-purple-glow: rgba(140, 82, 255, 0.35);
    --ai-pink: #ff007a;
    --ai-green: #00ff9d;
    --ai-yellow: #ffb703;

    --ai-text-primary: #f8fafc;
    --ai-text-secondary: #94a3b8;
    --ai-text-muted: #64748b;

    --ai-gradient-brand: linear-gradient(135deg, #00f3ff 0%, #8c52ff 50%, #ff007a 100%);
    --ai-gradient-surface: linear-gradient(180deg, rgba(19, 26, 48, 0.9) 0%, rgba(13, 18, 34, 0.95) 100%);
    --ai-gradient-user-bubble: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);

    --ai-sidebar-width: 300px;
    --ai-header-height: 68px;
    --ai-shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
    --ai-shadow-glow: 0 0 30px rgba(0, 243, 255, 0.2);
}

body[data-theme="light"] {
    --ai-bg-main: #f1f5f9;
    --ai-bg-surface: #ffffff;
    --ai-bg-surface-elevated: #f8fafc;
    --ai-bg-card: rgba(255, 255, 255, 0.9);
    --ai-bg-glass: rgba(255, 255, 255, 0.88);
    --ai-border: rgba(99, 102, 241, 0.2);
    --ai-border-hover: rgba(99, 102, 241, 0.5);
    --ai-border-subtle: rgba(0, 0, 0, 0.08);

    --ai-cyan: #0284c7;
    --ai-cyan-glow: rgba(2, 132, 199, 0.25);
    --ai-purple: #6d28d9;
    --ai-purple-glow: rgba(109, 40, 217, 0.25);
    --ai-pink: #e11d48;
    --ai-green: #059669;
    --ai-yellow: #d97706;

    --ai-text-primary: #0f172a;
    --ai-text-secondary: #475569;
    --ai-text-muted: #94a3b8;

    --ai-gradient-brand: linear-gradient(135deg, #0284c7 0%, #6d28d9 50%, #e11d48 100%);
    --ai-gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --ai-gradient-user-bubble: linear-gradient(135deg, #1d4ed8 0%, #6366f1 100%);
    --ai-shadow-lg: 0 15px 30px -10px rgba(15, 23, 42, 0.12);
    --ai-shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
}

/* Base Reset & Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    height: 100dvh;
    font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--ai-bg-main);
    color: var(--ai-text-primary);
    overflow: hidden;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
}

/* Background Ambient Lighting */
.ai-ambient-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ai-ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

.ai-ambient-orb-1 {
    width: 480px;
    height: 480px;
    background: var(--ai-cyan);
    top: -100px;
    right: -100px;
}

.ai-ambient-orb-2 {
    width: 520px;
    height: 520px;
    background: var(--ai-purple);
    bottom: -120px;
    left: -120px;
    animation-delay: -9s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.12); }
}

/* App Shell Structure */
.ai-app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
}

/* Top App Bar */
.ai-app-header {
    height: var(--ai-header-height);
    background: var(--ai-bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--ai-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

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

/* Brand Display */
.ai-brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.ai-brand-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ai-gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    position: relative;
    box-shadow: 0 0 18px var(--ai-cyan-glow);
    flex-shrink: 0;
}

.ai-avatar-ping {
    position: absolute;
    bottom: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    background: var(--ai-green);
    border-radius: 50%;
    border: 2px solid var(--ai-bg-surface);
}

.ai-brand-meta {
    display: flex;
    flex-direction: column;
}

.ai-brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-pro-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--ai-cyan), var(--ai-purple));
    color: #ffffff;
    text-transform: uppercase;
    box-shadow: 0 2px 8px var(--ai-cyan-glow);
}

.ai-brand-subtitle {
    font-size: 12px;
    color: var(--ai-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-green);
    display: inline-block;
    box-shadow: 0 0 8px var(--ai-green);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Header Action Buttons */
.ai-btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--ai-border-subtle);
    background: var(--ai-bg-surface-elevated);
    color: var(--ai-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}

.ai-btn-icon:hover {
    color: var(--ai-cyan);
    border-color: var(--ai-border-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px var(--ai-cyan-glow);
}

.ai-btn-icon.active {
    color: #ffffff;
    background: var(--ai-purple);
    border-color: var(--ai-purple);
}

.ai-back-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 10px;
    background: var(--ai-bg-surface-elevated);
    border: 1px solid var(--ai-border-subtle);
    color: var(--ai-text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.ai-back-store-btn:hover {
    border-color: var(--ai-cyan);
    color: var(--ai-cyan);
    transform: translateX(-3px);
    box-shadow: 0 3px 12px var(--ai-cyan-glow);
}

.ai-sidebar-toggle-btn {
    display: none;
}

/* Main Arena (Sidebar + Chat Area) */
.ai-main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Sidebar */
.ai-sidebar {
    width: var(--ai-sidebar-width);
    background: var(--ai-bg-surface);
    border-left: 1px solid var(--ai-border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 20;
    overflow: hidden;
}

.ai-sidebar-header {
    padding: 16px 16px 10px;
}

.ai-new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.12), rgba(140, 82, 255, 0.12));
    border: 1px solid var(--ai-border);
    color: var(--ai-text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ai-new-chat-btn:hover {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.22), rgba(140, 82, 255, 0.22));
    border-color: var(--ai-cyan);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--ai-cyan-glow);
    color: #ffffff;
}

.ai-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-sidebar-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ai-text-muted);
    margin-bottom: 8px;
    padding: 0 6px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-clear-history-action {
    background: none;
    border: none;
    color: var(--ai-text-muted);
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}

.ai-clear-history-action:hover {
    color: var(--ai-pink);
}

/* Feature Topic Chips in Sidebar */
.ai-topic-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-topic-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ai-text-secondary);
    font-family: inherit;
    font-size: 13px;
    text-align: right;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-topic-btn:hover {
    background: var(--ai-bg-surface-elevated);
    border-color: var(--ai-border-subtle);
    color: var(--ai-text-primary);
    transform: translateX(-4px);
}

.ai-topic-btn i {
    font-size: 14px;
    width: 20px;
    text-align: center;
    color: var(--ai-cyan);
}

/* History Items */
.ai-history-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ai-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ai-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-history-item:hover, .ai-history-item.active {
    background: var(--ai-bg-surface-elevated);
    border-color: var(--ai-border-subtle);
    color: var(--ai-text-primary);
}

.ai-history-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.ai-history-del {
    background: none;
    border: none;
    color: var(--ai-text-muted);
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ai-history-item:hover .ai-history-del {
    opacity: 1;
}

.ai-history-del:hover {
    color: var(--ai-pink);
}

/* Human Support Card in Sidebar */
.ai-sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--ai-border-subtle);
    background: var(--ai-bg-surface);
}

.ai-support-banner {
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(140, 82, 255, 0.15), rgba(255, 0, 122, 0.15));
    border: 1px solid rgba(140, 82, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-support-banner-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

.ai-support-banner p {
    font-size: 11px;
    color: var(--ai-text-secondary);
    line-height: 1.4;
}

.ai-human-handoff-btn {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--ai-purple);
    color: #ffffff;
    border: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.ai-human-handoff-btn:hover {
    background: #7a3be0;
    box-shadow: 0 4px 15px var(--ai-purple-glow);
    transform: translateY(-1px);
}

/* Chat Main Arena */
.ai-chat-arena {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: transparent;
}

/* Messages Scroll View */
.ai-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 16px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    gap: 20px;
}

/* Welcome Hero View */
.ai-welcome-hero {
    margin: auto;
    max-width: 820px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 16px;
    animation: fadeInHero 0.5s ease;
}

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

/* Holographic AI Core Orb */
.ai-hero-core {
    position: relative;
    width: 110px;
    height: 110px;
    margin-bottom: 24px;
}

.ai-core-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(0, 243, 255, 0.4);
    animation: coreRotate 12s linear infinite;
}

.ai-core-ring-2 {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 1px solid rgba(140, 82, 255, 0.35);
    animation: coreRotateRev 16s linear infinite;
}

.ai-core-center {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: var(--ai-gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: #ffffff;
    box-shadow: 0 0 35px var(--ai-cyan-glow), 0 0 60px var(--ai-purple-glow);
    animation: corePulse 3s ease-in-out infinite alternate;
}

@keyframes coreRotate {
    100% { transform: rotate(360deg); }
}

@keyframes coreRotateRev {
    100% { transform: rotate(-360deg); }
}

@keyframes corePulse {
    0% { transform: scale(0.96); box-shadow: 0 0 25px var(--ai-cyan-glow); }
    100% { transform: scale(1.04); box-shadow: 0 0 45px var(--ai-cyan-glow), 0 0 75px var(--ai-purple-glow); }
}

.ai-welcome-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    background: var(--ai-gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.ai-welcome-desc {
    font-size: 15px;
    color: var(--ai-text-secondary);
    max-width: 600px;
    line-height: 1.65;
    margin-bottom: 32px;
}

/* Prompt Starters Grid */
.ai-prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    width: 100%;
}

.ai-prompt-card {
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--ai-bg-card);
    border: 1px solid var(--ai-border);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    text-align: right;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.ai-prompt-card:hover {
    border-color: var(--ai-cyan);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--ai-cyan-glow);
    background: var(--ai-bg-surface-elevated);
}

.ai-prompt-icon {
    font-size: 20px;
    color: var(--ai-cyan);
    margin-bottom: 2px;
}

.ai-prompt-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ai-text-primary);
    line-height: 1.45;
}

.ai-prompt-tag {
    font-size: 11px;
    color: var(--ai-text-muted);
}

/* Message Stream Styling */
.ai-message-row {
    display: flex;
    gap: 14px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    animation: messageSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ai-message-row.user {
    flex-direction: row-reverse;
}

.ai-msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 17px;
    color: #ffffff;
}

.ai-message-row.assistant .ai-msg-avatar {
    background: var(--ai-gradient-brand);
    box-shadow: 0 0 16px var(--ai-cyan-glow);
}

.ai-message-row.user .ai-msg-avatar {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.ai-msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    gap: 8px;
}

.ai-msg-bubble {
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.7;
    position: relative;
    word-break: break-word;
}

.ai-message-row.assistant .ai-msg-bubble {
    background: var(--ai-bg-card);
    border: 1px solid var(--ai-border);
    backdrop-filter: blur(14px);
    border-top-right-radius: 4px;
    color: var(--ai-text-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ai-message-row.user .ai-msg-bubble {
    background: var(--ai-gradient-user-bubble);
    border-top-left-radius: 4px;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
}

/* Markdown Formatted Elements in Bubble */
.ai-msg-bubble strong {
    font-weight: 800;
    color: var(--ai-cyan);
}

body[data-theme="light"] .ai-message-row.assistant .ai-msg-bubble strong {
    color: var(--ai-purple);
}

.ai-message-row.user .ai-msg-bubble strong {
    color: #ffffff;
}

.ai-msg-bubble ul, .ai-msg-bubble ol {
    margin: 8px 18px 8px 0;
}

.ai-msg-bubble li {
    margin-bottom: 4px;
}

.ai-msg-bubble p + p {
    margin-top: 10px;
}

.ai-msg-bubble code {
    font-family: 'Consolas', 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--ai-cyan);
}

.ai-msg-bubble pre {
    background: #060913;
    border: 1px solid var(--ai-border-subtle);
    padding: 12px 14px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 10px 0;
    direction: ltr;
    text-align: left;
}

.ai-msg-bubble pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
}

/* Rich Cards Inside Message (Products) */
.ai-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 12px;
    width: 100%;
}

.ai-product-card {
    background: var(--ai-bg-surface-elevated);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}

.ai-product-card:hover {
    border-color: var(--ai-cyan);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--ai-cyan-glow);
}

.ai-product-img-wrap {
    height: 130px;
    position: relative;
    background: #000000;
    overflow: hidden;
}

.ai-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ai-product-card:hover .ai-product-img {
    transform: scale(1.06);
}

.ai-product-discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--ai-pink);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(255, 0, 122, 0.4);
}

.ai-product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.ai-product-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ai-text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ai-product-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
}

.ai-product-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--ai-cyan);
}

body[data-theme="light"] .ai-product-price {
    color: var(--ai-purple);
}

.ai-product-base-price {
    font-size: 11px;
    text-decoration: line-through;
    color: var(--ai-text-muted);
}

.ai-product-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.ai-product-btn-view {
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--ai-bg-surface);
    border: 1px solid var(--ai-border-subtle);
    color: var(--ai-text-primary);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.ai-product-btn-view:hover {
    border-color: var(--ai-cyan);
    color: var(--ai-cyan);
}

.ai-product-btn-cart {
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--ai-gradient-brand);
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.ai-product-btn-cart:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Order Tracking Card */
.ai-order-card {
    background: var(--ai-bg-surface-elevated);
    border: 1px solid var(--ai-border);
    border-radius: 14px;
    padding: 16px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ai-border-subtle);
    padding-bottom: 10px;
}

.ai-order-id {
    font-weight: 800;
    font-size: 14px;
    color: var(--ai-cyan);
}

.ai-order-status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 255, 157, 0.15);
    color: var(--ai-green);
    border: 1px solid rgba(0, 255, 157, 0.3);
}

.ai-order-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 10px 0;
}

.ai-order-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.ai-order-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ai-bg-surface);
    border: 2px solid var(--ai-border-subtle);
    color: var(--ai-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.ai-order-step.completed .ai-order-step-dot {
    background: var(--ai-green);
    border-color: var(--ai-green);
    color: #061018;
    box-shadow: 0 0 10px var(--ai-green);
}

.ai-order-step.active .ai-order-step-dot {
    background: var(--ai-cyan);
    border-color: var(--ai-cyan);
    color: #061018;
    box-shadow: 0 0 12px var(--ai-cyan);
    animation: livePulse 2s infinite;
}

.ai-order-step-label {
    font-size: 10.5px;
    color: var(--ai-text-secondary);
    font-weight: 600;
}

/* Message Footer & Tools */
.ai-msg-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--ai-text-muted);
    padding: 0 6px;
}

.ai-msg-tool-btn {
    background: none;
    border: none;
    color: var(--ai-text-muted);
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: inherit;
}

.ai-msg-tool-btn:hover {
    color: var(--ai-cyan);
    background: rgba(0, 243, 255, 0.08);
}

/* Suggestion Pills underneath Assistant message */
.ai-suggestions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.ai-suggestion-pill {
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--ai-bg-surface-elevated);
    border: 1px solid var(--ai-border);
    color: var(--ai-text-secondary);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-suggestion-pill:hover {
    border-color: var(--ai-cyan);
    color: var(--ai-cyan);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px var(--ai-cyan-glow);
}

/* Typing Indicator */
.ai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: var(--ai-bg-card);
    border: 1px solid var(--ai-border);
    border-radius: 16px;
    width: fit-content;
}

.ai-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ai-cyan);
    animation: typingBounce 1.4s infinite ease-in-out both;
}

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

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

/* Bottom Input Dock */
.ai-input-dock {
    padding: 12px 24px 20px;
    background: linear-gradient(180deg, transparent 0%, var(--ai-bg-main) 30%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    z-index: 10;
}

/* Quick Category Ribbon */
.ai-quick-ribbon {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    max-width: 900px;
    width: 100%;
    padding: 2px 4px 6px;
    scrollbar-width: none;
}

.ai-quick-ribbon::-webkit-scrollbar {
    display: none;
}

.ai-ribbon-chip {
    padding: 5px 12px;
    border-radius: 16px;
    background: var(--ai-bg-card);
    border: 1px solid var(--ai-border-subtle);
    color: var(--ai-text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-ribbon-chip:hover {
    border-color: var(--ai-cyan);
    color: var(--ai-cyan);
    background: var(--ai-bg-surface-elevated);
}

/* Main Input Bar */
.ai-input-bar-wrap {
    max-width: 900px;
    width: 100%;
    background: var(--ai-bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--ai-border);
    border-radius: 18px;
    padding: 6px 10px 6px 14px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.ai-input-bar-wrap:focus-within {
    border-color: var(--ai-cyan);
    box-shadow: 0 8px 35px var(--ai-cyan-glow);
}

.ai-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--ai-text-primary);
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.5;
    padding: 8px 0;
    resize: none;
    max-height: 160px;
    min-height: 24px;
    outline: none;
    direction: rtl;
}

.ai-textarea::placeholder {
    color: var(--ai-text-muted);
}

.ai-input-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Microphone Button with Soundwave */
.ai-mic-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--ai-border-subtle);
    background: var(--ai-bg-surface-elevated);
    color: var(--ai-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    position: relative;
}

.ai-mic-btn:hover {
    color: var(--ai-cyan);
    border-color: var(--ai-cyan);
}

.ai-mic-btn.recording {
    background: var(--ai-pink);
    color: #ffffff;
    border-color: var(--ai-pink);
    animation: micPulse 1.2s infinite;
}

@keyframes micPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 122, 0.6); }
    70% { box-shadow: 0 0 0 14px rgba(255, 0, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 122, 0); }
}

/* Send Button */
.ai-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ai-gradient-brand);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px var(--ai-cyan-glow);
}

.ai-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px var(--ai-cyan-glow);
}

.ai-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Disclaimer text */
.ai-input-disclaimer {
    font-size: 11.5px;
    color: var(--ai-text-muted);
    text-align: center;
}

/* Toast Notification */
.ai-toast {
    position: fixed;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ai-bg-surface-elevated);
    border: 1px solid var(--ai-cyan);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--ai-cyan-glow);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Sidebar Drawer & Overlay */
.ai-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 19;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
    .ai-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        transform: translateX(100%);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .ai-sidebar.open {
        transform: translateX(0);
    }

    .ai-sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .ai-sidebar-toggle-btn {
        display: inline-flex;
    }

    .ai-messages-scroll {
        padding: 16px 12px 10px;
    }

    .ai-msg-bubble-wrap {
        max-width: 92%;
    }

    .ai-input-dock {
        padding: 8px 12px 14px;
    }

    .ai-welcome-title {
        font-size: 23px;
    }

    .ai-prompts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .ai-app-header {
        padding: 0 12px;
    }

    .ai-brand-subtitle {
        display: none;
    }

    .ai-back-store-btn span {
        display: none;
    }

    .ai-back-store-btn {
        padding: 7px 10px;
    }
}

/* ============================================================
   Super Enterprise AI v9.0 Additions: Tables, VIP Badges & Links
   ============================================================ */
.ai-table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 14px 0;
    border-radius: 12px;
    border: 1px solid var(--ai-border);
    background: rgba(15, 23, 42, 0.75);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ai-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: right;
    line-height: 1.5;
}

.ai-compare-table thead {
    background: rgba(140, 82, 255, 0.18);
    border-bottom: 2px solid rgba(0, 243, 255, 0.35);
}

.ai-compare-table th {
    padding: 12px 14px;
    font-weight: 800;
    color: var(--ai-cyan);
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.ai-compare-table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--ai-text-secondary);
    vertical-align: middle;
}

.ai-compare-table tr:last-child td {
    border-bottom: none;
}

.ai-compare-table tr:hover td {
    background: rgba(0, 243, 255, 0.05);
}

.ai-compare-table td strong {
    color: #ffffff;
}

/* Markdown Clickable Links */
.ai-chat-link {
    color: var(--ai-cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
}

.ai-chat-link:hover {
    color: #ffffff;
    text-shadow: 0 0 8px var(--ai-cyan-glow);
}

/* Callout Box */
.ai-callout {
    margin: 12px 0;
    padding: 10px 14px;
    border-right: 4px solid var(--ai-cyan);
    background: rgba(0, 243, 255, 0.08);
    border-radius: 0 10px 10px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ai-text-secondary);
}

/* Tiered VIP Badges */
.ai-vip-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.ai-vip-badge.vip-30 {
    background: linear-gradient(135deg, #f59e0b, #d97706, #b45309);
    border: 1px solid #fef08a;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.7);
    animation: vipGlowPulse 2.5s infinite ease-in-out;
}

@keyframes vipGlowPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.9); }
}

.ai-vip-badge.vip-17 {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: 1px solid #f472b6;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.ai-vip-badge.vip-9 {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    border: 1px solid #a78bfa;
}

.ai-vip-badge.vip-6,
.ai-vip-badge.vip-7 {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border: 1px solid #67e8f9;
}

.ai-vip-badge.vip-0 {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid #6ee7b7;
}

/* Savings Badge */
.ai-card-savings {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    z-index: 2;
}

/* Compare Button */
.ai-product-btn-compare {
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(140, 82, 255, 0.16);
    border: 1px solid rgba(140, 82, 255, 0.4);
    color: #c084fc;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ai-product-btn-compare:hover {
    background: var(--ai-purple);
    color: #ffffff;
    border-color: var(--ai-purple);
    box-shadow: 0 2px 12px var(--ai-purple-glow);
    transform: translateY(-1px);
}

