/* ==========================================================================
   WCAG 2.1 AA Accessibility Styles
   EmpathySystem.ai

   Success Criteria Addressed:
   - 1.4.3 Contrast (Minimum) - Color adjustments
   - 1.4.11 Non-text Contrast - UI component contrast
   - 2.4.1 Bypass Blocks - Skip link
   - 2.4.7 Focus Visible - Focus indicators
   - 2.3.3 Animation from Interactions - Reduced motion
   - 2.5.5 Target Size - Touch targets

   Last Updated: 2026-01-19
   ========================================================================== */

/* --------------------------------------------------------------------------
   Screen Reader Only Class (WCAG 1.3.1)
   Visually hidden but accessible to screen readers
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Make skip links visible on focus (WCAG 2.4.1) */
.sr-only:focus,
.sr-only:focus-within,
.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* --------------------------------------------------------------------------
   Skip Link (WCAG 2.4.1)
   Visually hidden until focused, then appears at top of page
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #1f2937; /* gray-800 */
  color: #ffffff;
  padding: 8px 16px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 4px 0;
  transition: top 0.2s ease-in-out;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #f97316; /* monarch orange */
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Focus Indicators (WCAG 2.4.7)
   Visible focus ring with minimum 3:1 contrast ratio
   -------------------------------------------------------------------------- */

/* Default focus style for all interactive elements */
:focus-visible {
  outline: 3px solid #1d4ed8; /* blue-700 - 4.5:1 on white */
  outline-offset: 2px;
  border-radius: 2px;
}

/* Remove default outline, use our custom one */
:focus:not(:focus-visible) {
  outline: none;
}

/* High contrast focus for dark backgrounds */
.dark :focus-visible,
.bg-gray-800 :focus-visible,
.bg-gray-900 :focus-visible {
  outline-color: #fbbf24; /* amber-400 */
}

/* Button focus states */
button:focus-visible,
[role="button"]:focus-visible,
.btn:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.2);
}

/* Link focus states */
a:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
  text-decoration: underline;
}

/* Form input focus states */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 0;
  border-color: #1d4ed8;
}

/* --------------------------------------------------------------------------
   Color Contrast Fixes (WCAG 1.4.3)
   Monarch orange (#f97316) needs darker variant for small text
   -------------------------------------------------------------------------- */

/* Original monarch orange has 3.0:1 on white - fails for small text */
/* Use darker variant for text requiring 4.5:1 */
.text-monarch-accessible {
  color: #c2410c; /* orange-700 - 4.6:1 on white */
}

/* For links that need to be distinguishable */
.link-accessible {
  color: #1d4ed8; /* blue-700 - 4.5:1 on white */
  text-decoration: underline;
}

.link-accessible:hover {
  color: #1e40af; /* blue-800 */
}

/* Error text (needs 4.5:1) */
.text-error-accessible {
  color: #b91c1c; /* red-700 - 4.6:1 on white */
}

/* Success text */
.text-success-accessible {
  color: #15803d; /* green-700 - 4.5:1 on white */
}

/* Warning text */
.text-warning-accessible {
  color: #a16207; /* yellow-700 - 4.5:1 on white */
}

/* --------------------------------------------------------------------------
   High Contrast Mode
   For users who prefer higher contrast
   -------------------------------------------------------------------------- */

.high-contrast {
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --border-color: #ffffff;
  --focus-ring: #ffff00;
}

.high-contrast body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

.high-contrast .bg-white,
.high-contrast .bg-gray-50,
.high-contrast .bg-gray-100,
.high-contrast .bg-orange-50 {
  background-color: var(--bg-secondary) !important;
}

.high-contrast .text-gray-400,
.high-contrast .text-gray-500,
.high-contrast .text-gray-600,
.high-contrast .text-gray-700,
.high-contrast .text-gray-800 {
  color: var(--text-secondary) !important;
}

.high-contrast .text-gray-900 {
  color: var(--text-primary) !important;
}

