/**
 * Documentation-Specific Styles
 * Used for documentation content imported from legacy PHP files
 */

/* Alert Boxes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.alert-info {
  background: rgba(136, 120, 249, 0.1);
  border: 1px solid var(--sc-purple);
  color: var(--sc-white);
}

.alert-warning {
  background: rgba(247, 121, 121, 0.1);
  border: 1px solid #f77979;
  color: var(--sc-white);
}

.alert-success {
  background: rgba(121, 247, 171, 0.1);
  border: 1px solid #79f7ab;
  color: var(--sc-white);
}

.alert strong {
  font-weight: 600;
}

/* Service Grid */
.service-grid, .principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.service-card, .principle-card {
  background: var(--sc-dark-blue);
  background-color: var(--sc-black);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.service-card:hover, .principle-card:hover {
  border-color: var(--sc-purple);
  transform: translateY(-2px);
}

.service-icon, .principle-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--sc-purple);
}

.service-title, .principle-title {
  font-size: 1.125rem;
  color: var(--sc-white);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.service-desc, .principle-desc {
  color: var(--sc-gray);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.metric-box {
  text-align: center;
  padding: 1.5rem;
  background: var(--sc-dark-blue);
  background-color: var(--sc-black);
  border-radius: 8px;
  border: 1px solid var(--sc-dark-gray);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--sc-purple);
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--sc-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Feature List */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.feature-item {
  padding: 0.75rem 0;
  padding-left: 2rem;
  position: relative;
  color: var(--sc-gray);
}

.feature-item:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--sc-green);
  font-weight: bold;
}

/* Architecture Diagram */
.architecture-diagram {
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
  margin: 2rem 0;
}

.diagram-placeholder {
  color: var(--sc-gray);
  font-style: italic;
}

/* Code Blocks */
.code-block {
  background: var(--sc-black);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.code-block pre {
  margin: 0;
  color: var(--sc-gray);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre;
  word-wrap: normal;
  overflow-x: auto;
}

/* Documentation Tables */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  overflow: hidden;
}

.doc-table thead {
  background: var(--sc-black);
}

.doc-table th {
  padding: 1rem;
  text-align: left;
  color: var(--sc-white);
  font-weight: 600;
  border-bottom: 1px solid var(--sc-dark-gray);
}

