/* 
==================================================
  BCFSleuth Documentation - Stylesheet
  Matching BCFSleuth Application Design System
==================================================
*/

/* 
==================================================
  1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
  These match your app's variables exactly
==================================================
*/
:root {
  /* Primary Color Palette - Exact match to app */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --secondary-hover: #475569;
  --accent: #0ea5e9;

  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Neutral Gray Scale - Exact match */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Background & Text Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  /* Shadow System - Exact match */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Border Radius Scale */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Spacing Scale */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Typography - Exact match */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas,
    'Liberation Mono', Menlo, monospace;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
  }
}

/* 
==================================================
  2. RESET & BASE STYLES
  Foundation styles matching your app
==================================================
*/
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container System */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* 
==================================================
  3. HEADER & NAVIGATION
  Matching your app's beautiful header
==================================================
*/

header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: var(--space-2xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
    repeat;
  z-index: 1;
}

header .container {
  position: relative;
  z-index: 2;
}

header h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: rgba(255, 255, 255);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.025em;
}

.header p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 
==================================================
  4. BUTTON SYSTEM
  Exact match to your app's buttons
==================================================
*/
.btn-primary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.btn-primary:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.btn {
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 44px;
  border: 2px solid transparent;
}

.btn-primary {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--gray-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
  transform: translateY(-1px);
}

/* 
==================================================
  5. NAVIGATION BAR
  Sticky nav matching your app
==================================================
*/
.nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  padding: var(--space-lg) 0;
  justify-content: space-between;
}

.nav-container strong {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.125rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
  margin: 0;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s ease;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.nav-menu a:hover {
  color: var(--primary);
  background: var(--bg-tertiary);
}

/* 
==================================================
  6. MAIN CONTENT & CARDS
  Exact card system from your app
==================================================
*/
.main {
  background: var(--bg-primary);
  margin: var(--space-xl) 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.content {
  padding: var(--space-2xl);
  max-width: none;
}

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease-in-out;
}

.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

/* 
==================================================
  7. TYPOGRAPHY SYSTEM
  Matching your app's text styles
==================================================
*/
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  line-height: 1.4;
  font-weight: 600;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-xl);
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  color: var(--primary);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  line-height: 1.6;
}

ul,
ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

li {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* 
==================================================
  8. TABLE OF CONTENTS
  Custom design for easy navigation
==================================================
*/
.toc {
  background: var(--bg-tertiary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  margin: var(--space-xl) 0;
  border: 1px solid var(--gray-200);
}

.toc h3 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
}

.toc ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xs);
}

.toc li {
  margin-bottom: 0;
}

.toc a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.toc a:hover {
  background: var(--bg-primary);
  color: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
  transform: translateX(4px);
}

/* 
==================================================
  9. FEATURE BOXES & GRIDS
  Component system matching your app
==================================================
*/
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-xl) 0;
}

.feature-box {
  background: var(--bg-tertiary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--primary);
  transition: all 0.2s ease;
  will-change: transform;
}

.feature-box:hover {
  background: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-box h3 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
}

.feature-box h4 {
  margin-top: 0;
  color: var(--text-primary);
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

.feature-box ul {
  margin-bottom: 0;
  padding-left: var(--space-lg);
}

.feature-box li {
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.feature-box strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* 
==================================================
  10. STEP CONTAINERS
  For process steps and guides
==================================================
*/
.step-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--success);
  transition: all 0.2s ease;
}

.step-container:hover {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.step-container h4 {
  color: var(--success);
  margin-top: 0;
  margin-bottom: var(--space-sm);
  font-size: 1.125rem;
}

.step-container p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* 
==================================================
  11. ALERT SYSTEM
  Status notifications and important info
==================================================
*/
.alert {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin: var(--space-lg) 0;
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.alert-info {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: var(--primary);
  color: var(--text-primary);
}

.alert-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: var(--success);
  color: #065f46;
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: var(--warning);
  color: #92400e;
}

.alert strong {
  font-weight: 600;
}

.alert ul {
  margin: 0;
  padding-left: var(--space-lg);
}

.alert li {
  margin-bottom: var(--space-xs);
}

/* 
==================================================
  12. BADGES & STATUS INDICATORS
  Small status and info badges
==================================================
*/
.badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge.success {
  background: var(--success);
}

.badge.warning {
  background: var(--warning);
}

.badge.danger {
  background: var(--danger);
}

/* Highlight Effect */
.highlight {
  background: linear-gradient(120deg, #fef3c7 0%, #fef3c7 100%);
  background-repeat: no-repeat;
  background-size: 100% 40%;
  background-position: 0 88%;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}

/* 
==================================================
  13. CODE & TECHNICAL CONTENT
  Code blocks and technical formatting
==================================================
*/
code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-primary);
  border: 1px solid var(--gray-200);
}

pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  border: none;
}