.high-contrast .border-gray-100,
.high-contrast .border-gray-200,
.high-contrast .border-gray-300 {
  border-color: var(--border-color) !important;
}

.high-contrast *:focus {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
}

/* Ensure links are visible in high contrast */
.high-contrast a {
  color: #00ffff !important;
  text-decoration: underline !important;
}

.high-contrast a:hover {
  color: #ffff00 !important;
}

/* Buttons remain visible in high contrast */
.high-contrast .bg-orange-600,
.high-contrast .bg-orange-500,
.high-contrast .bg-orange-700 {
  background-color: #ff6600 !important;
  border: 2px solid #ffffff !important;
}

.high-contrast .bg-orange-600:hover,
.high-contrast .bg-orange-500:hover {
  background-color: #ff9933 !important;
}

/* Form inputs in high contrast */
.high-contrast input,
.high-contrast textarea,
.high-contrast select {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.high-contrast input::placeholder,
.high-contrast textarea::placeholder {
  color: #888888 !important;
}

/* --------------------------------------------------------------------------
   High Contrast Media Query Support (WCAG 1.4.3)
   -------------------------------------------------------------------------- */

@media (prefers-contrast: high) {
  :focus-visible {
    outline-width: 4px;
  }

  .btn,
  button {
    border: 2px solid currentColor;
  }
}

@media (prefers-contrast: more) {
  body {
    background-color: #000000 !important;
    color: #ffffff !important;
  }

  a {
    color: #00ffff !important;
  }

  .bg-white,
  .bg-gray-50,
  .bg-gray-100 {
    background-color: #1a1a1a !important;
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion (WCAG 2.3.3)
   Respect user's motion preferences
   -------------------------------------------------------------------------- */

@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;
  }

  .skip-link {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Touch Target Size (WCAG 2.5.5)
   Minimum 44x44px for touch targets
   -------------------------------------------------------------------------- */

.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ensure clickable elements have adequate size on touch devices */
@media (pointer: coarse) {
  button,
  [role="button"],
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Links in navigation need adequate touch area */
  nav a,
  .nav-link {
    padding: 12px 16px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   ARIA Live Region Styles
   For dynamic content announcements (Seth chat, notifications)
   -------------------------------------------------------------------------- */

/* Live region container - no visual styling, for screen readers */
[aria-live="polite"],
[aria-live="assertive"] {
  /* These are for screen readers only */
}

/* Ensure live regions don't cause layout shifts */
.aria-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Form Accessibility Enhancements (WCAG 3.3.1, 3.3.2)
   -------------------------------------------------------------------------- */

/* Required field indicator */
.required-indicator {
  color: #b91c1c; /* red-700 - accessible */
  margin-left: 0.25rem;
}

/* Error state for form inputs */
input.error,
textarea.error,
select.error,
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: #b91c1c;
  background-color: #fef2f2;
}

input.error:focus-visible,
textarea.error:focus-visible,
select.error:focus-visible {
  outline-color: #b91c1c;
}

/* Disabled state styling */
input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Heading Hierarchy (WCAG 1.3.1)
   Consistent heading styles
   -------------------------------------------------------------------------- */

.heading-1 {
  font-size: 1.875rem; /* 30px */
  font-weight: 700;
  line-height: 1.2;
  color: #111827; /* gray-900 */
}

.heading-2 {
  font-size: 1.5rem; /* 24px */
  font-weight: 600;
  line-height: 1.3;
  color: #111827;
}

.heading-3 {
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
  line-height: 1.4;
  color: #1f2937; /* gray-800 */
}

.heading-4 {
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  line-height: 1.4;
  color: #1f2937;
}

/* --------------------------------------------------------------------------
   Text Resize Support (WCAG 1.4.4)
   Ensure text remains readable at 200% zoom
   -------------------------------------------------------------------------- */

/* Use relative units for text sizing */
html {
  font-size: 100%; /* 16px base, respects user preferences */
}

/* Ensure text containers can expand */
.text-container {
  max-width: 65ch; /* Optimal line length for readability */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   Reflow Support (WCAG 1.4.10)
   Content reflows at 320px width (400% zoom)
   -------------------------------------------------------------------------- */

@media (max-width: 320px) {
  body {
    min-width: 280px;
  }

  /* Ensure horizontal scroll only when necessary */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --------------------------------------------------------------------------
   Text Spacing Override Support (WCAG 1.4.12)
   Content must remain readable when users override spacing
   -------------------------------------------------------------------------- */

/* These properties should use relative units and allow override */
p, li, td, th, label {
  line-height: 1.5;
  letter-spacing: normal;
  word-spacing: normal;
}

/* Ensure containers can expand with increased spacing */
.expandable-container {
  overflow: visible;
  min-height: fit-content;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Butterfly Dynamic Shadow Effect
 *
 * Creates a dynamic drop-shadow that moves based on cursor position,
 * as if the cursor is a light source and the shadow falls away from it.
 */

:root {
  --butterfly-shadow-x: 4px;
  --butterfly-shadow-y: 4px;
  --butterfly-shadow-blur: 8px;
  --butterfly-shadow-opacity: 0.3;
}

.js-butterfly-shadow {
  filter: drop-shadow(
    var(--butterfly-shadow-x)
    var(--butterfly-shadow-y)
    var(--butterfly-shadow-blur)
    rgba(0, 0, 0, var(--butterfly-shadow-opacity))
  );
  transition: filter 0.15s ease-out;
  will-change: filter;
}

/* Subtle hover enhancement */
.js-butterfly-shadow:hover {
  --butterfly-shadow-blur: 12px;
  --butterfly-shadow-opacity: 0.4;
}

/* Disable animation on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .js-butterfly-shadow {
    transition: none;
    --butterfly-shadow-x: 4px;
    --butterfly-shadow-y: 4px;
  }
}

/* Touch device fallback - static shadow */
@media (pointer: coarse) {
  .js-butterfly-shadow {
    --butterfly-shadow-x: 4px;
    --butterfly-shadow-y: 4px;
    transition: none;
  }
}
/* ==========================================================================
   WCAG 2.1 AA Accessible Color Palette
   EmpathySystem.ai

   All colors verified for contrast compliance:
   - Text colors: 4.5:1 minimum on intended background
   - Large text: 3:1 minimum
   - UI components: 3:1 minimum

   WCAG Success Criteria Addressed:
   - 1.4.3 Contrast (Minimum) - Level AA
   - 1.4.11 Non-text Contrast - Level AA

   Last Updated: 2026-01-19
   ========================================================================== */

:root {
  /* ========================================================================
     MONARCH BRAND COLORS - Accessible Variants
     Original #f97316 has 2.8:1 on white (fails AA for all text sizes)
     ======================================================================== */

  /* For decorative elements and backgrounds only - NOT for text */
  --monarch-orange: #f97316;           /* 2.8:1 on white - DECORATIVE ONLY */
  --monarch-orange-hover: #ea580c;     /* 3.6:1 on white - large text OK */

  /* For small text - WCAG AA compliant */
  --monarch-orange-text: #c2410c;      /* 5.2:1 on white ✓ */
  --monarch-orange-text-dark: #9a3412; /* 7.3:1 on white ✓ AAA */

  /* For use on dark backgrounds */
  --monarch-orange-on-dark: #fb923c;   /* 7.8:1 on gray-900 ✓ */

  /* ========================================================================
     GRAY SCALE - All verified for text use
     ======================================================================== */

  /* Primary text - high contrast */
  --text-primary: #111827;             /* gray-900: 16.0:1 on white ✓ */
  --text-secondary: #374151;           /* gray-700: 9.5:1 on white ✓ */
  --text-tertiary: #4b5563;            /* gray-600: 6.5:1 on white ✓ */

  /* Minimum contrast text (use sparingly) */
  --text-muted: #6b7280;               /* gray-500: 4.6:1 on white ✓ */

  /* FAILS AA - Do not use for text */
  /* --text-light: #9ca3af;           gray-400: 3.0:1 on white ✗ */
  /* --text-lighter: #d1d5db;         gray-300: 1.9:1 on white ✗ */

  /* ========================================================================
     SEMANTIC COLORS - Accessible versions
     ======================================================================== */

  /* Error/Danger */
  --color-error: #b91c1c;              /* red-700: 4.6:1 on white ✓ */
  --color-error-text: #991b1b;         /* red-800: 5.9:1 on white ✓ */
  --color-error-bg: #fef2f2;           /* red-50 */
  --color-error-border: #f87171;       /* red-400 */

  /* Success */
  --color-success: #15803d;            /* green-700: 4.5:1 on white ✓ */
  --color-success-text: #166534;       /* green-800: 5.8:1 on white ✓ */
  --color-success-bg: #f0fdf4;         /* green-50 */
  --color-success-border: #4ade80;     /* green-400 */

  /* Warning */
  --color-warning: #a16207;            /* yellow-700: 4.5:1 on white ✓ */
  --color-warning-text: #854d0e;       /* yellow-800: 5.6:1 on white ✓ */
  --color-warning-bg: #fefce8;         /* yellow-50 */
  --color-warning-border: #facc15;     /* yellow-400 */

  /* Info */
  --color-info: #1d4ed8;               /* blue-700: 4.9:1 on white ✓ */
  --color-info-text: #1e40af;          /* blue-800: 6.3:1 on white ✓ */
  --color-info-bg: #eff6ff;            /* blue-50 */
  --color-info-border: #60a5fa;        /* blue-400 */

  /* ========================================================================
     LINK COLORS
     ======================================================================== */

  --link-color: #1d4ed8;               /* blue-700: 4.9:1 on white ✓ */
  --link-color-hover: #1e40af;         /* blue-800: 6.3:1 on white ✓ */
  --link-color-visited: #6d28d9;       /* violet-700: 5.0:1 on white ✓ */

  /* ========================================================================
     FOCUS INDICATOR
     ======================================================================== */

  --focus-ring-color: #1d4ed8;         /* blue-700 - visible on white */
  --focus-ring-color-dark: #fbbf24;    /* amber-400 - visible on dark */

  /* ========================================================================
     DISABLED STATES
     Note: Disabled elements are exempt from contrast requirements,
     but we still aim for reasonable visibility
     ======================================================================== */

  --disabled-text: #9ca3af;            /* gray-400 - intentionally lower */
  --disabled-bg: #f3f4f6;              /* gray-100 */
  --disabled-border: #d1d5db;          /* gray-300 */
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Text colors - guaranteed AA compliant */
.text-accessible-primary { color: var(--text-primary); }
.text-accessible-secondary { color: var(--text-secondary); }
.text-accessible-tertiary { color: var(--text-tertiary); }
.text-accessible-muted { color: var(--text-muted); }

/* Monarch brand - use correct variant */
.text-monarch { color: var(--monarch-orange-text); }  /* For small text */
.text-monarch-lg { color: var(--monarch-orange); }    /* For large text only */

/* Semantic text colors */
.text-accessible-error { color: var(--color-error-text); }
.text-accessible-success { color: var(--color-success-text); }
.text-accessible-warning { color: var(--color-warning-text); }
.text-accessible-info { color: var(--color-info-text); }

/* Link styling */
.link-accessible {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-accessible:hover {
  color: var(--link-color-hover);
}

.link-accessible:visited {
  color: var(--link-color-visited);
}

/* ==========================================================================
   COMPONENT OVERRIDES
   Fix specific components that use non-compliant colors
   ========================================================================== */

/* Buttons - ensure text contrast */
.btn-primary {
  background-color: var(--monarch-orange);
  color: white;  /* 3.0:1 - acceptable for large button text */
}

.btn-primary:hover {
  background-color: var(--monarch-orange-hover);
}

/* For smaller button text, use darker variant */
.btn-primary-sm {
  background-color: var(--monarch-orange-text);
  color: white;  /* 4.6:1 ✓ */
}

/* Links in body text */
article a,
.prose a,
main p a {
  color: var(--link-color);
  text-decoration: underline;
}

/* Placeholder text - intentionally lower contrast (exempt from WCAG) */
/* But we'll make it more visible than browser default */
::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* Form labels - must be clearly readable */
label,
.form-label {
  color: var(--text-secondary);
}

/* Help text / descriptions */
.help-text,
.form-hint,
.text-sm.text-gray-500 {
  color: var(--text-muted);  /* 4.6:1 minimum */
}

/* Table headers */
th {
  color: var(--text-primary);
}

/* Badge/tag text */
.badge {
  font-weight: 500;  /* Helps readability at smaller sizes */
}

/* ==========================================================================
   ALERT/NOTIFICATION COMPONENTS
   Accessible semantic color combinations
   ========================================================================== */

.alert-error {
  background-color: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error-text);
}

.alert-success {
  background-color: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

.alert-warning {
  background-color: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

.alert-info {
  background-color: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info-text);
}

/* ==========================================================================
   DARK MODE OVERRIDES (if applicable)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #f9fafb;           /* gray-50 */
    --text-secondary: #e5e7eb;         /* gray-200 */
    --text-tertiary: #d1d5db;          /* gray-300 */
    --text-muted: #9ca3af;             /* gray-400 */

    --monarch-orange-text: #fb923c;    /* orange-400 for dark bg */

    --link-color: #60a5fa;             /* blue-400 */
    --link-color-hover: #93c5fd;       /* blue-300 */
  }
}

/* ==========================================================================
   COLOR CONTRAST QUICK REFERENCE
   (Calculated using WCAG 2.1 relative luminance formula)

   ON WHITE BACKGROUND (#ffffff):
   ┌─────────────────────────────────────────────────────────────────────────┐
   │ Color             │ Hex     │ Ratio │ Normal │ Large │ UI Components   │
   ├───────────────────┼─────────┼───────┼────────┼───────┼─────────────────┤
   │ Gray-900          │ #111827 │ 17.7  │ ✓ AAA  │ ✓ AAA │ ✓              │
   │ Gray-800          │ #1f2937 │ 14.7  │ ✓ AAA  │ ✓ AAA │ ✓              │
   │ Gray-700          │ #374151 │ 10.3  │ ✓ AAA  │ ✓ AAA │ ✓              │
   │ Gray-600          │ #4b5563 │  7.6  │ ✓ AAA  │ ✓ AAA │ ✓              │
   │ Gray-500          │ #6b7280 │  4.8  │ ✓ AA   │ ✓ AAA │ ✓              │
   │ Gray-400          │ #9ca3af │  2.5  │ ✗      │ ✗     │ ✗ AVOID        │
   │ Gray-300          │ #d1d5db │  1.6  │ ✗      │ ✗     │ ✗ AVOID        │
   ├───────────────────┼─────────┼───────┼────────┼───────┼─────────────────┤
   │ Orange-500        │ #f97316 │  2.8  │ ✗      │ ✗     │ ✗ AVOID        │
   │ Orange-600        │ #ea580c │  3.6  │ ✗      │ ✓ AA  │ ✓              │
   │ Orange-700        │ #c2410c │  5.2  │ ✓ AA   │ ✓ AAA │ ✓ (text)       │
   │ Orange-800        │ #9a3412 │  7.3  │ ✓ AAA  │ ✓ AAA │ ✓              │
   ├───────────────────┼─────────┼───────┼────────┼───────┼─────────────────┤
   │ Blue-700          │ #1d4ed8 │  6.7  │ ✓ AA   │ ✓ AAA │ ✓ (links)      │
   │ Red-700           │ #b91c1c │  6.5  │ ✓ AA   │ ✓ AAA │ ✓ (error)      │
   │ Green-700         │ #15803d │  5.0  │ ✓ AA   │ ✓ AAA │ ✓ (success)    │
   │ Yellow-700        │ #a16207 │  4.9  │ ✓ AA   │ ✓ AAA │ ✓ (warning)    │
   │ Violet-700        │ #6d28d9 │  7.1  │ ✓ AAA  │ ✓ AAA │ ✓ (visited)    │
   └─────────────────────────────────────────────────────────────────────────┘

   WCAG Requirements:
   - Normal text (<18pt or <14pt bold): 4.5:1 minimum (AA), 7.0:1 (AAA)
   - Large text (≥18pt or ≥14pt bold): 3.0:1 minimum (AA), 4.5:1 (AAA)
   - UI Components/Graphical Objects: 3.0:1 minimum
   ========================================================================== */
.monarch-foil {
  position: relative;
  display: inline-block;
  perspective: 1000px;
  transform-style: preserve-3d;
  --foil-x: 50%;
  --foil-y: 50%;
  --foil-rotate-x: 0deg;
  --foil-rotate-y: 0deg;
  --foil-opacity: 0;
  --foil-glare-opacity: 0;
}

.monarch-foil__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(var(--foil-rotate-x)) rotateY(var(--foil-rotate-y)) translateZ(0);
  transition: transform 0.3s ease;
  will-change: transform;
}

.monarch-foil.is-hovered .monarch-foil__inner {
  transform: rotateX(var(--foil-rotate-x)) rotateY(var(--foil-rotate-y)) translateZ(10px) scale(1.20);
}

.monarch-foil__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.monarch-foil__foil,
.monarch-foil__glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mask-image: var(--monarch-foil-image);
  -webkit-mask-image: var(--monarch-foil-image);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
  mask-size: contain;
  -webkit-mask-size: contain;
  border-radius: 4px;
}

.monarch-foil__foil {
  background-image:
    linear-gradient(
      135deg,
      hsl(192, 97%, 60%) 0%,
      hsl(281, 62%, 58%) 25%,
      hsl(54, 87%, 63%) 50%,
      hsl(9, 81%, 59%) 75%,
      hsl(192, 97%, 60%) 100%
    ),
    radial-gradient(
      farthest-corner circle at var(--foil-x) var(--foil-y),
      hsla(180, 100%, 89%, 0.5) 5%,
      hsla(180, 14%, 57%, 0.3) 40%,
      hsl(0, 0%, 0%) 130%
    );
  background-size: 400% 400%;
  background-position: var(--foil-x) var(--foil-y);
  background-blend-mode: normal;
  filter: brightness(1) contrast(1) saturate(.8);
  mix-blend-mode: color-dodge;
  opacity: var(--foil-opacity);
  transition: opacity 0.3s ease;
}

.monarch-foil__glare {
  background:
    radial-gradient(
      farthest-corner circle at var(--foil-x) var(--foil-y),
      hsla(204, 100%, 95%, 0.8) 5%,
      hsla(250, 15%, 20%, 1) 150%
    );
  filter: brightness(.75) contrast(2) saturate(2);
  mix-blend-mode: overlay;
  opacity: var(--foil-glare-opacity);
  transition: opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .monarch-foil__inner {
    transition: none;
  }

  .monarch-foil__foil,
  .monarch-foil__glare {
    transition: none;
  }
}

@media (pointer: coarse) {
  .monarch-foil__inner {
    transition: none;
  }
}
/*
 * EmpathySystem.ai - MPT.social Layout Styles
 * Copyright (c) 2025 EmpathySystem Inc. All rights reserved.
 *
 * Extracted from mpt_social.html.erb for CSP nonce compatibility (UI-005)
 */

/* ===========================================
   BASE STYLES
   =========================================== */
* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  background: #faf8f5;
  color: #333;
  margin: 0;
  padding: 0;
}

a { color: #d97706; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===========================================
   HEADER - Monarch-inspired
   =========================================== */
.mpt-header {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  padding: 12px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mpt-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mpt-logo {
  color: white;
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mpt-logo-butterfly {
  font-size: 28px;
}

.mpt-nav { display: flex; gap: 20px; align-items: center; }

.mpt-nav a {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.2s;
}

.mpt-nav a:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
}

.mpt-nav a.active {
  background: rgba(255,255,255,0.25);
}

.mpt-coins {
  background: rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===========================================
   SEARCH BAR
   =========================================== */
.mpt-search {
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  width: 250px;
  font-size: 13px;
}

.mpt-search::placeholder { color: #999; }

/* ===========================================
   MAIN CONTAINER - 3 Column Layout
   =========================================== */
.mpt-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Left column - Navigation */
.mpt-left {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* Center column - Feed */
.mpt-center {
  flex: 1;
  min-width: 0;
}

/* Right column - Resources */
.mpt-right {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* ===========================================
   NAVIGATION CARDS
   =========================================== */
.mpt-nav-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.mpt-nav-card a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #444;
  border-bottom: 1px solid #f0ebe3;
  transition: background 0.2s;
}

.mpt-nav-card a:last-child { border-bottom: none; }

.mpt-nav-card a:hover {
  background: #fff9f0;
  text-decoration: none;
}

.mpt-nav-card a.active {
  background: #fff3e0;
  color: #d97706;
  font-weight: 600;
}

.mpt-nav-icon { font-size: 18px; }

/* ===========================================
   CARDS
   =========================================== */
.mpt-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  overflow: hidden;
}

.mpt-card-header {
  padding: 14px 16px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #f0ebe3;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mpt-card-header a {
  font-size: 12px;
  font-weight: normal;
  color: #d97706;
}

.mpt-card-content {
  padding: 16px;
}

/* ===========================================
   STORY CARDS
   =========================================== */
.mpt-story-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  padding: 16px;
}

.mpt-story-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mpt-story-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fed7aa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.mpt-story-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.mpt-story-meta {
  flex: 1;
}

.mpt-story-author {
  font-weight: 600;
  color: #333;
}

.mpt-story-time {
  font-size: 12px;
  color: #888;
}

.mpt-story-content {
  color: #444;
  line-height: 1.6;
  margin-bottom: 12px;
}

.mpt-story-reactions {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0ebe3;
}

.mpt-reaction {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.2s;
}

.mpt-reaction:hover {
  background: #fff3e0;
  color: #d97706;
}

/* ===========================================
   SETH PROMPT CARD
   =========================================== */
.mpt-seth-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #fcd34d;
}

.mpt-seth-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.mpt-seth-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.mpt-seth-label {
  font-weight: 600;
  color: #92400e;
}

.mpt-seth-prompt {
  color: #78350f;
  line-height: 1.6;
  margin-bottom: 12px;
}

.mpt-seth-button {
  background: #d97706;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
}

.mpt-seth-button:hover {
  background: #b45309;
  text-decoration: none;
  color: white;
}

/* ===========================================
   RESOURCE TILES
   =========================================== */
.mpt-resource {
  padding: 14px;
  border-bottom: 1px solid #f0ebe3;
}

.mpt-resource:last-child { border-bottom: none; }

.mpt-resource-category {
  font-size: 10px;
  text-transform: uppercase;
  color: #d97706;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.mpt-resource-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.mpt-resource-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

/* ===========================================
   COIN DISPLAY
   =========================================== */
.mpt-coin-display {
  text-align: center;
  padding: 20px;
}

.mpt-coin-amount {
  font-size: 36px;
  font-weight: 700;
  color: #d97706;
}

.mpt-coin-label {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

.mpt-coin-philosophy {
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0ebe3;
}

/* ===========================================
   PROGRESS BAR
   =========================================== */
.mpt-progress {
  height: 8px;
  background: #f0ebe3;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.mpt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #fbbf24);
  border-radius: 4px;
  transition: width 0.3s;
}

/* ===========================================
   BUTTONS
   =========================================== */
.mpt-button {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  transition: all 0.2s;
}

.mpt-button:hover {
  opacity: 0.9;
  text-decoration: none;
  color: white;
}

.mpt-button-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #fed7aa;
}

.mpt-button-secondary:hover {
  background: #e0e0e0;
  color: #333;
}

/* ===========================================
   FLASH MESSAGES
   =========================================== */
.mpt-flash {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 14px;
}

.mpt-flash-notice { background: #fef3c7; color: #92400e; }
.mpt-flash-alert { background: #fee2e2; color: #991b1b; }

/* ===========================================
   PROFILE SECTION
   =========================================== */
.mpt-profile-card {
  text-align: center;
  padding: 20px;
}

.mpt-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  overflow: hidden;
  background: #fed7aa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #d97706;
}

.mpt-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mpt-profile-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.mpt-profile-since {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */
@media (max-width: 900px) {
  .mpt-container { flex-direction: column; }
  .mpt-left, .mpt-right { width: 100%; }
  .mpt-left { order: 2; }
  .mpt-center { order: 1; }
  .mpt-right { order: 3; }
}

/* ===========================================
   CONSENT PAGE STYLES
   =========================================== */
.mpt-page-header {
  margin-bottom: 24px;
}

.mpt-page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px 0;
}

.mpt-page-subtitle {
  color: #666;
  font-size: 14px;
  margin: 0;
}

.mpt-consent-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.mpt-consent-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

.mpt-consent-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #f0ebe3;
}

.mpt-consent-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fef3e7;
  border-radius: 10px;
}

.mpt-consent-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
}

.mpt-consent-description {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #666;
}

.mpt-consent-body {
  padding: 16px;
}

.mpt-consent-current {
  margin-bottom: 16px;
}

.mpt-consent-level-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.mpt-level-private {
  background: #e8f5e9;
  color: #2e7d32;
}

.mpt-level-case-manager {
  background: #e3f2fd;
  color: #1565c0;
}

.mpt-level-nonprofits {
  background: #fff3e0;
  color: #e65100;
}

.mpt-level-network {
  background: #fce4ec;
  color: #c2185b;
}

.mpt-consent-level-description {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #666;
}

.mpt-consent-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mpt-consent-option {
  display: flex;
  align-items: center;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.mpt-consent-option:hover {
  border-color: #f97316;
  background: #fffaf5;
}

.mpt-consent-option.selected {
  border-color: #f97316;
  background: #fef3e7;
}

.mpt-consent-radio {
  margin-right: 12px;
  accent-color: #f97316;
}

.mpt-consent-option-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
}

.mpt-consent-option-label {
  font-size: 14px;
  color: #333;
}

.mpt-consent-option-icon {
  font-size: 16px;
}

.mpt-consent-footer {
  padding: 12px 16px;
  background: #faf8f5;
  border-top: 1px solid #f0ebe3;
}

.mpt-consent-updated {
  font-size: 12px;
  color: #888;
}

/* ===========================================
   HISTORY ITEMS
   =========================================== */
.mpt-history-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0ebe3;
}

.mpt-history-item:last-child {
  border-bottom: none;
}

.mpt-history-icon {
  font-size: 20px;
}

.mpt-history-content {
  flex: 1;
}

.mpt-history-title {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.mpt-history-description {
  color: #666;
  font-size: 13px;
  margin-top: 2px;
}

.mpt-history-time {
  color: #888;
  font-size: 12px;
  margin-top: 4px;
}
.spacetime-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #f7f7f5;
}

.spacetime-grid__canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
