/**
 * CSS Custom Properties (Design Tokens)
 * Light mode (default) and Dark mode
 */

 :root {
  /* ===== COLORS - LIGHT MODE ===== */

  /* Primary Colors */
  --color-dark-navy-100: #0E142B;
  --color-dark-navy-70: #575C6E;
  --color-dark-navy-50: #888C9B;

  /* Interactive */
  --color-cta-purple: #5063F9;
  --color-esentire-blue-100: #263C91;
  --color-esentire-blue-5: #F4F5F9;
  --color-light-purple-20: #E1E2F9;

  /* Shades */
  --color-white: #FFFFFF;
  --color-background: #FAFAFC;
  --color-border: #E9ECF4;

  /* Semantic Colors */
  --color-text-primary: var(--color-dark-navy-100);
  --color-text-secondary: var(--color-dark-navy-70);
  --color-text-tertiary: var(--color-dark-navy-50);
  --color-surface: var(--color-white);
  --color-surface-secondary: var(--color-esentire-blue-5);

  /* Annotations */
  --color-annotation-highlight: rgba(80, 99, 249, 0.2);
  --color-annotation-highlight-hover: rgba(80, 99, 249, 0.3);
  --color-annotation-highlight-active: rgba(80, 99, 249, 0.4);
  --color-update-highlight: rgba(255, 193, 7, 0.3);
  --color-update-badge: rgba(255, 193, 7, 1);

  /* Warning/Alert Boxes */
  --color-warning-bg: #C94747;
  --color-warning-text: #FFFFFF;
  --color-warning-border: #B03D3D;

  /* Note Boxes (sticky note style) */
  --color-note-bg: #FFF8DC;
  --color-note-text: #5C4B00;
  --color-note-border: #E6D89F;
  --color-note-title: #3D3200;

  /* ===== TYPOGRAPHY ===== */

  /* Font Families */
  --font-display: 'IBM Plex Sans', sans-serif;
  --font-body: 'IBM Plex Serif', sans-serif;

  /* Font Sizes */
  --font-size-display: 4rem;        /* 64px */
  --font-size-h1: 3.5rem;           /* 56px */
  --font-size-h2: 2.625rem;         /* 42px */
  --font-size-h3: 2rem;             /* 32px */
  --font-size-h4: 1.5rem;           /* 24px */
  --font-size-body-large: 1.125rem; /* 18px */
  --font-size-body: 1rem;           /* 16px */
  --font-size-small: 0.875rem;      /* 14px */
  --font-size-caption: 0.75rem;     /* 12px */

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  --line-height-loose: 1.75;

  /* ===== SPACING ===== */

  --spacing-xs: 0.25rem;    /* 4px */
  --spacing-sm: 0.5rem;     /* 8px */
  --spacing-md: 1rem;       /* 16px */
  --spacing-lg: 1.5rem;     /* 24px */
  --spacing-xl: 2rem;       /* 32px */
  --spacing-2xl: 3rem;      /* 48px */
  --spacing-3xl: 4rem;      /* 64px */

  /* ===== LAYOUT ===== */

  --nav-width: 408px;
  --content-max-width: 1200px;
  --annotation-width: 120px;
  --annotation-width-expanded: 400px;
  --mobile-header-height: 56px;
  --layout-gap: var(--spacing-lg);

  /* ===== BORDERS & RADIUS ===== */

  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 32px;
  --border-width: 1px;

  /* ===== SHADOWS ===== */

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* ===== TRANSITIONS ===== */

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ===== Z-INDEX SCALE ===== */

  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-popover: 1100;
  --z-tooltip: 1200;

  /* ===== BREAKPOINTS (for JS) ===== */

  --breakpoint-mobile: 768px;
  --breakpoint-tablet: 1440px;
}

/* ===== DARK MODE ===== */

[data-theme="dark"] {
  /* Text colors */
  --color-text-primary: #FFFFFF;
  --color-text-secondary: #A0A4B1; /* Dark Navy/40 */
  --color-text-tertiary: #A8B1D3; /* eSentire Blue/40 */

  /* Backgrounds */
  --color-background: #1B1C20; /* Dark Mode/90 */
  --color-surface: #212125; /* Dark Mode/80 */
  --color-surface-secondary: #36373B; /* Dark Mode/30 */

  /* Borders and dividers */
  --color-border: #25262A;

  /* Interactive - adjusted for dark mode */
  --color-cta-purple: #6273F9; /* CTA Purple (Dark Mode) */

  /* Dark mode specific colors */
  --color-dark-mode-5: #434347;
  --color-dark-mode-30: #36373B;
  --color-dark-mode-80: #212125;
  --color-dark-mode-90: #1B1C20;
  --color-dark-mode-divider: #2E2E32;

  /* Annotations - adjusted for dark mode */
  --color-annotation-highlight: rgba(98, 115, 249, 0.4);
  --color-annotation-highlight-hover: rgba(98, 115, 249, 0.5);
  --color-annotation-highlight-active: rgba(98, 115, 249, 0.6);
  --color-update-highlight: rgba(255, 193, 7, 0.2);

  /* Warning/Alert Boxes - adjusted for dark mode */
  --color-warning-bg: #D65555;
  --color-warning-text: #FFFFFF;
  --color-warning-border: #E86B6B;

  /* Note Boxes - adjusted for dark mode */
  --color-note-bg: #4A4420;
  --color-note-text: #F5E6B3;
  --color-note-border: #6B5F2E;
  --color-note-title: #FFE680;

  /* Shadows - darker for dark mode */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

/* ===== RESPONSIVE FONT SIZES (fluid typography) ===== */

@media (max-width: 767px) {
  :root {
    --font-size-display: clamp(2rem, 8vw, 4rem);
    --font-size-h1: clamp(1.75rem, 6vw, 2.5rem); /* Max 40px to match compact breakpoint */
    --font-size-h2: clamp(1.5rem, 5vw, 1.875rem); /* Max 30px to match compact breakpoint */
    --font-size-h3: clamp(1.25rem, 4vw, 1.5rem); /* Max 24px to match compact breakpoint */
    --font-size-h4: clamp(1.125rem, 3vw, 1.25rem); /* Max 20px to match compact breakpoint */
  }
}