/* ==========================================================
   Statistics Section — Data Console Redesign v2
   File: static/css/landing/statistics-console.css

   Scope: every rule is namespaced under #statistics with the
   cs-stats-* classes, unique to this file. Nothing in
   style.css / redesign.css / final-polish.css (which already
   scope their own overrides under #statistics) is edited or
   overridden — this only adds rules for brand-new class names,
   so .stat-card and friends (reused across every admin/adviser
   dashboard) are completely untouched.

   Uses the site's existing tokens (--primary, --cyan, --violet,
   --surface, --line, --radius, --font-display, --shadow-*)
   instead of introducing a new palette.
========================================================== */

#statistics .cs-stats-panel{
    position:relative;
    overflow:hidden;
    isolation:isolate;
    display:grid;
    grid-template-columns:1.35fr 1px 1fr;
    gap:0;
    margin-top:10px;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(148,163,255,.05) 0px,
            rgba(148,163,255,.05) 1px,
            transparent 1px,
            transparent 42px
        ),
        linear-gradient(180deg, rgba(148,163,255,.06), rgba(148,163,255,0) 40%),
        var(--surface);
    border:1px solid var(--line);
    border-radius:calc(var(--radius-lg) + 6px);
    box-shadow:
        var(--shadow-md),
        inset 0 1px 0 rgba(255,255,255,.04);
    animation:cs-stats-rise .7s cubic-bezier(.16,1,.3,1) both;
}

@keyframes cs-stats-rise{
    from{ opacity:0; transform:translateY(18px); }
    to{ opacity:1; transform:translateY(0); }
}

/* gradient hairline border on top edge */
#statistics .cs-stats-panel::before{
    content:"";
    position:absolute;
    inset:0;
    padding:1px;
    border-radius:inherit;
    background:linear-gradient(135deg, rgba(62,123,250,.55), rgba(34,211,238,.28) 35%, rgba(255,255,255,0) 60%);
    -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite:xor;
    mask-composite:exclude;
    pointer-events:none;
    z-index:1;
}

/* soft ambient glow blobs floating inside the console */
#statistics .cs-stats-panel::after{
    content:"";
    position:absolute;
    top:-140px;
    left:-100px;
    width:360px;
    height:360px;
    background:radial-gradient(circle, rgba(62,123,250,.22), transparent 70%);
    filter:blur(10px);
    pointer-events:none;
    z-index:0;
    animation:cs-stats-drift 9s ease-in-out infinite;
}

@keyframes cs-stats-drift{
    0%,100%{ transform:translate(0,0); }
    50%{ transform:translate(24px,18px); }
}

#statistics .cs-stats-live{
    position:absolute;
    top:24px;
    right:28px;
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:7px 14px 7px 10px;
    border-radius:999px;
    background:rgba(34,211,238,.08);
    border:1px solid rgba(34,211,238,.22);
    backdrop-filter:blur(6px);
    font-size:.76rem;
    font-weight:600;
    letter-spacing:.02em;
    color:#9fd9e6;
    z-index:3;
}

#statistics .cs-stats-live-dot{
    width:7px;
    height:7px;
    border-radius:50%;
    background:var(--cyan);
    box-shadow:0 0 0 0 rgba(34,211,238,.55);
    animation:cs-stats-pulse 2.2s ease-out infinite;
}

@keyframes cs-stats-pulse{
    0%   { box-shadow:0 0 0 0 rgba(34,211,238,.55); }
    70%  { box-shadow:0 0 0 8px rgba(34,211,238,0); }
    100% { box-shadow:0 0 0 0 rgba(34,211,238,0); }
}

#statistics .cs-stats-main{
    position:relative;
    z-index:2;
    padding:58px 46px 46px;
}

#statistics .cs-stats-main-label{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:.85rem;
    font-weight:600;
    letter-spacing:.03em;
    color:var(--cyan);
    margin-bottom:20px;
}

#statistics .cs-stats-main-label::before{
    content:"";
    width:16px;
    height:2px;
    border-radius:2px;
    background:linear-gradient(90deg,var(--cyan),transparent);
}

#statistics .cs-stats-main-number{
    position:relative;
    display:inline-block;
    font-family:var(--font-display);
    font-weight:800;
    font-size:clamp(3.6rem,7.5vw,5.6rem);
    line-height:1;
    letter-spacing:-.03em;
    margin-bottom:20px;
    background:linear-gradient(135deg,#ffffff 12%,#c9d6ff 55%,var(--cyan) 120%);
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
    filter:drop-shadow(0 0 26px rgba(62,123,250,.35));
}

#statistics .cs-stats-main-copy{
    max-width:42ch;
    color:var(--gray-500);
    font-size:1rem;
    line-height:1.7;
    margin-bottom:38px;
}

#statistics .cs-stats-bars{
    display:flex;
    align-items:flex-end;
    gap:8px;
    height:70px;
}

