/* App shell styles (psystat-app/public/index.html). A stylesheet file, not <style> blocks or
   injected text, so the CSP needs no 'unsafe-inline'. */

/* react-native-web style reset (what expo-router's ScrollViewStyleReset emits) */
#root, body, html { height: 100%; }
body { overflow: hidden; }
#root { display: flex; }

body { overflow: auto; background-color: #0F172A; }
#root { display: flex; flex: 1; }

/* Global web styles, formerly injected by injectWebFocusStyles() in constants/WebStyles.ts */
/* Focus ring for keyboard navigation — only shows on keyboard focus, not mouse click */
*:focus-visible {
  outline: 2px solid #818CF8 !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* Remove default outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none !important;
}

/* Smooth transitions on interactive elements */
[role="button"], [role="tab"], [role="link"], a, button, input, textarea, select {
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.15s ease;
}

/* Hover cursor on interactive elements */
[role="button"], [role="tab"], [role="link"] {
  cursor: pointer;
}

/* Disabled cursor */
[aria-disabled="true"], [disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

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

/* Selection color matching brand */
::selection {
  background-color: rgba(99, 102, 241, 0.3);
  color: inherit;
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

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

/* ── Print Styles ───────────────────────────────────────────────── */
@media print {
  /* Hide navigation, sidebars, FABs */
  nav, [data-sidebar], [role="tabbar"], [role="tablist"] {
    display: none !important;
  }

  /* Reset backgrounds to white for printing */
  body, #root, [data-theme] {
    background: white !important;
    color: black !important;
  }

  /* Cards should have borders instead of shadows */
  [data-card] {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }

  /* Ensure text is readable */
  * {
    color: black !important;
  }

  /* Show URLs for links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  /* Page breaks */
  h1, h2, h3 {
    break-after: avoid;
  }
  table, figure {
    break-inside: avoid;
  }

  /* Reasonable margins */
  @page {
    margin: 1.5cm;
  }
}
