/* GaadiDiary 2.0 — Design Tokens & Typography Foundation */
/* Single Source of Truth matching DESIGN.md */

:root {
  /* ==========================================================================
     Core Palette (DESIGN.md Section 2.1)
     ========================================================================== */
  --color-primary: #003399;           /* HSRP India Blue — Main brand accent, primary CTA */
  --color-primary-hover: #002266;     /* Pressed and hover state for primary elements */
  --color-canvas: #F8F9FA;            /* Canvas / App body background (neutral, glare-free) */
  --color-surface: #FFFFFF;           /* Card and surface background */
  --color-surface-subtle: #F1F3F5;    /* Muted table headers, search inputs, subtle areas */
  --color-text-primary: #12151A;      /* Deep Carbon ink — Headings, metrics, primary data */
  --color-text-secondary: #4A5260;    /* Graphite slate — Form labels, subheaders */
  --color-text-muted: #5E6778;        /* Muted utility text, timestamps, table column heads */
  --color-border: #E2E4E9;            /* Hairline dividers, card boundaries, separators */
  --color-border-focus: #003399;      /* High-contrast keyboard and input focus boundary */

  /* ==========================================================================
     Semantic Operational Signals (DESIGN.md Section 2.2)
     ========================================================================== */
  /* Success / Paid */
  --color-success: #059669;
  --color-success-bg: #ECFDF5;
  --color-success-border: #A7F3D0;
  --color-success-text: #047857;      /* Emerald 700: 5.21:1 contrast on tint BG */

  /* Warning / Due */
  --color-warning: #D97706;
  --color-warning-bg: #FFFBEB;
  --color-warning-border: #FDE68A;
  --color-warning-text: #92400E;      /* Amber 800: 6.84:1 contrast on tint BG */

  /* Danger / Alert */
  --color-danger: #DC2626;
  --color-danger-bg: #FEF2F2;
  --color-danger-border: #FECACA;
  --color-danger-text: #B91C1C;       /* Crimson 700: 5.91:1 contrast on tint BG */

  /* Info / Scheduled */
  --color-info: #0284C7;
  --color-info-bg: #F0F9FF;
  --color-info-border: #BAE6FD;
  --color-info-text: #0369A1;         /* Sky 700: 5.57:1 contrast on tint BG */

  /* ==========================================================================
     Typography Stacks & Scale (DESIGN.md Section 3)
     ========================================================================== */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Menlo, Monaco, Consolas, monospace;
}

/* Tabular Numerals Enforcement */
.font-mono, [data-tabular], .tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Semantic Badges with Verified WCAG AA Contrast Ratios */
.badge-success {
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-text);
}

.badge-warning {
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning-text);
}

.badge-danger {
  background-color: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger-text);
}

.badge-info {
  background-color: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  color: var(--color-info-text);
}

/* Visual HSRP Number Plate Component (DESIGN.md Section 5.3) */
.hsrp-plate {
  display: inline-flex;
  align-items: center;
  background-color: #FFFFFF;
  border: 1px solid #12151A;
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--font-mono);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hsrp-badge {
  background-color: var(--color-primary);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  letter-spacing: 0.05em;
}

.hsrp-text {
  padding: 2px 7px;
  color: var(--color-text-primary);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
}

/* ==========================================================================
   Application Shell Navigation Styles (DESIGN.md Section 5.7)
   ========================================================================== */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-left: 3px solid transparent;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
  text-decoration: none;
}

.nav-link:hover {
  background-color: var(--color-canvas);
  color: var(--color-text-primary);
}

.nav-link.active,
.nav-active {
  background-color: rgba(0, 51, 153, 0.08);
  border-left: 3px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
}

.nav-link.active i,
.nav-active i {
  color: var(--color-primary);
}

/* ==========================================================================
   Safe-Area Bottom Dock & Content Clearance (DESIGN.md Section 4.2 & 5.7)
   ========================================================================== */
.mobile-bottom-dock {
  min-height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-content-clearance {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

/* ==========================================================================
   Accessibility & Keyboard Focus Rings (DESIGN.md Section 8)
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* Maintain clean mouse click experience while guaranteeing keyboard accessibility */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* Reduced motion preference support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
