/**
 * Ophraxx Documentation - Modern Styles
 */

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --bg-sidebar: #fafafa;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  --code-bg: #f1f5f9;
  --code-color: #475569;
  
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
  
  --nav-height: 64px;
  --sidebar-width: 280px;
  --toc-width: 240px;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-sidebar: #1a2332;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    --border-color: #334155;
    --border-light: #1e293b;
    
    --code-bg: #1e293b;
    --code-color: #e2e8f0;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== TOP NAVIGATION ===== */
.docs-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.docs-nav-container {
  height: 100%;
  max-width: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.docs-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;
}

.logo-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.docs-badge {
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.docs-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-width: 300px;
  transition: all 0.2s;
  cursor: pointer;
}

.search-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-container i {
  color: var(--text-tertiary);
  font-size: 14px;
}

.search-container input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.search-container kbd {
  padding: 2px 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.search-overlay.active {
  display: flex;
}

.search-results-container {
  width: 90%;
  max-width: 700px;
  max-height: 70vh;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-results-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.close-search {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-search:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.search-results {
  max-height: calc(70vh - 60px);
  overflow-y: auto;
  padding: 12px;
}

.search-result-item {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.search-result-item:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.search-result-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.search-result-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.search-result-highlight {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

.search-no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-discord:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
}

/* ===== DOCUMENTATION LAYOUT ===== */
.docs-layout {
  display: flex;
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

/* ===== SIDEBAR ===== */
.docs-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  height: calc(100vh - var(--nav-height));
  position: sticky;
  top: var(--nav-height);
  overflow-y: auto;
}

.sidebar-content {
  padding: 24px 0;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.sidebar-section-header:hover {
  background: var(--bg-secondary);
}

.sidebar-section-header i {
  font-size: 12px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.sidebar-section-header.collapsed i {
  transform: rotate(-90deg);
}

.sidebar-links {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-links.collapsed {
  max-height: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px 10px 48px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.sidebar-link i {
  font-size: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.sidebar-link:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

.sidebar-link:hover i {
  opacity: 1;
}

.sidebar-link.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--bg-secondary);
}

.sidebar-link.active i {
  opacity: 1;
}

/* ===== MAIN CONTENT ===== */
.docs-content {
  flex: 1;
  max-width: calc(100% - var(--sidebar-width) - var(--toc-width));
  padding: 48px 48px 96px;
  overflow-x: hidden;
}

.docs-container {
  max-width: 900px;
  margin: 0 auto;
}

.docs-page {
  display: none;
}

.docs-page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Typography */
h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-primary);
}

h2 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin: 48px 0 16px;
  color: var(--text-primary);
}

h3 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

h4 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  margin: 24px 0 8px;
  color: var(--text-primary);
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.lead {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

code {
  padding: 3px 6px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--code-color);
}

/* Lists */
ul, ol {
  margin: 16px 0;
  padding-left: 24px;
  color: var(--text-secondary);
}

li {
  margin: 8px 0;
  line-height: 1.7;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 12px 0;
}

.feature-list i {
  color: var(--primary);
  margin-top: 4px;
  font-size: 14px;
}

/* ===== COMPONENTS ===== */

/* Alerts */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin: 24px 0;
  display: flex;
  gap: 12px;
  border: 1px solid;
}

.alert i {
  flex-shrink: 0;
  font-size: 18px;
  margin-top: 2px;
}

.alert-info {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}

.alert-info i {
  color: var(--primary);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--text-primary);
}

.alert-warning i {
  color: #f59e0b;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
}

.feature-card i {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 12px;
}

.feature-card h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* Steps Timeline */
.steps-timeline {
  margin: 32px 0;
}

.step {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
}

.step-content p {
  margin-bottom: 12px;
}

.step-content ol {
  margin-top: 12px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Tables */
.table-container {
  margin: 24px 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
}

.docs-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.docs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 14px;
}

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

/* Page Navigation */
.page-navigation {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-btn:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.nav-btn.nav-prev {
  justify-content: flex-start;
}

.nav-btn.nav-next {
  justify-content: flex-end;
}

.nav-btn i {
  color: var(--primary);
  font-size: 16px;
}

.nav-btn div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-btn span {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-btn strong {
  color: var(--text-primary);
  font-size: 14px;
}

/* ===== TABLE OF CONTENTS ===== */
.docs-toc {
  width: var(--toc-width);
  padding: 48px 24px;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  border-left: 1px solid var(--border-color);
}

.toc-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-link {
  padding: 6px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  line-height: 1.4;
}

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

.toc-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .docs-toc {
    display: none;
  }
  
  .docs-content {
    max-width: calc(100% - var(--sidebar-width));
  }
}

@media (max-width: 768px) {
  .search-container {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .docs-sidebar {
    position: fixed;
    left: -100%;
    transition: left 0.3s;
    z-index: 99;
  }
  
  .docs-sidebar.active {
    left: 0;
  }
  
  .docs-content {
    max-width: 100%;
    padding: 24px 16px;
  }
  
  h1 {
    font-size: 32px;
  }
  
  h2 {
    font-size: 24px;
  }
  
  .page-navigation {
    flex-direction: column;
  }
  
  .search-overlay {
    padding-top: 50px;
  }
  
  .search-results-container {
    width: 95%;
  }
}