/* 
==================================================
  14. FOOTER
  Bottom page footer matching your app
==================================================
*/
.footer {
  background: var(--gray-900);
  color: #cbd5e1;
  text-align: center;
  padding: var(--space-2xl) 0;
  margin-top: var(--space-2xl);
}

.footer p {
  margin-bottom: var(--space-sm);
  color: #cbd5e1;
  opacity: 1;
}

.footer strong {
  color: white;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: white;
  text-decoration: underline;
}

.footer * {
  color: #cbd5e1;
}

.footer strong {
  color: white !important;
}

/* 
==================================================
  15. RESPONSIVE DESIGN
  Mobile-friendly breakpoints matching your app
==================================================
*/

/* Large Screens */
@media (max-width: 1200px) {
  .container {
    max-width: 1000px;
  }
}

/* Medium Screens (Tablet) */
@media (max-width: 968px) {
  .feature-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .toc ul {
    grid-template-columns: 1fr;
  }
}

/* Small Screens (Mobile) */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }

  .header {
    padding: var(--space-xl) 0;
  }

  .header h1 {
    font-size: 2.5rem;
  }

  .header p {
    font-size: 1rem;
  }

  .content {
    padding: var(--space-xl);
  }

  .cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-md);
  }

  .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .nav-menu {
    display: none;
  }

  .nav-container {
    justify-content: center;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .feature-box {
    padding: var(--space-lg);
  }

  .alert {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* Extra Small Screens */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }

  .content {
    padding: var(--space-lg);
  }

  .header h1 {
    font-size: 2rem;
  }

  .header p {
    font-size: 0.875rem;
  }

  .toc {
    padding: var(--space-lg);
  }

  .feature-box {
    padding: var(--space-md);
  }

  .step-container {
    padding: var(--space-md);
  }

  .alert {
    padding: var(--space-md);
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }
}

/* 
==================================================
  16. ACCESSIBILITY & PERFORMANCE
  Ensuring good user experience for everyone
==================================================
*/

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

/* Focus Management */
*:focus {
  outline: none;
}

a:focus,
button:focus,
.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Skip Link for Screen Readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  top: 6px;
}

/* GPU Acceleration for Smooth Animations */
.btn,
.card,
.feature-box,
.step-container {
  will-change: transform;
  transform: translateZ(0);
}

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

/* 
==================================================
  17. PRINT STYLES
  Clean printing layout
==================================================
*/
@media print {
  .header,
  .footer,
  .nav,
  .toc {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.4;
  }

  .main {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
  }

  .content {
    padding: 0 !important;
  }

  .feature-box,
  .step-container,
  .alert {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
  }
}

/* 
==================================================
  18. HIGH CONTRAST MODE SUPPORT
  Better accessibility for users who need it
==================================================
*/
@media (prefers-contrast: high) {
  :root {
    --primary: #0000ff;
    --primary-hover: #000080;
    --danger: #ff0000;
    --success: #008000;
    --warning: #ff8000;
    --text-primary: #000000;
    --text-secondary: #333333;
    --bg-primary: #ffffff;
    --bg-secondary: #f0f0f0;
    --gray-200: #cccccc;
    --gray-300: #aaaaaa;
  }

  .btn,
  .feature-box,
  .step-container,
  .alert {
    border: 2px solid currentColor !important;
  }
}

/* 
==================================================
  19. COORDINATE DATA STYLING
  Special styling for coordinate-related content
==================================================
*/

/* Coordinate field highlighting */
.coordinate-field {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* Coordinate precision indicator */
.precision-indicator {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
  margin-left: var(--space-xs);
}

/* Viewpoint row styling reference */
.viewpoint-example {
  background: linear-gradient(135deg, #fef7f0 0%, #fed7aa 100%);
  border-left: 3px solid var(--success);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  margin: var(--space-sm) 0;
}

/* Coordinate count badge */
.coordinate-count {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: var(--space-xs);
  display: inline-block;
}

/* Camera type indicators */
.camera-type-perspective {
  color: var(--primary);
  font-weight: 600;
}

.camera-type-orthogonal {
  color: var(--success);
  font-weight: 600;
}

/* Coordinate table styling */
.coordinate-table {
  background: var(--bg-tertiary);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-md) 0;
}

.coordinate-table th {
  background: var(--primary);
  color: white;
  padding: var(--space-sm);
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
}

.coordinate-table td {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--gray-200);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.coordinate-table tr:last-child td {
  border-bottom: none;
}

.coordinate-table tr:nth-child(even) {
  background: var(--bg-primary);
}

/* Responsive coordinate styling */
@media (max-width: 768px) {
  .coordinate-table {
    font-size: 0.75rem;
  }

  .coordinate-field {
    padding: var(--space-xs);
    font-size: 0.75rem;
  }

  .coordinate-count {
    font-size: 0.625rem;
    padding: 1px 6px;
  }
}

/* 
==================================================
  END OF STYLESHEET
  Your docs now match your app's beautiful design!
==================================================
*/
