/* ============================================================
   base.css — GymBI by Statvo
   PURPOSE: CSS custom properties (design tokens), reset, and
   typography scale. Every other CSS file imports from these tokens.
   ============================================================ */

/* ------------------------------------------------------------
   GOOGLE FONTS IMPORT
   Inter = UI/body text | Space Mono = numbers/data
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ------------------------------------------------------------
   DESIGN TOKENS — Dark Mode (default)
   All colors, spacing, radius, shadow values live here.
   Override in theme.css for light mode.
   ------------------------------------------------------------ */
:root {
  /* --- Accent color (owner-customisable, default GymBI green) --- */
  --accent: #00C896;
  --accent-dim: rgba(0, 200, 150, 0.15);
  --accent-glow: rgba(0, 200, 150, 0.35);

  /* --- Base background layers --- */
  --bg-0: #080B10;      /* deepest bg — page background */
  --bg-1: #0E1219;      /* card/panel base */
  --bg-2: #141A24;      /* elevated surface */
  --bg-3: #1C2333;      /* hover/pressed state */

  /* --- Glass layers (semi-transparent) --- */
  --glass-1: rgba(14, 18, 25, 0.60);
  --glass-2: rgba(20, 26, 36, 0.75);
  --glass-3: rgba(28, 35, 51, 0.85);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-bright: rgba(255, 255, 255, 0.14);

  /* --- Text colors --- */
  --text-primary: #F0F4FF;
  --text-secondary: #8A97B0;
  --text-muted: #4A5568;
  --text-accent: var(--accent);

  /* --- Status colors --- */
  --status-active: #00C896;
  --status-expired: #FF4D6D;
  --status-paused: #FFB347;
  --status-info: #4DA6FF;

  /* --- Semantic colors --- */
  --success: #00C896;
  --danger: #FF4D6D;
  --warning: #FFB347;
  --info: #4DA6FF;

  /* --- Typography --- */
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-data: 'Space Mono', 'Courier New', monospace;

  /* --- Type scale --- */
  --text-xs: 0.70rem;    /* 11.2px — labels, badges */
  --text-sm: 0.80rem;    /* 12.8px — captions, secondary */
  --text-base: 0.875rem; /* 14px — body text */
  --text-md: 1rem;       /* 16px — UI text */
  --text-lg: 1.125rem;   /* 18px — section titles */
  --text-xl: 1.375rem;   /* 22px — card headers */
  --text-2xl: 1.75rem;   /* 28px — KPI numbers */
  --text-3xl: 2.25rem;   /* 36px — page headers */

  /* --- Spacing scale (8px base) --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* --- Border radius --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-accent: 0 4px 24px var(--accent-glow);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.06);

  /* --- Blur values for glass effect --- */
  --blur-sm: blur(8px);
  --blur-md: blur(16px);
  --blur-lg: blur(32px);

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* --- Z-index layers --- */
  --z-base: 0;
  --z-above: 10;
  --z-nav: 100;
  --z-modal: 200;
  --z-toast: 300;
  --z-top: 400;

  /* --- Sidebar width --- */
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --bottomnav-h: 64px;
}

/* ------------------------------------------------------------
   CSS RESET
   Removes browser default margin/padding/box model quirks.
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-0);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  /* Subtle noise texture for depth */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Remove default list styles */
ul, ol { list-style: none; }

/* Remove default link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Make images responsive */
img, svg {
  display: block;
  max-width: 100%;
}

/* Remove default button styles */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Remove default input styles */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

/* ------------------------------------------------------------
   TYPOGRAPHY CLASSES
   Reusable text styles used across all modules.
   ------------------------------------------------------------ */

/* Heading styles */
.h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.h2 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.h3 { font-size: var(--text-lg); font-weight: 600; line-height: 1.35; }

/* Body text styles */
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-md    { font-size: var(--text-md); }
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* Numeric/data text — uses Space Mono */
.data, .mono {
  font-family: var(--font-data);
  letter-spacing: -0.02em;
}

/* Large KPI number on dashboard */
.kpi-number {
  font-family: var(--font-data);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

/* Truncate long text with ellipsis */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------
   UTILITY HELPERS
   ------------------------------------------------------------ */

/* Flex helpers */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

/* Spacing helpers */
.p-4  { padding: var(--sp-4); }
.p-6  { padding: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.mt-4 { margin-top: var(--sp-4); }

/* Visibility helpers */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Scrollable container */
.scroll-y {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}
.scroll-y::-webkit-scrollbar { width: 4px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

/* Divider line */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--sp-4) 0;
}
