/* ==========================================================================
   Aurloo UI — Unified Design System
   Single source of truth for the web (homepage, legal, seller portal, admin).
   Brand: violet #7C3AED + pink #EC4899, Inter, light surfaces.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Brand */
    --purple: #7C3AED;
    --purple-dark: #5B21B6;
    --purple-light: #A78BFA;
    --purple-tint: #F5F3FF;
    --pink: #EC4899;
    --pink-dark: #DB2777;
    --pink-tint: #FCE7F3;
    --brand-gradient: linear-gradient(135deg, #7C3AED, #EC4899);

    /* Back-compat aliases (older templates reference these names) */
    --primary-color: var(--purple);
    --primary-dark: var(--purple-dark);
    --secondary-color: var(--pink);
    --accent: var(--purple);
    --accent-2: var(--pink);

    /* Neutrals (slate scale) */
    --ink: #0F172A;
    --slate-700: #334155;
    --muted: #64748B;
    --slate-400: #94A3B8;
    --border-strong: #CBD5E1;
    --border: #E2E8F0;
    --slate-100: #F1F5F9;
    --surface-dim: #F8FAFC;
    --surface: #FFFFFF;

    /* Text */
    --text: var(--ink);
    --text-secondary: var(--muted);

    /* Semantic */
    --success: #10B981;
    --success-tint: rgba(16, 185, 129, .1);
    --warning: #F59E0B;
    --warning-tint: rgba(245, 158, 11, .1);
    --danger: #EF4444;
    --danger-tint: rgba(239, 68, 68, .1);
    --info: #3B82F6;
    --info-tint: rgba(59, 130, 246, .1);

    /* Shape */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, .08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .1);
    --shadow-purple: 0 8px 30px rgba(124, 58, 237, .25);

    /* Focus ring */
    --focus-ring: 0 0 0 3px rgba(124, 58, 237, .15);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
.aurloo-ui,
.aurloo-ui * {
    box-sizing: border-box;
}

.aurloo-ui {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--surface-dim);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Custom scrollbar */
.aurloo-ui ::-webkit-scrollbar { width: 8px; height: 8px; }
.aurloo-ui ::-webkit-scrollbar-track { background: var(--slate-100); }
.aurloo-ui ::-webkit-scrollbar-thumb {
    background: var(--brand-gradient);
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: .875rem;
    line-height: 1.4;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all .25s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: var(--shadow-purple);
}

.btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 35px rgba(124, 58, 237, .35);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--purple);
    color: var(--purple);
}

.btn-ghost {
    background: transparent;
    color: var(--purple);
}

.btn-ghost:hover {
    background: var(--purple-tint);
}

/* --------------------------------------------------------------------------
   4. Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
}

.card-body { padding: 1.25rem; }

.card-title {
    color: var(--text);
    font-weight: 600;
    margin-bottom: .5rem;
}

/* Stats card */
.stats-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--purple-tint) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: transform .3s ease, box-shadow .3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-purple);
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--purple);
    display: block;
}

.stats-label {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-top: .5rem;
}

/* --------------------------------------------------------------------------
   5. Forms
   -------------------------------------------------------------------------- */
.form-control,
.form-select {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
}

.form-control:focus,
.form-select:focus {
    background: var(--surface);
    border-color: var(--purple);
    color: var(--text);
    box-shadow: var(--focus-ring);
}

.form-label {
    color: var(--text);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. Tables
   -------------------------------------------------------------------------- */
.table {
    color: var(--text);
}

.table thead th {
    background: var(--surface-dim);
    color: var(--muted);
    border-color: var(--border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .03em;
}

.table td,
.table th {
    border-color: var(--border);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: var(--purple-tint);
}

/* --------------------------------------------------------------------------
   7. Badges & alerts
   -------------------------------------------------------------------------- */
.badge { font-weight: 500; border-radius: 6px; }

.alert { border-radius: var(--radius-sm); border: 1px solid transparent; }
.alert-success { background: var(--success-tint); color: #047857; border-color: rgba(16, 185, 129, .25); }
.alert-warning { background: var(--warning-tint); color: #B45309; border-color: rgba(245, 158, 11, .25); }
.alert-danger,
.alert-error   { background: var(--danger-tint); color: #B91C1C; border-color: rgba(239, 68, 68, .25); }
.alert-info    { background: var(--info-tint); color: #1D4ED8; border-color: rgba(59, 130, 246, .25); }

/* Status pills */
.status-badge {
    padding: .35rem .85rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .5px;
}
.status-pending   { background: var(--warning-tint); color: #B45309; border: 1px solid rgba(245, 158, 11, .35); }
.status-approved,
.status-active    { background: var(--success-tint); color: #047857; border: 1px solid rgba(16, 185, 129, .35); }
.status-rejected  { background: var(--danger-tint); color: #B91C1C; border: 1px solid rgba(239, 68, 68, .35); }
.status-suspended { background: var(--slate-100); color: var(--muted); border: 1px solid var(--border-strong); }

/* --------------------------------------------------------------------------
   8. Utilities
   -------------------------------------------------------------------------- */
.text-gradient {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-brand-tint { background: var(--purple-tint); }
.text-brand { color: var(--purple); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-secondary);
}
.empty-state .empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 1.25rem;
    background: var(--purple-tint);
    color: var(--purple);
    font-size: 1.75rem;
}
.empty-state h3 { color: var(--text); font-weight: 700; margin-bottom: .5rem; }
.empty-state p { max-width: 360px; margin: 0 auto 1.5rem; }

/* --------------------------------------------------------------------------
   9. Dark-utility compatibility (seller portal)
   The seller templates were authored for a dark theme and use Bootstrap's
   .text-white / .text-light / .table-dark / .bg-dark for body content. On the
   light theme these remap to readable tokens. Brand-colored components
   (.btn-primary, .badge, .status-badge, .user-avatar) set their own colors and
   are unaffected.
   -------------------------------------------------------------------------- */
.aurloo-ui .text-white { color: var(--text) !important; }
.aurloo-ui .text-light { color: var(--text-secondary) !important; }

.aurloo-ui .table-dark {
    --bs-table-bg: var(--surface);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: var(--surface-dim);
    --bs-table-hover-bg: var(--purple-tint);
    color: var(--text);
    border-color: var(--border);
}
.aurloo-ui .table-dark > :not(caption) > * > * {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.aurloo-ui .table-dark thead th {
    background: var(--surface-dim);
    color: var(--muted);
}

.aurloo-ui .bg-dark {
    background: var(--surface) !important;
    border: 1px solid var(--border);
}

/* Accessibility: respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .aurloo-ui *,
    .btn,
    .stats-card,
    .card {
        transition: none !important;
        animation: none !important;
    }
}