#statistics .cs-stats-bars span{
    flex:1;
    max-width:14px;
    border-radius:5px 5px 2px 2px;
    background:linear-gradient(to top,var(--primary),var(--cyan));
    opacity:.9;
    box-shadow:var(--glow-primary);
    transform:scaleY(0);
    transform-origin:bottom;
    animation:cs-stats-grow .7s cubic-bezier(.16,1,.3,1) both;
    transition:opacity .25s ease, filter .25s ease;
}

#statistics .cs-stats-bars:hover span{ opacity:.55; }
#statistics .cs-stats-bars span:hover{
    opacity:1 !important;
    filter:brightness(1.25);
}

@keyframes cs-stats-grow{
    from{ transform:scaleY(0); }
    to{ transform:scaleY(1); }
}

#statistics .cs-stats-bars span:nth-child(1){ height:32%; animation-delay:.05s; }
#statistics .cs-stats-bars span:nth-child(2){ height:48%; animation-delay:.10s; }
#statistics .cs-stats-bars span:nth-child(3){ height:40%; animation-delay:.15s; }
#statistics .cs-stats-bars span:nth-child(4){ height:64%; animation-delay:.20s; }
#statistics .cs-stats-bars span:nth-child(5){ height:58%; animation-delay:.25s; }
#statistics .cs-stats-bars span:nth-child(6){ height:78%; animation-delay:.30s; }
#statistics .cs-stats-bars span:nth-child(7){ height:70%; animation-delay:.35s; }
#statistics .cs-stats-bars span:nth-child(8){ height:100%; animation-delay:.40s; }

#statistics .cs-stats-divider{
    position:relative;
    z-index:2;
    background:linear-gradient(to bottom, transparent, var(--line-hi) 20%, var(--line-hi) 80%, transparent);
}

#statistics .cs-stats-side{
    position:relative;
    z-index:2;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:4px;
    padding:36px 38px;
}

#statistics .cs-stats-row{
    display:flex;
    align-items:center;
    gap:18px;
    padding:18px 14px;
    border-radius:16px;
    transition:background .25s ease, transform .25s ease, border-color .25s ease;
    border:1px solid transparent;
}

#statistics .cs-stats-row:not(:last-child){
    margin-bottom:4px;
    border-bottom:1px solid var(--line);
    border-radius:16px 16px 0 0;
}

#statistics .cs-stats-row:hover{
    background:rgba(148,163,255,.05);
    border-color:var(--line);
    transform:translateX(4px);
}

#statistics .cs-stats-dot{
    position:relative;
    width:42px;
    height:42px;
    min-width:42px;
    border-radius:13px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}

#statistics .cs-stats-dot::before{
    font-size:1.05rem;
    line-height:1;
}

#statistics .cs-stats-dot--primary{
    background:linear-gradient(135deg, rgba(62,123,250,.24), rgba(62,123,250,.08));
    box-shadow:inset 0 0 0 1px rgba(62,123,250,.35), 0 6px 16px rgba(62,123,250,.18);
}
#statistics .cs-stats-dot--primary::before{ content:"\1F393"; }

#statistics .cs-stats-dot--cyan{
    background:linear-gradient(135deg, rgba(34,211,238,.24), rgba(34,211,238,.08));
    box-shadow:inset 0 0 0 1px rgba(34,211,238,.35), 0 6px 16px rgba(34,211,238,.18);
}
#statistics .cs-stats-dot--cyan::before{ content:"\1F9D1\200D\1F3EB"; }

#statistics .cs-stats-dot--violet{
    background:linear-gradient(135deg, rgba(139,92,246,.24), rgba(139,92,246,.08));
    box-shadow:inset 0 0 0 1px rgba(139,92,246,.35), 0 6px 16px rgba(139,92,246,.18);
}
#statistics .cs-stats-dot--violet::before{ content:"\1F5C2"; }

#statistics .cs-stats-row-copy{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    flex:1;
    gap:12px;
}

#statistics .cs-stats-row-label{
    font-size:.95rem;
    color:var(--gray-500);
    transition:color .25s ease;
}

#statistics .cs-stats-row:hover .cs-stats-row-label{
    color:#c3cbee;
}

#statistics .cs-stats-row-number{
    font-family:var(--font-display);
    font-weight:800;
    font-size:1.8rem;
    color:var(--gray-900);
    font-variant-numeric:tabular-nums;
}

@media (max-width: 900px){
    #statistics .cs-stats-panel{
        grid-template-columns:1fr;
    }
    #statistics .cs-stats-divider{
        height:1px;
        width:auto;
        margin:0 40px;
        background:linear-gradient(to right, transparent, var(--line-hi) 20%, var(--line-hi) 80%, transparent);
    }
    #statistics .cs-stats-main{ padding:54px 26px 30px; }
    #statistics .cs-stats-side{ padding:26px 22px; }
    #statistics .cs-stats-live{ top:18px; right:18px; }
    #statistics .cs-stats-row:hover{ transform:none; }
}

@media (prefers-reduced-motion: reduce){
    #statistics .cs-stats-panel,
    #statistics .cs-stats-panel::after,
    #statistics .cs-stats-bars span,
    #statistics .cs-stats-live-dot{
        animation:none !important;
    }
    #statistics .cs-stats-bars span{ transform:none; }
}