/* ============================================================
   base.css — Design Tokens, Typography, Global Resets
   Personal Expense Tracker
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --primary: #5B8DEF;
  --primary-light: #EBF2FF;
  --primary-dark: #3D6FD4;

  /* Accent Colors */
  --accent-purple: #9B72F5;
  --accent-purple-light: #F3EEFF;
  --accent-green: #34D399;
  --accent-green-light: #ECFDF5;
  --accent-coral: #FF6B6B;
  --accent-coral-light: #FFF1F1;
  --accent-amber: #FBBF24;
  --accent-amber-light: #FFFBEB;

  /* Neutral Palette */
  --white: #FFFFFF;
  --off-white: #F8FAFC;
  --bg-soft: #F0F4FF;
  --bg-page: #F5F7FF;
  --border-light: #E8EFFE;
  --border-muted: #D5DEFF;

  /* Text */
  --text-primary: #1A1D3B;
  --text-secondary: #5A6480;
  --text-muted: #9BA5BF;
  --text-light: #BCC5DB;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(91, 141, 239, 0.08);
  --shadow-sm: 0 2px 8px rgba(91, 141, 239, 0.12);
  --shadow-md: 0 4px 20px rgba(91, 141, 239, 0.15);
  --shadow-lg: 0 8px 40px rgba(91, 141, 239, 0.18);
  --shadow-xl: 0 16px 60px rgba(91, 141, 239, 0.22);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Fonts */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #5B8DEF 0%, #9B72F5 100%);
  --gradient-hero: linear-gradient(135deg, #EBF2FF 0%, #F3EEFF 50%, #ECFDF5 100%);
  --gradient-card-blue: linear-gradient(135deg, #5B8DEF 0%, #7CA8F7 100%);
  --gradient-card-purple: linear-gradient(135deg, #9B72F5 0%, #C084FC 100%);
  --gradient-card-green: linear-gradient(135deg, #34D399 0%, #6EE7B7 100%);
  --gradient-card-coral: linear-gradient(135deg, #FF6B6B 0%, #FF9B9B 100%);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.3;
}

.display-heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text-primary);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Utility Classes ───────────────────────────────────────── */
.text-primary-brand  { color: var(--primary) !important; }
.text-accent-purple  { color: var(--accent-purple) !important; }
.text-accent-green   { color: var(--accent-green) !important; }
.text-accent-coral   { color: var(--accent-coral) !important; }
.text-muted-soft     { color: var(--text-muted) !important; }
.text-secondary-soft { color: var(--text-secondary) !important; }

.bg-primary-soft     { background-color: var(--primary-light) !important; }
.bg-purple-soft      { background-color: var(--accent-purple-light) !important; }
.bg-green-soft       { background-color: var(--accent-green-light) !important; }
.bg-coral-soft       { background-color: var(--accent-coral-light) !important; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Custom Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: var(--border-muted);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ── Focus Styles ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Page Background Decoration ────────────────────────────── */
.page-bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.page-bg-decoration::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(91, 141, 239, 0.08) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  border-radius: 50%;
}

.page-bg-decoration::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(155, 114, 245, 0.07) 0%, transparent 70%);
  bottom: 100px;
  left: -100px;
  border-radius: 50%;
}

/* All sections have relative z-index to appear above decoration */
section, header, nav, footer {
  position: relative;
  z-index: 1;
}
