/* ─────────────────────────────────────────────
   Trade Enquirer — Design System
   Warm, premium, mobile-first.
   ───────────────────────────────────────────── */

/* ── Inter font (self-hosted) ── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/Inter-Bold.woff2') format('woff2');
}

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
    /* Primary — Warm amber/golden */
    --color-primary-50:  #fffbeb;
    --color-primary-100: #fef3c7;
    --color-primary-200: #fde68a;
    --color-primary-300: #fcd34d;
    --color-primary-400: #fbbf24;
    --color-primary-500: #e8a54b;
    --color-primary-600: #d4922a;
    --color-primary-700: #b47a1e;
    --color-primary-800: #8c5e17;
    --color-primary-900: #6b4712;

    /* Accent — Dark charcoal/navy */
    --color-accent-50:  #f8fafc;
    --color-accent-100: #f1f5f9;
    --color-accent-200: #e2e8f0;
    --color-accent-300: #cbd5e1;
    --color-accent-400: #94a3b8;
    --color-accent-500: #64748b;
    --color-accent-600: #475569;

    /* Success — Rich emerald */
    --color-success-50:  #ecfdf5;
    --color-success-500: #10b981;
    --color-success-600: #059669;
    --color-success-700: #047857;

    /* Warning */
    --color-warning-50:  #fff7ed;
    --color-warning-500: #f97316;
    --color-warning-600: #ea580c;

    /* Danger */
    --color-danger-50:  #fef2f2;
    --color-danger-500: #ef4444;
    --color-danger-600: #dc2626;

    /* Warm neutrals */
    --color-gray-50:  #fafaf9;
    --color-gray-100: #f5f5f4;
    --color-gray-200: #e7e5e4;
    --color-gray-300: #d6d3d1;
    --color-gray-400: #a8a29e;
    --color-gray-500: #78716c;
    --color-gray-600: #57534e;
    --color-gray-700: #44403c;
    --color-gray-800: #292524;
    --color-gray-900: #1c1917;

    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Shadows */
    --shadow-xs:  0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-primary: 0 0 0 3px rgba(212, 146, 42, 0.2);
    --shadow-success: 0 0 0 3px rgba(16, 185, 129, 0.15);
    --shadow-danger:  0 0 0 3px rgba(239, 68, 68, 0.15);

    /* Radii */
    --radius-sm:  0.375rem;
    --radius-md:  0.5rem;
    --radius-lg:  0.75rem;
    --radius-xl:  1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
}

/* ── Dark Mode Tokens ── */
.dark {
    --color-bg-primary: #1a1a1a;
    --color-bg-secondary: #242424;
    --color-bg-tertiary: #2e2e2e;
    --color-border: #3a3a3a;
    --color-text-primary: #f5f5f5;
    --color-text-secondary: #a3a3a3;
    --color-text-muted: #737373;
}

/* ── Base Styles ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    color: var(--color-gray-700);
    background-color: var(--color-gray-50);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary-600);
    color: white;
    font-weight: 600;
    z-index: 100;
    border-radius: 0 0 var(--radius-md) 0;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

/* Focus ring */
:focus-visible {
    outline: 2px solid var(--color-primary-600);
    outline-offset: 2px;
}

/* ── Scrollbar Styling ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

/* ── Utility Classes ── */
.container-app {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) {
    .container-app {
        padding: 0 1.5rem;
    }
}
@media (min-width: 1024px) {
    .container-app {
        padding: 0 2rem;
    }
}

/* Gradient text */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary-700), var(--color-primary-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Premium card hover effect */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Shimmer loading animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--color-gray-200) 25%, var(--color-gray-100) 50%, var(--color-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: var(--radius-md);
}

/* Pulse dot (for live indicators) */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.pulse-dot {
    animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Stat sparkline glow */
.stat-up { color: var(--color-success-600); }
.stat-down { color: var(--color-danger-500); }
.stat-neutral { color: var(--color-gray-500); }

/* ── Form Enhancements ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
    font-family: var(--font-body);
}

/* ── Print Styles ── */
@media print {
    .no-print,
    nav,
    .sidebar,
    .notification-bell,
    .wallet-widget {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
}
