/* AiHub Theme - Light / Vercel-Stripe Style */

/* ====== Tailwind CDN handles utilities. This file adds custom components. ====== */

:root {
    --ai-primary: #6366f1;
    --ai-primary-light: #818cf8;
    --ai-accent: #8b5cf6;
    --ai-bg: #f8fafc;
    --ai-bg-alt: #f1f5f9;
    --ai-card: #ffffff;
    --ai-border: #e2e8f0;
    --ai-border-hover: #c7d2fe;
    --ai-text: #1e293b;
    --ai-text-secondary: #64748b;
    --ai-shadow: rgba(99, 102, 241, 0.08);
    --ai-shadow-hover: rgba(99, 102, 241, 0.15);
}

html { scroll-behavior: smooth; }

/* Gradient text */
.text-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glowing border card */
.glow-card {
    background: var(--ai-card);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px var(--ai-shadow);
}
.glow-card:hover {
    border-color: var(--ai-border-hover);
    box-shadow: 0 4px 16px var(--ai-shadow-hover);
}

/* Model card */
.model-card {
    background: var(--ai-card);
    border: 1px solid var(--ai-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--ai-shadow);
}
.model-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
    opacity: 0;
    transition: opacity 0.3s;
}
.model-card:hover {
    border-color: var(--ai-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--ai-shadow-hover);
}
.model-card:hover::before { opacity: 1; }
.model-card.soldout { opacity: 0.5; pointer-events: none; }
.model-card .soldout-ribbon {
    position: absolute; top: 12px; right: -30px;
    background: #ef4444; color: #fff; font-size: 12px;
    padding: 2px 32px; transform: rotate(45deg);
}

/* Category chip */
.ai-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 9999px;
    font-size: 14px; font-weight: 500;
    background: var(--ai-bg-alt);
    border: 1px solid var(--ai-border);
    color: var(--ai-text-secondary); cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.ai-chip:hover, .ai-chip.is-primary {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    color: #4f46e5;
}
.ai-chip .chip-icon {
    width: 18px; height: 18px; border-radius: 50%;
    display: inline-block;
}

/* Navbar glass */
.nav-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--ai-border);
}

/* Auth card */
.auth-card-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--ai-bg);
}

/* Dashboard sidebar */
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: 8px;
    color: var(--ai-text-secondary); font-size: 14px;
    transition: all 0.2s; text-decoration: none;
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}
.sidebar-link.active {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid #6366f1;
}

/* Stat card */
.stat-card {
    background: var(--ai-card);
    border: 1px solid var(--ai-border);
    border-radius: 12px; padding: 1.25rem;
    box-shadow: 0 1px 3px var(--ai-shadow);
}

/* Form styling */
.ai-input {
    background: #fff !important;
    border: 1px solid var(--ai-border) !important;
    color: var(--ai-text) !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
}
.ai-input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
    outline: none !important;
}
.ai-input::placeholder { color: #94a3b8 !important; }

/* AI button */
.btn-ai {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; border: none; border-radius: 8px;
    padding: 10px 24px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-ai:hover {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
    color: #fff;
}

/* Badge */
.ai-badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 9999px;
    font-size: 12px; font-weight: 500;
}
.ai-badge-green { background: rgba(34,197,94,0.1); color: #16a34a; }
.ai-badge-blue { background: rgba(59,130,246,0.1); color: #2563eb; }
.ai-badge-purple { background: rgba(139,92,246,0.1); color: #7c3aed; }
.ai-badge-red { background: rgba(239,68,68,0.1); color: #dc2626; }

/* Price display */
.price-tag {
    font-size: 1.5rem; font-weight: 700;
    color: #6366f1;
}
.price-tag .unit { font-size: 0.875rem; color: #4f46e5; }

.wholesale-table {
    width: min(100%, 360px);
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--ai-border);
    border-radius: 10px;
    background: #fff;
    color: var(--ai-text);
    font-size: 13px;
}
.wholesale-table th,
.wholesale-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--ai-border);
}
.wholesale-table thead th {
    background: var(--ai-bg-alt);
    color: var(--ai-text-secondary);
    font-weight: 600;
}
.wholesale-table tbody tr:last-child td { border-bottom: 0; }
.wholesale-table tbody td:last-child {
    color: #4f46e5;
    font-weight: 700;
}

/* SKU chip */
.sku {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 14px; border-radius: 8px;
    font-size: 13px; cursor: pointer;
    background: var(--ai-bg-alt);
    border: 1px solid var(--ai-border);
    color: var(--ai-text-secondary); transition: all 0.2s;
    text-decoration: none;
}
.sku:hover, .sku.is-primary {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1; color: #4f46e5;
}
.sku .badge-money { color: #d97706; font-size: 12px; margin-left: 4px; }

/* Pay list */
.pay-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-list .pay {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 12px;
    background: var(--ai-bg-alt); border: 1px solid var(--ai-border);
    text-decoration: none; cursor: pointer; user-select: none;
    transition: all .2s ease;
}
.pay-list .pay img { width: 22px; height: 22px; object-fit: cover; border-radius: 6px; }
.pay-list .pay span { font-size: 14px; font-weight: 600; color: var(--ai-text); }
.pay-list .pay:hover { background: rgba(99,102,241,0.08); border-color: #6366f1; transform: translateY(-1px); }
.pay-list .pay.is-primary,
.pay-list .pay.active,
.pay-list .pay.selected {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); border-color: transparent;
    box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}
.pay-list .pay.is-primary span,
.pay-list .pay.active span,
.pay-list .pay.selected span { color: #fff; }

/* Loading spinner */
:root {
    --chahuo-ring-z: 2147483647;
    --chahuo-ring-overlay: rgba(255,255,255,.6);
    --chahuo-ring-color: #6366f1;
    --chahuo-ring-size: 50px;
    --chahuo-ring-border: 4px;
}
.chahuo-ring-overlay {
    position: fixed; inset: 0;
    display: none; place-items: center;
    z-index: var(--chahuo-ring-z);
    background: var(--chahuo-ring-overlay);
    backdrop-filter: blur(2px);
}
.chahuo-ring-overlay[mask-hidden="false"] { display: grid; }
.chahuo-ring-inline { display: inline-grid; place-items: center; }
.chahuo-ring {
    width: var(--chahuo-ring-size); aspect-ratio: 1; display: grid;
    border: var(--chahuo-ring-border) solid transparent; border-radius: 50%;
    border-right-color: var(--chahuo-ring-color);
    animation: chahuo-ring-spin 1s infinite linear;
}
.chahuo-ring::before, .chahuo-ring::after {
    content: ""; grid-area: 1/1; margin: 2px;
    border: inherit; border-radius: 50%;
    animation: chahuo-ring-spin 2s infinite;
}
.chahuo-ring::after { margin: 8px; animation-duration: 3s; }
@keyframes chahuo-ring-spin { to { transform: rotate(1turn); } }

/* Override layui for light theme */
.layui-table { background: transparent !important; color: var(--ai-text) !important; }
.layui-table td, .layui-table th { border-color: var(--ai-border) !important; }

/* Override bootstrap-table for light theme */
.bootstrap-table .table { color: var(--ai-text); }
.bootstrap-table .table td, .bootstrap-table .table th { border-color: var(--ai-border); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ai-bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Responsive mobile menu */
@media (max-width: 768px) {
    .mobile-menu { display: block !important; }
    .desktop-menu { display: none !important; }
}
