/* ============================================================================
   OpenMOA Documentation - Shared Styles
   ============================================================================ */

:root {
  /* Light Theme */
  --bg: #FAFBFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F3F4F6;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --accent: #0EA5E9;
  --accent-hover: #0284C7;
  --accent-light: #E0F2FE;
  --border: #E5E7EB;
  --code-bg: #1E293B;
  --code-text: #E2E8F0;
  --gradient: linear-gradient(135deg, #0EA5E9 0%, #6366F1 50%, #8B5CF6 100%);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --bg: #0F172A;
  --bg-secondary: #1E293B;
  --bg-tertiary: #334155;
  --text: #F1F5F9;
  --text-secondary: #94A3B8;
  --accent: #38BDF8;
  --accent-hover: #7DD3FC;
  --accent-light: #0C4A6E;
  --border: #334155;
  --code-bg: #020617;
  --code-text: #E2E8F0;
  --gradient: linear-gradient(135deg, #38BDF8 0%, #818CF8 50%, #A78BFA 100%);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

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

a:hover {
  color: var(--accent-hover);
}

/* ============================================================================
   Navigation
   ============================================================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #FFFFFF;
  font-family: 'JetBrains Mono', monospace;
}

.navbar-logo-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.5px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-link {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
}

.navbar-link:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.navbar-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-icon:hover {
  border-color: var(--accent);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu.open {
  display: flex;
}

@media (max-width: 768px) {
  .navbar-links,
  .navbar-actions {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
}

/* ============================================================================
   Layout
   ============================================================================ */

.page-wrapper {
  padding-top: 64px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
}

/* ============================================================================
   Typography
   ============================================================================ */

.page-title {
  font-size: clamp(32px, 6vw, 42px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  font-family: 'Space Grotesk', sans-serif;
}

.page-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 50px;
  max-width: 600px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  line-height: 1.3;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.75rem; margin-top: 2rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; margin-top: 1.5rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* ============================================================================
   Cards
   ============================================================================ */

.card {
  padding: 24px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

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

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--gradient);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  color: var(--text);
}

/* ============================================================================
   Code
   ============================================================================ */

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  background: var(--code-bg);
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  margin: 1rem 0;
}

pre code {
  background: none;
  padding: 0;
  color: var(--code-text);
  font-size: 14px;
  line-height: 1.7;
}

.code-block {
  background: var(--code-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.code-block-header {
  padding: 12px 20px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-block-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-block-dot.red { background: #FF5F56; }
.code-block-dot.yellow { background: #FFBD2E; }
.code-block-dot.green { background: #27CA40; }

.code-block-title {
  margin-left: 12px;
  color: #64748B;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

/* Syntax highlighting */
.token-keyword { color: #C792EA; }
.token-module { color: #82AAFF; }
.token-string { color: #C3E88D; }
.token-number { color: #F78C6C; }
.token-comment { color: #676E95; }
.token-function { color: #89DDFF; }

/* ============================================================================
   Sidebar (for docs)
   ============================================================================ */

.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding-top: 64px;
  min-height: 100vh;
}

.docs-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 32px 24px;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
}

.docs-sidebar-section {
  margin-bottom: 24px;
}

.docs-sidebar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.docs-sidebar-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.docs-sidebar-link:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.docs-sidebar-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.docs-content {
  padding: 32px 48px;
  max-width: 900px;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  
  .docs-sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
  padding: 48px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #FFFFFF;
}

.footer-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ============================================================================
   Utilities
   ============================================================================ */

.text-center { text-align: center; }
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* Tag colors */
.tag {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.tag-release { background: #DCFCE7; color: #166534; }
.tag-tutorial { background: #DBEAFE; color: #1E40AF; }
.tag-research { background: #F3E8FF; color: #7C3AED; }
.tag-guide { background: #FEF3C7; color: #B45309; }

[data-theme="dark"] .tag-release { background: #064E3B; color: #34D399; }
[data-theme="dark"] .tag-tutorial { background: #1E3A5F; color: #60A5FA; }
[data-theme="dark"] .tag-research { background: #4C1D95; color: #A78BFA; }
[data-theme="dark"] .tag-guide { background: #78350F; color: #FBBF24; }

/* ============================================================================
   Scrollbar
   ============================================================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #475569;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

/* ============================================================================
   Docs Content Lists
   ============================================================================ */

.docs-content ul {
  padding-left: 20px;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.docs-content li {
  margin-bottom: 4px;
}

/* ============================================================================
   Docs Navigation (prev/next)
   ============================================================================ */

.docs-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ============================================================================
   Info Box
   ============================================================================ */

.info-box {
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: 8px;
}

.info-box strong {
  color: var(--text);
}

.intro-box {
  background: var(--bg-tertiary);
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.7;
}

.intro-box strong {
  color: var(--text);
}

/* ============================================================================
   Installation Page - Prerequisites
   ============================================================================ */

.prereq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.prereq-card {
  padding: 20px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.prereq-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
}

.prereq-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.prereq-card li {
  margin-bottom: 4px;
}

/* ============================================================================
   Installation Page - Environment Table
   ============================================================================ */

.env-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.env-table th,
.env-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.env-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text);
}

.env-table td {
  color: var(--text-secondary);
}

.env-table code {
  font-size: 13px;
}

/* ============================================================================
   Installation Page - Troubleshooting
   ============================================================================ */

.troubleshoot-item {
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent);
  margin-bottom: 16px;
}

.troubleshoot-item strong {
  color: var(--text);
  display: block;
  margin-bottom: 8px;
}

.troubleshoot-item p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================================================
   Shared - Dependency / Item List Grid
   ============================================================================ */

.dep-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.dep-item {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.dep-item code {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.dep-item span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================================
   Concepts Page - Tables
   ============================================================================ */

.concept-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.concept-table th,
.concept-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.concept-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text);
}

.concept-table td {
  color: var(--text-secondary);
}

.concept-table code {
  font-size: 13px;
}

.wrapper-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.wrapper-table th,
.wrapper-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.wrapper-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

/* ============================================================================
   Concepts Page - Architecture / Protocol
   ============================================================================ */

.architecture-box {
  background: var(--code-bg);
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  margin: 24px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--code-text);
}

.protocol-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

.protocol-box pre {
  margin: 0;
  background: var(--code-bg);
  border-radius: 8px;
  padding: 16px;
}

/* ============================================================================
   Concepts Page - Detector Grid
   ============================================================================ */

.detector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.detector-item {
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.detector-item strong {
  display: block;
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 14px;
}

.detector-item span {
  font-size: 13px;
  color: var(--text-secondary);
}
