/* ============================================================
   ANLGRAM Intelligence — Design System
   Inspired by Arkham Intelligence for TON/GRAM Network
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  /* Backgrounds (TON Navy Blue Aesthetic) */
  --bg-void:           #030712;
  --bg-primary:        #050c1e;
  --bg-secondary:      #08142c;
  --bg-sidebar:        #040918;
  --bg-card:           #0a1836;
  --bg-card-hover:     #0f224a;
  --bg-input:          #08142c;
  --bg-overlay:        rgba(3,7,18,0.85);

  /* Borders (Sleek Blue Tinted) */
  --border-subtle:     #122442;
  --border-default:    #1b325c;
  --border-strong:     #26457a;
  --border-accent:     rgba(0,136,204,0.45);
  --border-cyan:       rgba(0,207,255,0.5);

  /* Text */
  --text-primary:      #e8e8ec;
  --text-secondary:    #8a8a9a;
  --text-muted:        #4a4a5a;
  --text-inverse:      #060608;

  /* Brand Colors */
  --ton-blue:          #0088CC;
  --ton-blue-dim:      rgba(0,136,204,0.15);
  --ton-blue-mid:      rgba(0,136,204,0.3);
  --cyan:              #00CFFF;
  --cyan-dim:          rgba(0,207,255,0.12);
  --cyan-mid:          rgba(0,207,255,0.25);

  /* Functional Colors */
  --green:             #22c55e;
  --green-dim:         rgba(34,197,94,0.12);
  --red:               #ef4444;
  --red-dim:           rgba(239,68,68,0.12);
  --yellow:            #00CFFF;
  --yellow-dim:        rgba(0,207,255,0.15);
  --purple:            #0088CC;
  --purple-dim:        rgba(0,136,204,0.15);
  --orange:            #0088CC;
  --orange-dim:        rgba(0,136,204,0.15);

  /* Gradients */
  --grad-primary:      linear-gradient(135deg, #0088CC, #00CFFF);
  --grad-card:         linear-gradient(180deg, #161620 0%, #121218 100%);
  --grad-hero:         radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,136,204,0.12) 0%, transparent 70%);
  --grad-glow-blue:    radial-gradient(circle at center, rgba(0,136,204,0.25) 0%, transparent 60%);
  --grad-glow-cyan:    radial-gradient(circle at center, rgba(0,207,255,0.2) 0%, transparent 60%);

  /* Shadows */
  --shadow-sm:         0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:         0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:         0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-blue:  0 0 20px rgba(0,136,204,0.3), 0 0 60px rgba(0,136,204,0.1);
  --shadow-glow-cyan:  0 0 16px rgba(0,207,255,0.25), 0 0 40px rgba(0,207,255,0.1);
  --shadow-card:       0 2px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-2xl:  16px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --font-display:'Inter', sans-serif;

  /* Font Sizes */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  38px;
  --text-5xl:  52px;
  --text-6xl:  68px;

  /* Transitions */
  --transition-fast:   all 0.12s ease;
  --transition-base:   all 0.2s ease;
  --transition-slow:   all 0.35s ease;
  --transition-spring: all 0.3s cubic-bezier(0.34,1.56,0.64,1);

  /* Layout */
  --sidebar-width:     220px;
  --topbar-height:     56px;
  --container-max:     1400px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Selection */
::selection { background: var(--ton-blue-mid); color: var(--text-primary); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }
ul, ol { list-style: none; }

/* ── Typography ───────────────────────────────────────────── */
.font-mono { font-family: var(--font-mono); }

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semi    { font-weight: 600; }
.font-bold    { font-weight: 700; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-blue      { color: var(--ton-blue); }
.text-cyan      { color: var(--cyan); }
.text-green     { color: var(--green); }
.text-red       { color: var(--red); }
.text-yellow    { color: var(--yellow); }

/* ── Utility Classes ──────────────────────────────────────── */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Glow Effects ─────────────────────────────────────────── */
.glow-blue { box-shadow: var(--shadow-glow-blue); }
.glow-cyan { box-shadow: var(--shadow-glow-cyan); }
.text-glow-blue { text-shadow: 0 0 20px rgba(0,136,204,0.6); }
.text-glow-cyan { text-shadow: 0 0 20px rgba(0,207,255,0.5); }

/* ── Status Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-blue   { background: var(--ton-blue-dim); color: var(--ton-blue); border: 1px solid rgba(0,136,204,0.2); }
.badge-cyan   { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(0,207,255,0.2); }
.badge-green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.badge-red    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(0,207,255,0.2); }
.badge-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(0,136,204,0.2); }
.badge-orange { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(0,136,204,0.2); }
.badge-muted  { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

/* Live indicator dot */
.dot-live {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50%       { opacity: 0.6; box-shadow: 0 0 12px var(--green); }
}

/* ── Dividers ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  width: 100%;
}
.divider-v {
  width: 1px;
  background: var(--border-subtle);
  align-self: stretch;
}

/* ── Change Indicators ────────────────────────────────────── */
.change-up   { color: var(--green); }
.change-down { color: var(--red); }
.change-neutral { color: var(--text-secondary); }

/* ── Universal Mobile Bottom Navigation Bar (Hidden on PC/Desktop) ──────── */
.mobile-bottom-nav {
  display: none !important;
}
.mobile-nav-item svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  flex-shrink: 0 !important;
}
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 68px;
    background: rgba(13, 13, 18, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.1);
    z-index: 99999;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
  }
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #64748b;
    text-decoration: none !important;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono, sans-serif);
    padding: 6px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
  }
  .mobile-nav-item svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  .mobile-nav-item.active {
    color: var(--cyan, #00f0ff);
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
  }
  .mobile-nav-item.active svg {
    stroke: var(--cyan, #00f0ff);
    transform: scale(1.1);
  }
}
@media (max-width: 480px) {
  .mobile-nav-item { font-size: 9px; padding: 4px 2px; }
  .mobile-nav-item svg { width: 18px !important; height: 18px !important; }
}
