/* Felinius Legal Pages - Stylesheet */
/* Modern, clean, mobile-first design */

:root {
  /* Brand Colors */
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;

  /* Neutrals */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --background: #ffffff;
  --background-alt: #f9fafb;
  --border-color: #e5e7eb;

  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Sizing */
  --max-width: 800px;
  --border-radius: 8px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --background: #111827;
    --background-alt: #1f2937;
    --border-color: #374151;
  }
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
}

@media (min-width: 640px) {
  .container {
    padding: var(--spacing-2xl) var(--spacing-xl);
  }
}

/* Header */
.header {
  text-align: center;
  padding-bottom: var(--spacing-xl);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--spacing-xl);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

@media (min-width: 640px) {
  .page-title {
    font-size: 2.5rem;
  }
}

.meta-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
  margin-top: var(--spacing-2xl);
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: 1.5rem;
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--primary-light);
}

h3 {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

h4 {
  font-size: 1.125rem;
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
}

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

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

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

/* Lists */
ul, ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-xl);
  color: var(--text-secondary);
}

li {
  margin-bottom: var(--spacing-sm);
}

li::marker {
  color: var(--primary-color);
}

/* Nested lists */
li > ul, li > ol {
  margin-top: var(--spacing-sm);
  margin-bottom: 0;
}

/* Definition-style lists (bold + description) */
li strong:first-child {
  color: var(--text-primary);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: var(--spacing-lg) 0;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

thead {
  background-color: var(--background-alt);
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  padding: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

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

tbody tr:hover {
  background-color: var(--background-alt);
}

/* Info boxes */
.info-box {
  background-color: var(--background-alt);
  border-left: 4px solid var(--primary-color);
  padding: var(--spacing-md) var(--spacing-lg);
  margin: var(--spacing-lg) 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.info-box.note {
  border-left-color: var(--accent-blue);
}

.info-box.warning {
  border-left-color: var(--accent-amber);
}

.info-box.success {
  border-left-color: var(--accent-green);
}

.info-box p:last-child {
  margin-bottom: 0;
}

/* Section dividers */
hr {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: var(--spacing-2xl) 0;
}

/* Contact section */
.contact-info {
  background-color: var(--background-alt);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  margin: var(--spacing-lg) 0;
}

.contact-item {
  margin-bottom: var(--spacing-sm);
}

.contact-item:last-child {
  margin-bottom: 0;
}

/* Summary table */
.summary-table {
  margin-top: var(--spacing-lg);
}

.summary-table th:first-child,
.summary-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* Footer */
.footer {
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 44px;
  height: 44px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

/* Table of contents */
.toc {
  background-color: var(--background-alt);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  margin: var(--spacing-xl) 0;
}

.toc-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.toc-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
  display: grid;
  gap: var(--spacing-xs);
}

@media (min-width: 640px) {
  .toc-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.toc-list li {
  margin-bottom: 0;
}

.toc-list a {
  display: block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.toc-list a:hover {
  background-color: var(--background);
  color: var(--primary-color);
  text-decoration: none;
}

/* Print styles */
@media print {
  .back-to-top,
  .toc {
    display: none;
  }

  body {
    font-size: 12pt;
    color: black;
    background: white;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  h2 {
    page-break-after: avoid;
  }

  table {
    page-break-inside: avoid;
  }
}

/* Accessibility */
@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;
  }
}

/* Focus styles */
a:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Version badge */
.version-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--primary-light);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

/* ------------------------------------------------------------------ */
/* Beta testing guide                                                  */
/* Additive only - used by testing.html. Nothing above is modified.    */
/* ------------------------------------------------------------------ */

/* Install tracks (Android / iPhone) */
.install-track {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
}

.install-track > h3 {
  margin-top: 0;
}

.install-track > ol:last-child,
.install-track > ul:last-child {
  margin-bottom: 0;
}

/* Mission card */
.mission {
  background-color: var(--background-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
}

.mission > h4 {
  margin-top: 0;
}

.mission > ul {
  margin-bottom: 0;
  padding-left: var(--spacing-lg);
}

.mission-id {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  border: 1px solid var(--primary-light);
  border-radius: 9999px;
  padding: 0 var(--spacing-sm);
  margin-right: var(--spacing-sm);
  vertical-align: middle;
}

/* Trailing-margin trim for lists that end an info box or contact block */
.info-box > ul:last-child,
.info-box > ol:last-child,
.contact-item > ul:last-child {
  margin-bottom: 0;
}
