/* Datix xAgents Documentation Styles */

:root {
  --primary-color: #5D87FF;
  --secondary-color: #49BEFF;
  --text-primary: #2A3547;
  --text-secondary: #5A6A85;
  --background: #FFFFFF;
  --background-alt: #F6F9FC;
  --border-color: #E5EAF2;
  --sidebar-width: 280px;
  --header-height: 64px;
  --success: #13DEB9;
  --warning: #FFAE1F;
  --error: #FA896B;
  --code-bg: #F8F9FA;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] {
  --primary-color: #6C8EFF;
  --secondary-color: #5BC5FF;
  --text-primary: #E5E7EB;
  --text-secondary: #9CA3AF;
  --background: #1A1D29;
  --background-alt: #252834;
  --border-color: #2D3240;
  --code-bg: #2D3240;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--background);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--background);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.header-link:hover {
  color: var(--primary-color);
}

.search-box {
  position: relative;
}

.search-input {
  width: 240px;
  padding: 8px 16px 8px 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-alt);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(93, 135, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.theme-toggle {
  background: var(--background-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--background);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.nav-section {
  margin-bottom: 32px;
}

.nav-title {
  padding: 0 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: var(--background-alt);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(93, 135, 255, 0.08);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  font-weight: 600;
}

.nav-icon {
  margin-right: 12px;
  font-size: 18px;
}

/* Main Content */
.main-container {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 48px;
  max-width: 1200px;
  min-height: calc(100vh - var(--header-height));
}

.content {
  max-width: 800px;
}

/* Typography */
h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
  color: var(--text-primary);
}

h2 {
  font-size: 32px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

h3 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

h4 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--secondary-color);
}

/* Code Blocks */
code {
  background: var(--code-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  color: var(--text-primary);
}

pre {
  background: var(--code-bg);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border-color);
}

pre code {
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

/* Lists */
ul, ol {
  margin: 16px 0;
  padding-left: 24px;
  color: var(--text-secondary);
}

li {
  margin-bottom: 8px;
}

/* Callouts */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  border-left: 4px solid;
}

.callout-info {
  background: rgba(93, 135, 255, 0.08);
  border-left-color: var(--primary-color);
}

.callout-success {
  background: rgba(19, 222, 185, 0.08);
  border-left-color: var(--success);
}

.callout-warning {
  background: rgba(255, 174, 31, 0.08);
  border-left-color: var(--warning);
}

.callout-error {
  background: rgba(250, 137, 107, 0.08);
  border-left-color: var(--error);
}

.callout-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cards */
.card {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--background-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

thead {
  background: var(--background-alt);
}

th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

tr:hover {
  background: var(--background-alt);
}

/* Navigation Footer */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.page-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s;
  max-width: 45%;
}

.page-nav-link:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateX(4px);
}

.page-nav-link.prev:hover {
  transform: translateX(-4px);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-container {
    margin-left: 0;
    padding: 32px 24px;
  }

  .mobile-menu-btn {
    display: block;
  }

  .search-input {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }

  .header-nav {
    gap: 12px;
  }

  .header-link {
    display: none;
  }

  .search-input {
    width: 140px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 24px;
  }

  .main-container {
    padding: 24px 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .page-nav {
    flex-direction: column;
    gap: 16px;
  }

  .page-nav-link {
    max-width: 100%;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content > * {
  animation: fadeIn 0.5s ease;
}

/* Emoji Support */
.emoji {
  font-style: normal;
  font-size: 1.2em;
  vertical-align: middle;
}

/* Copy Button for Code */
.code-block {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 64px 0;
  background: linear-gradient(180deg, rgba(93, 135, 255, 0.05) 0%, transparent 100%);
  border-radius: 16px;
  margin-bottom: 48px;
}

.hero h1 {
  font-size: 56px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
}

.hero p {
  font-size: 20px;
  max-width: 600px;
  margin: 0 auto 32px;
}
