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

:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #8b5cf6;
  --bg-color: #f8fafc;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-light: #cbd5e1;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-light);
  opacity: 0.8;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  border-left-color: var(--primary-color);
}

.nav-item.active {
  background-color: var(--sidebar-hover);
  border-left-color: var(--primary-color);
  color: #ffffff;
  font-weight: 500;
}

.nav-icon {
  font-size: 1.25rem;
  margin-right: 0.75rem;
  width: 24px;
  text-align: center;
}

.nav-text {
  font-size: 0.9375rem;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.version {
  font-size: 0.75rem;
  color: var(--text-light);
  opacity: 0.6;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem 3rem;
  max-width: 1200px;
}

.content-section {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

.content-section.active {
  display: block;
}

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

h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

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

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

.card {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

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

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

/* Lists */
.feature-list,
.flow-list,
.integration-list,
.security-list,
.monitoring-list {
  list-style: none;
  padding-left: 0;
}

.feature-list li,
.flow-list li,
.integration-list li,
.security-list li,
.monitoring-list li {
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
}

.feature-list li::before,
.flow-list li::before,
.integration-list li::before,
.security-list li::before,
.monitoring-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.flow-list li {
  counter-increment: step-counter;
  padding-left: 2rem;
}

.flow-list {
  counter-reset: step-counter;
}

.flow-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  background-color: var(--primary-color);
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Component Grid */
.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.component-item {
  padding: 1.25rem;
  background-color: var(--bg-color);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}

.component-item h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.component-item p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.component-item code {
  display: block;
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  padding: 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: 'Courier New', monospace;
  margin-top: 0.5rem;
}

/* Tech Grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.tech-item {
  padding: 1.25rem;
  background-color: var(--bg-color);
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-color);
}

.tech-item h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.tech-item p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Code Block */
.code-block {
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

.code-block code {
  color: var(--text-light);
}

/* Module List */
.module-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.module-item {
  padding: 1.25rem;
  background-color: var(--bg-color);
  border-radius: 0.5rem;
  border-left: 4px solid var(--secondary-color);
}

.module-item h4 {
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

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

.module-item ul {
  list-style: none;
  padding-left: 1rem;
}

.module-item ul li {
  padding: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.module-item ul li::before {
  content: '→';
  margin-right: 0.5rem;
  color: var(--secondary-color);
}

.module-item code {
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: 'Courier New', monospace;
}

/* Schema Info */
.schema-info {
  margin-top: 1rem;
}

.schema-info h4 {
  color: var(--primary-color);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.schema-info h4:first-child {
  margin-top: 0;
}

.schema-info p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.schema-info ul {
  list-style: none;
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.schema-info ul li {
  padding: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.schema-info code {
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: 'Courier New', monospace;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.metric-item {
  padding: 1.25rem;
  background-color: var(--bg-color);
  border-radius: 0.5rem;
  border-top: 4px solid var(--primary-color);
}

.metric-item h4 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.metric-item ul {
  list-style: none;
  padding-left: 0;
}

.metric-item ul li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.metric-item ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.25rem;
}

/* Alerts List */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.alert-item {
  padding: 1rem;
  background-color: var(--bg-color);
  border-radius: 0.5rem;
  border-left: 4px solid #f59e0b;
}

.alert-item h4 {
  color: #f59e0b;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.alert-item p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }

  .component-grid,
  .tech-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--sidebar-hover);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Diagram Images */
.diagram-image {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1rem 0;
  text-align: center;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.diagram-svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Responsive Diagram Images */
@media (max-width: 768px) {
  .diagram-image {
    padding: 1rem;
  }
  
  .diagram-svg {
    width: 100%;
  }
}

