/* ===================================================================
   AmartSeller — 主样式入口
   File: main.css
   =================================================================== */

@import './components/ai-assistant.css';

@import url('design-tokens.css');
@import url('reset.css');
@import url('utilities.css');
@import url('animations.css');
@import url('base.css');

/* 后续模块将在这里添加 */
@import url('components/buttons.css');
@import url('components/cards.css');
@import url('components/forms.css');
@import url('components/badges.css');
@import url('components/navigation.css');
@import url('components/modal.css');

/* ===================================================================
   Page-Specific Styles
   =================================================================== */
@import url('pages/home.css');
@import url('pages/features.css');
@import url('pages/pricing.css');
@import url('pages/guide.css');
@import url('pages/docs.css');
@import url('pages/auth.css');
@import url('pages/blog.css');
@import url('ocean-quantum.css');  /* Ocean & Quantum Consciousness theme (injected) */
/* ===================================================================
   AmartSeller — AI Assistant Floating Widget
   Left-side slide panel, indigo brand (#6366f1)
   =================================================================== */

.as-ai-assistant {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    font-family: var(--as-font-sans, system-ui, -apple-system, sans-serif);
}

/* ── Toggle Button ── */
.as-ai-toggle {
    width: 44px;
    height: 44px;
    border-radius: 0 10px 10px 0;
    background: var(--as-primary-500, #6366f1);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.25s ease;
    position: relative;
    z-index: 2;
}
.as-ai-toggle:hover {
    background: var(--as-primary-600, #4f46e5);
    box-shadow: 2px 4px 20px rgba(99, 102, 241, 0.5);
    transform: scale(1.05);
}
.as-ai-toggle:active {
    transform: scale(0.95);
}

/* ── Chat Panel ── */
.as-ai-panel {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 360px;
    max-height: 520px;
    height: calc(100vh - 120px);
    max-height: min(520px, calc(100vh - 100px));
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.as-ai-assistant--open .as-ai-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.as-ai-assistant--open .as-ai-toggle {
    opacity: 0;
    pointer-events: none;
}

/* ── Header ── */
.as-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--as-primary-500, #6366f1);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.as-ai-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.as-ai-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ── Messages ── */
.as-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--as-gray-50, #f8fafc);
}

.as-ai-msg {
    max-width: 85%;
    animation: asAiFadeIn 0.3s ease;
}
@keyframes asAiFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.as-ai-msg--user {
    align-self: flex-end;
}
.as-ai-msg--user .as-ai-msg__content {
    background: var(--as-primary-500, #6366f1);
    color: #fff;
    border-radius: 14px 14px 4px 14px;
}

.as-ai-msg--bot {
    align-self: flex-start;
}
.as-ai-msg--bot .as-ai-msg__content {
    background: #fff;
    color: var(--as-text-primary, #1e293b);
    border: 1px solid var(--as-gray-200, #e2e8f0);
    border-radius: 14px 14px 14px 4px;
}

.as-ai-msg__content {
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.as-ai-msg--typing .as-ai-msg__content {
    color: var(--as-text-muted, #94a3b8);
    font-style: italic;
}

/* ── Input Row ── */
.as-ai-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--as-gray-200, #e2e8f0);
    background: #fff;
}

.as-ai-input {
    flex: 1;
    border: 1px solid var(--as-gray-300, #cbd5e1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.as-ai-input:focus {
    border-color: var(--as-primary-500, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.as-ai-send {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--as-primary-500, #6366f1);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.as-ai-send:hover { background: var(--as-primary-600, #4f46e5); }
.as-ai-send:disabled { background: var(--as-gray-400, #94a3b8); cursor: not-allowed; }

/* ── Footer ── */
.as-ai-footer {
    padding: 6px 12px;
    font-size: 11px;
    color: var(--as-text-muted, #94a3b8);
    text-align: center;
    background: var(--as-gray-50, #f8fafc);
    border-top: 1px solid var(--as-gray-100, #f1f5f9);
}

/* ═══════════════════════════════════════════════════════
   Neuro Dots — AI touchpoints across the page
   ═══════════════════════════════════════════════════════ */

.as-ai-dot {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--as-primary-500, #6366f1);
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    animation: none;
}
.as-ai-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid var(--as-primary-500, #6366f1);
    opacity: 0.4;
    animation: asAiDotPulse 2s ease-in-out infinite;
}
@keyframes asAiDotPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.2; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* Show on hover of the parent */
*:has(> .as-ai-dot):hover > .as-ai-dot,
.as-ai-dot:hover {
    opacity: 1;
    width: 28px;
    height: 28px;
    right: -14px;
}
.as-ai-dot:hover {
    background: var(--as-primary-600, #4f46e5);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
    animation: asAiDotPop 0.3s ease;
}
.as-ai-dot:hover::after { opacity: 0; }
@keyframes asAiDotPop {
    0% { transform: translateY(-50%) scale(0.3); }
    50% { transform: translateY(-50%) scale(1.2); }
    100% { transform: translateY(-50%) scale(1); }
}

/* Tooltip on hover */
.as-ai-dot::before {
    content: attr(data-tip);
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-family: var(--as-font-sans, system-ui);
}
.as-ai-dot:hover::before {
    opacity: 1;
}

/* Exclude from admin layout */
body.admin-body .as-ai-dot { display: none !important; }

/* ── Selection action bar ── */
.as-ai-selection-bar {
    position: absolute;
    display: none;
    background: var(--as-primary-500, #6366f1);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    white-space: nowrap;
    font-family: var(--as-font-sans, system-ui);
    animation: asAiDotPop 0.2s ease;
}
.as-ai-selection-bar:hover {
    background: var(--as-primary-600, #4f46e5);
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .as-ai-panel {
        width: calc(100vw - 56px);
        max-height: 400px;
    }
}
