/*
 * ZAADOO Express Design Tokens
 * Philosophy: Warm Modernism — Swiss precision + Scandinavian warmth
 * Version: 2.0
 * Updated: 2026-04-24
 *
 * Include in layouts before any other styles.
 */

/* ============================================
   COLOR TOKENS
   ============================================ */
:root {
  /* Primary — Deep forest green, trustworthy */
  --color-primary-50: #f0fdf4;
  --color-primary-100: #dcfce7;
  --color-primary-200: #bbf7d0;
  --color-primary-300: #86efac;
  --color-primary-400: #4ade80;
  --color-primary-500: #22c55e;
  --color-primary-600: #16a34a;
  --color-primary-700: #1B7A3D;
  --color-primary-800: #14522d;
  --color-primary-900: #0f3d1f;

  /* Accent — Warm amber, energetic but refined */
  --color-accent-50: #fffbeb;
  --color-accent-100: #fef3c7;
  --color-accent-200: #fde68a;
  --color-accent-300: #fcd34d;
  --color-accent-400: #fbbf24;
  --color-accent-500: #f59e0b;
  --color-accent-600: #d97706;
  --color-accent-700: #b45309;

  /* Warm neutrals — Creams and charcoals instead of pure white/black */
  --color-warm-50: #faf9f7;
  --color-warm-100: #f5f3ef;
  --color-warm-200: #e8e4dc;
  --color-warm-300: #d4cfc4;

  /* Background */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #faf9f7;
  --color-bg-tertiary: #f5f3ef;
  --color-bg-inverse: #1a1a1a;

  /* Text */
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #4a4a4a;
  --color-text-tertiary: #8a8a8a;
  --color-text-inverse: #faf9f7;
  --color-text-link: #1B7A3D;

  /* Border */
  --color-border-primary: #e8e4dc;
  --color-border-secondary: #d4cfc4;
  --color-border-focus: #1B7A3D;

  /* Surface overlays */
  --color-surface-overlay: rgba(26, 26, 26, 0.55);
  --color-surface-modal: #ffffff;

  /* Status */
  --color-status-success: #059669;
  --color-status-warning: #d97706;
  --color-status-error: #dc2626;
  --color-status-info: #2563eb;

  /* Shadows — Warm, layered, diffused */
  --shadow-sm: 0 1px 2px 0 rgba(26, 26, 26, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(26, 26, 26, 0.05), 0 2px 4px -2px rgba(26, 26, 26, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(26, 26, 26, 0.07), 0 4px 6px -4px rgba(26, 26, 26, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(26, 26, 26, 0.09), 0 8px 10px -6px rgba(26, 26, 26, 0.04);
  --shadow-focus: 0 0 0 3px rgba(27, 122, 61, 0.2);
  --shadow-card: 0 2px 8px rgba(26, 26, 26, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(26, 26, 26, 0.1);

  /* Admin sidebar */
  --color-sidebar-bg: #1a1a1a;
  --color-sidebar-hover: #2a2a2a;
  --color-sidebar-active: rgba(27, 122, 61, 0.2);
  --color-sidebar-text: #a0a0a0;
  --color-sidebar-text-active: #ffffff;
}

/* ============================================
   DARK MODE
   ============================================ */
.dark,
[data-theme="dark"] {
  --color-bg-primary: #121212;
  --color-bg-secondary: #1a1a1a;
  --color-bg-tertiary: #2a2a2a;
  --color-bg-inverse: #faf9f7;

  --color-text-primary: #f0f0f0;
  --color-text-secondary: #b0b0b0;
  --color-text-tertiary: #6a6a6a;
  --color-text-inverse: #1a1a1a;
  --color-text-link: #4ade80;

  --color-border-primary: #2a2a2a;
  --color-border-secondary: #3a3a3a;
  --color-border-focus: #4ade80;

  --color-surface-overlay: rgba(0, 0, 0, 0.7);
  --color-surface-modal: #1a1a1a;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
  --shadow-focus: 0 0 0 3px rgba(74, 222, 128, 0.25);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ============================================
   SPACING SCALE (8px base)
   ============================================ */
:root {
  --space-0: 0px;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 80px;
  --space-11: 96px;
  --space-12: 128px;
  --space-13: 160px;
  --space-14: 192px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
:root {
  --font-family-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-family-body: 'Nunito', 'Inter', system-ui, sans-serif;
  --font-family-mono: 'JetBrains Mono', ui-monospace, monospace;

  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-md: 1.125rem;   /* 18px */
  --font-size-lg: 1.25rem;    /* 20px */
  --font-size-xl: 1.5rem;     /* 24px */
  --font-size-2xl: 2rem;      /* 32px */
  --font-size-3xl: 2.5rem;    /* 40px */
  --font-size-4xl: 3.5rem;    /* 56px */
  --font-size-5xl: 4.5rem;    /* 72px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.15;
  --line-height-snug: 1.35;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;

  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.05em;
  --letter-spacing-wider: 0.1em;
}

/* ============================================
   LAYOUT
   ============================================ */
:root {
  --max-width-content: 65ch;
  --max-width-wide: 1200px;
  --max-width-page: 1400px;

  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 14px;
  --border-radius-xl: 20px;
  --border-radius-2xl: 28px;
  --border-radius-full: 9999px;
}

/* ============================================
   MOTION
   ============================================ */
:root {
  --duration-instant: 50ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-in: cubic-bezier(0.4, 0, 1, 1);
  --easing-out: cubic-bezier(0, 0, 0.2, 1);
  --easing-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .skip-link,
  nav[role="navigation"],
  .admin-sidebar,
  #toast-container,
  #confirm-modal,
  #page-loader,
  button[type="submit"],
  .no-print {
    display: none !important;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    opacity: 0.7;
  }

  a[href^="/"]::after,
  a[href^="#"]::after {
    content: "";
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   UTILITY CLASSES (Token-backed)
   ============================================ */

/* Focus ring utility */
.focus-ring:focus {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary-700);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-5);
  z-index: 100;
  transition: top var(--duration-fast) var(--easing-default);
}
.skip-link:focus {
  top: 0;
}

/* Touch target minimum */
.touch-target {
  min-height: 48px;
  min-width: 48px;
}

/* Hero section — robust dark mode colors */
.hero-bg {
  background-color: var(--color-bg-primary);
}
.hero-heading {
  color: var(--color-text-primary);
}
.hero-body {
  color: var(--color-text-secondary);
}

/* Card lift effect — subtle and refined */
.card-lift {
  transition: transform var(--duration-normal) var(--easing-default),
              box-shadow var(--duration-normal) var(--easing-default);
  box-shadow: var(--shadow-card);
}
.card-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-border-primary) 50%, var(--color-bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border-secondary);
  border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}
