/* ============================================================================
   CLIKERADS DESIGN SYSTEM
   Single source of truth for color, type, spacing and elevation tokens.
   Built on top of the palette already used by includes/header.php so every
   page that adopts this file stays visually consistent with the app shell.
   ============================================================================ */

:root {
    /* ─── Brand & semantic colors ─────────────────────────────── */
    --primary:        #2563eb;
    --primary-dk:      #1d4ed8;
    --primary-dker:    #1e40af;
    --primary-lt:      #3b82f6;
    --primary-dim:     #eff6ff;
    --primary-mid:     #bfdbfe;
    --primary-ring:    rgba(37, 99, 235, .18);

    --accent:          #7c3aed;
    --accent-dim:      #f5f3ff;

    --success:         #10b981;
    --success-dim:     #ecfdf5;
    --warning:         #f59e0b;
    --warning-dim:     #fffbeb;
    --danger:          #dc2626;
    --danger-dim:      #fef2f2;
    --info:            #0ea5e9;
    --info-dim:        #f0f9ff;

    /* ─── Neutrals / text ──────────────────────────────────────── */
    --bg-nav:          #ffffff;
    --bg-page:         #f8fafc;
    --bg-card:         #ffffff;
    --text-main:       #0f172a;
    --text-soft:       #64748b;
    --text-xsoft:      #94a3b8;
    --border:          #e2e8f0;
    --border-2:        #cbd5e1;
    --surface:         #f8fafc;
    --surface-hover:   #f1f5f9;

    /* ─── FastCoins v3 legacy tokens (--fc-*) ──────────────────── */
    --fc-primary:      #7c3aed;
    --fc-primary-h:    #6d28d9;
    --fc-accent:       #a78bfa;
    --fc-ink:          #1e1b2e;
    --fc-slate:        #64748b;
    --fc-mist:         #ede9fe;
    --fc-cloud:        #f8f7ff;
    --fc-white:        #ffffff;
    --fc-border:       rgba(124, 58, 237, 0.12);
    --fc-shadow-sm:    0 1px 3px rgba(30, 27, 46, 0.08), 0 1px 2px rgba(30, 27, 46, 0.04);
    --fc-shadow-md:    0 4px 16px rgba(30, 27, 46, 0.10), 0 2px 6px rgba(30, 27, 46, 0.06);
    --fc-shadow-lg:    0 12px 40px rgba(30, 27, 46, 0.14), 0 4px 12px rgba(30, 27, 46, 0.08);
    --fc-radius:       14px;
    --fc-radius-sm:    8px;
    --fc-radius-pill:  999px;
    --font-display:    'Syne', sans-serif;
    --font-body:       'DM Sans', sans-serif;

    /* ─── Gradients (premium accents) ─────────────────────────── */
    --gradient-primary:  linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
    --gradient-primary-hover: linear-gradient(135deg, var(--primary-dk) 0%, var(--primary-dker) 100%);
    --gradient-violet:   linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-success:  linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-hot:      linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    --gradient-hero:     linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #1d4ed8 130%);

    /* ─── Radius scale ─────────────────────────────────────────── */
    --radius-xs:       4px;
    --radius-sm:       6px;
    --radius-md:       10px;
    --radius-lg:       14px;
    --radius-xl:       20px;
    --radius-full:     999px;

    /* ─── Elevation ────────────────────────────────────────────── */
    --shadow-xs:  0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm:  0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md:  0 4px 16px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .05);
    --shadow-lg:  0 10px 40px rgba(15, 23, 42, .10), 0 2px 8px rgba(15, 23, 42, .06);
    --shadow-xl:  0 24px 56px rgba(15, 23, 42, .14), 0 8px 20px rgba(15, 23, 42, .08);
    --shadow-glow-primary: 0 8px 24px rgba(37, 99, 235, .28);
    --shadow-nav: var(--shadow-sm);
    --shadow-drop: var(--shadow-lg);

    /* ─── Spacing scale ────────────────────────────────────────── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* ─── Typography ───────────────────────────────────────────── */
    --font:            'Plus Jakarta Sans', sans-serif;
    --fs-xs:   0.75rem;
    --fs-sm:   0.875rem;
    --fs-base: 1rem;
    --fs-lg:   1.125rem;
    --fs-xl:   1.375rem;
    --fs-2xl:  1.75rem;
    --fs-3xl:  2.25rem;
    --fs-4xl:  3rem;

    /* ─── Misc ─────────────────────────────────────────────────── */
    --transition:      0.18s ease;
    --transition-slow: 0.3s cubic-bezier(.4, 0, .2, 1);
    --max-w:           1280px;
    --nav-h:           64px;
}

/* ============================================================================
   BASE RESET
   ============================================================================ */
.ds-reset,
.ds-reset *,
.ds-reset *::before,
.ds-reset *::after { box-sizing: border-box; }

/* ============================================================================
   PREMIUM COMPONENT UTILITIES
   Opt-in classes pages can use without pulling in a whole framework rewrite.
   ============================================================================ */

/* Buttons */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1.4rem;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-weight: 600;
    font-size: var(--fs-sm);
    border: none;
    cursor: pointer;
    line-height: 1.1;
    white-space: nowrap;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}
.ds-btn:active { transform: translateY(1px); }

.ds-btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-glow-primary);
}
.ds-btn-primary:hover { background: var(--gradient-primary-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 12px 28px rgba(37, 99, 235, .35); }

.ds-btn-ghost {
    background: #fff;
    color: var(--text-main);
    border: 1.5px solid var(--border-2);
}
.ds-btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }

.ds-btn-lg { padding: .9rem 1.9rem; font-size: var(--fs-base); border-radius: var(--radius-lg); }
.ds-btn-sm { padding: .45rem 1rem; font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.ds-btn-block { width: 100%; }

/* Cards */
.ds-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}
.ds-card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.ds-card-elevated { box-shadow: var(--shadow-md); }

/* Badges */
.ds-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: var(--fs-xs);
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: var(--radius-full);
    letter-spacing: .02em;
}
.ds-badge-primary { background: var(--primary-dim); color: var(--primary); }
.ds-badge-success { background: var(--success-dim); color: var(--success); }
.ds-badge-warning { background: var(--warning-dim); color: #b45309; }
.ds-badge-danger  { background: var(--danger-dim); color: var(--danger); }
.ds-badge-hot     { background: var(--gradient-hot); color: #fff; box-shadow: 0 2px 8px rgba(239, 68, 68, .35); }

/* Inputs */
.ds-input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid var(--border-2);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: var(--fs-sm);
    color: var(--text-main);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.ds-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

@media (max-width: 768px) {
    .ds-input {
        font-size: 16px !important;
    }
}

/* Section / hero surfaces */
.ds-hero {
    background: var(--gradient-hero);
    color: #fff;
}

/* Responsive table -> stacked cards on small screens */
.ds-table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
    .ds-stack-mobile { display: flex; flex-direction: column; gap: var(--space-3); }
    .ds-hide-mobile   { display: none !important; }
}
@media (min-width: 641px) {
    .ds-hide-desktop  { display: none !important; }
}

/* Fade/slide-in utility for premium feel without a JS animation library */
@keyframes dsFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ds-animate-in { animation: dsFadeUp .45s cubic-bezier(.4,0,.2,1) both; }