.doc-table td {
  padding: 1rem;
  color: var(--sc-gray);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.doc-table tbody tr:hover {
  background: rgba(136, 120, 249, 0.05);
}

/* Documentation Lead Text */
.doc-lead {
  font-size: 1.125rem;
  color: var(--sc-gray);
  line-height: 1.8;
  margin-bottom: 2rem;
}

/* Documentation Sections */
.doc-section {
  margin-bottom: 3rem;
}

.doc-section:last-child {
  margin-bottom: 0;
}

/* Inline Code */
.doc-body code {
  background: var(--sc-black);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875em;
  color: var(--sc-purple);
}

/* Pre-formatted Code */
.doc-body pre {
  background: var(--sc-black);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  display: block;
  word-wrap: normal;
  white-space: pre;
}

.doc-body pre code {
  background: none;
  padding: 0;
  color: var(--sc-gray);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .service-grid {
    grid-template-columns: 1fr;
  }
  
  .doc-table {
    font-size: 0.875rem;
  }
  
  .doc-table th,
  .doc-table td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .alert {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .code-block {
    padding: 1rem;
    margin: 1rem -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .code-block pre {
    font-size: 0.75rem;
  }
  
  /* Service and principle cards */
  .service-grid, .principles-grid {
    gap: 1rem;
  }
  
  .service-card, .principle-card {
    padding: 1.25rem;
  }
  
  .service-title, .principle-title {
    font-size: 1rem;
  }
  
  .service-desc, .principle-desc {
    font-size: 0.8125rem;
  }
  
  /* Tables responsive scroll */
  .doc-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .doc-table th,
  .doc-table td {
    padding: 0.5rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }
  
  /* Pattern cards */
  .pattern-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .pattern-card {
    padding: 1.25rem;
  }
  
  /* Deployment options */
  .deployment-options {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .deployment-card {
    padding: 1.25rem;
  }
  
  .pros-cons {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  /* Checklists */
  .checklist {
    padding: 1.5rem 1rem;
    margin: 1.5rem -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .checklist-item {
    padding: 0.75rem;
    gap: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
  }
  
  body .checklist-checkbox {
    width: 18px;
    height: 18px;
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
  }
  
  .checklist-content {
    padding-left: 2rem;
    width: 100%;
  }
  
  .checklist-label {
    font-size: 0.875rem;
  }
  
  .checklist-desc {
    font-size: 0.8125rem;
  }
  
  /* Phase timeline */
  .phase-item {
    gap: 1rem;
  }
  
  .phase-marker {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
  }
  
  /* Tech stack */
  .tech-stack {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Ultra narrow phones */
@media (max-width: 360px) {
  .code-block pre {
    font-size: 0.7rem;
  }
  
  .doc-table {
    font-size: 0.75rem;
  }
  
  .doc-table th,
  .doc-table td {
    padding: 0.375rem;
  }
  
  .alert {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }
  
  .service-card, .principle-card {
    padding: 1rem;
  }
  
  .pattern-card {
    padding: 1rem;
  }
  
  .checklist {
    padding: 1.25rem 0.875rem;
  }
}

/* Documentation Navigation (for sidebar) */
.doc-nav-section {
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.doc-nav-title {
  font-size: 0.875rem;
  color: var(--sc-purple);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Table of Contents (TOC) Styles */
.toc {
  background: var(--sc-dark-blue);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--sc-dark-gray);
}

.toc-title {
  font-size: 1.125rem;
  color: var(--sc-white);
  margin-bottom: 1rem;
  font-weight: 600;
}

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

.toc-item {
  margin-bottom: 0.75rem;
}

.toc-link {
  color: var(--sc-gray);
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
  padding: 0.25rem 0;
}

.toc-link:hover {
  color: var(--sc-purple);
}

/* Documentation Container Grid */
.doc-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.doc-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.doc-content {
  max-width: 800px;
}

@media (max-width: 768px) {
  .doc-container {
    grid-template-columns: 1fr;
  }
  
  .doc-sidebar {
    position: static;
    margin-bottom: 2rem;
  }
}

/* Principles Grid (for Zero Trust and similar) */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.principle-card {
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.principle-card:hover {
  border-color: var(--sc-purple);
  transform: translateY(-2px);
}

.principle-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--sc-purple);
}

.principle-title {
  font-size: 1.125rem;
  color: var(--sc-white);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.principle-desc {
  color: var(--sc-gray);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Pattern Grid (for Architecture Patterns) */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.pattern-card {
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.pattern-card:hover {
  border-color: var(--sc-purple);
  transform: translateY(-2px);
}

.pattern-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--sc-dark-gray);
}

.pattern-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--sc-purple);
}

.pattern-title {
  font-size: 1.125rem;
  color: var(--sc-white);
  margin: 0 0 0.75rem 0;
  font-weight: 600;
}

.pattern-badge {
  display: inline-block;
  background: var(--sc-purple);
  color: var(--sc-white);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}

.pattern-desc {
  color: var(--sc-gray);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.pattern-use-cases {
  color: var(--sc-purple);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pattern-link {
  color: var(--sc-purple);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

.pattern-link:hover {
  color: var(--sc-white);
}

/* Checklist Styles */
.checklist {
  background: var(--sc-dark-blue);
  /*border: 1px solid var(--sc-dark-gray);*/
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
  overflow: hidden;
}

.checklist-section {
  margin-bottom: 2rem;
}

.checklist-section:last-child {
  margin-bottom: 0;
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.checklist-title {
  font-size: 1.25rem;
  color: var(--sc-white);
  font-weight: 600;
}

.checklist-badge {
  background: var(--sc-purple);
  color: var(--sc-white);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--sc-black);
  border-radius: 6px;
  transition: all 0.3s ease;
  word-break: break-word;
  position: relative;
}

.checklist-item:hover {
  background: rgba(136, 120, 249, 0.05);
}

.checklist-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--sc-purple);
  border-radius: 4px;
  margin-top: 2px;
  position: relative;
}

.checklist-checkbox:after {
  content: "✓";
  position: absolute;
  top: -2px;
  left: 2px;
  color: var(--sc-green);
  font-weight: bold;
  display: none;
}

.checklist-item.completed .checklist-checkbox:after {
  display: block;
}

.checklist-content {
  flex: 1;
}

.checklist-label {
  color: var(--sc-white);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.checklist-desc {
  color: var(--sc-gray);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Phase Timeline */
.phase-timeline {
  margin: 2rem 0;
}

.phase-item {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  position: relative;
}

.phase-item:before {
  content: "";
  position: absolute;
  left: 15px;
  top: 35px;
  bottom: -35px;
  width: 2px;
  background: var(--sc-dark-gray);
}

.phase-item:last-child:before {
  display: none;
}

.phase-marker {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--sc-purple);
  color: var(--sc-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  position: relative;
  z-index: 1;
}

.phase-content {
  flex: 1;
  padding-bottom: 1rem;
}

.phase-content h3 {
  color: var(--sc-white);
  margin-bottom: 0.5rem;
}

.phase-content p {
  color: var(--sc-gray);
  line-height: 1.6;
}

/* Deployment Options */
.deployment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.deployment-card {
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1.5rem;
}

.deployment-title {
  font-size: 1.25rem;
  color: var(--sc-white);
  margin-bottom: 1rem;
  font-weight: 600;
}

.deployment-desc {
  color: var(--sc-gray);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pros, .cons {
  padding: 1rem;
  border-radius: 6px;
}

.pros {
  background: rgba(121, 247, 171, 0.1);
  border: 1px solid rgba(121, 247, 171, 0.3);
}

.cons {
  background: rgba(247, 121, 121, 0.1);
  border: 1px solid rgba(247, 121, 121, 0.3);
}

.deployment-pros, .deployment-cons {
  list-style: none;
  padding: 0;
  margin: 0;
}

.deployment-pros li, .deployment-cons li {
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.deployment-pros li:before {
  content: "✓ ";
  color: var(--sc-green);
  font-weight: bold;
}

.deployment-cons li:before {
  content: "✗ ";
  color: #f77979;
  font-weight: bold;
}

/* Tech Stack */
.tech-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.tech-item {
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
}

.tech-name {
  color: var(--sc-white);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tech-purpose {
  color: var(--sc-gray);
  font-size: 0.875rem;
}

/* Implementation Examples */
.implementation-example {
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.implementation-title {
  color: var(--sc-white);
  font-size: 1.125rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* ASCII Diagrams */
.diagram-ascii {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--sc-gray);
  white-space: pre;
  overflow-x: auto;
}

/* Time Estimates */
.time-estimate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--sc-dark-blue);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--sc-dark-gray);
  color: var(--sc-gray);
  font-size: 0.875rem;
  margin: 1rem 0;
}

/* Comparison Tables */
.comparison-table, .metrics-table, .requirements-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--sc-dark-blue);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  overflow: hidden;
}

.comparison-table th,
.metrics-table th,
.requirements-table th {
  background: var(--sc-black);
  padding: 1rem;
  text-align: left;
  color: var(--sc-white);
  font-weight: 600;
  border-bottom: 1px solid var(--sc-dark-gray);
}

.comparison-table td,
.metrics-table td,
.requirements-table td {
  padding: 1rem;
  color: var(--sc-gray);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-table tbody tr:last-child td,
.metrics-table tbody tr:last-child td,
.requirements-table tbody tr:last-child td {
  border-bottom: none;
}

/* Code Headers */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sc-black);
  padding: 0.75rem 1rem;
  border: 1px solid var(--sc-dark-gray);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
}

.code-header + .code-block {
  border-radius: 0 0 8px 8px;
  margin-top: 0;
}

.code-title {
  color: var(--sc-white);
  font-size: 0.875rem;
  font-weight: 600;
}

.code-language {
  color: var(--sc-purple);
  font-size: 0.75rem;
  background: rgba(136, 120, 249, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* Command Output */
.command-output {
  background: var(--sc-black);
  border: 1px solid var(--sc-dark-gray);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
  color: #79f7ab;
  overflow-x: auto;
}

/* Principle Items (numbered) */
.principle-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.principle-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--sc-purple);
  color: var(--sc-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.principle-name {
  color: var(--sc-white);
  font-weight: 600;
  font-size: 1.125rem;
}

/* Ensure proper color variable fallbacks */
:root {
  --sc-green: #79f7ab;
}
body .doc-related-card {
  background: var(--sc-black);
  background-color: var(--sc-dark-blue);
}