/* User Guide Styles */

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  padding: 6px;
  color: white;
}

.guide-layout {
  display: flex;
  min-height: calc(100vh - 73px);
}

/* Sidebar */
.guide-sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 73px;
  height: calc(100vh - 73px);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.guide-sidebar .search-box {
  position: relative;
}

.guide-sidebar .search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.guide-sidebar .search-box input {
  width: 100%;
  padding: 0.6rem 0.75rem 0.6rem 2.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.guide-sidebar .search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Navigation */
.guide-nav {
  padding: 1rem 0;
}

.nav-section {
  padding: 0 1rem;
  margin-bottom: 1.5rem;
}

.nav-section h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 0.125rem;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--hover);
}

.nav-item.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.nav-item .badge {
  margin-left: auto;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
}

.nav-item .badge.critical {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.nav-item .badge.pro {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* Main Content */
.guide-content {
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 1200px;
  overflow-x: auto;
  overflow-y: auto;
}

/* Content Sections */
.guide-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* Typography */
.guide-section h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.guide-section .subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.guide-section h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.guide-section h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.guide-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.guide-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.guide-section ul, .guide-section ol {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.guide-section li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Links */
.guide-section a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.guide-section a:hover {
  text-decoration: underline;
}

/* App Link Buttons */
.app-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.app-link:hover {
  background: rgba(99, 102, 241, 0.2);
  text-decoration: none;
}

.app-link svg {
  width: 16px;
  height: 16px;
}

/* Tables */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.guide-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 600;
}

.guide-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.guide-table tr:hover td {
  background: rgba(99, 102, 241, 0.03);
}

/* Info Cards */
.info-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.info-card.tip {
  border-left: 4px solid var(--success);
}

.info-card.warning {
  border-left: 4px solid var(--warning);
}

.info-card.critical {
  border-left: 4px solid var(--danger);
}

.info-card .card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.info-card .card-title svg {
  width: 18px;
  height: 18px;
}

.info-card.tip .card-title { color: var(--success); }
.info-card.warning .card-title { color: var(--warning); }
.info-card.critical .card-title { color: var(--danger); }

.info-card p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Step Cards */
.steps-container {
  margin: 1.5rem 0;
}

.step-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

.step-card:hover {
  border-color: var(--primary);
}

.step-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.875rem;
  margin: 0;
}

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

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.25rem;
  text-align: center;
}

.metric-card .value {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.metric-card .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Score Thresholds */
.score-bar {
  display: flex;
  height: 8px;
  margin: 1rem 0 0.5rem;
  overflow: hidden;
}

.score-segment {
  flex: 1;
}

.score-segment.excellent { background: #10b981; }
.score-segment.good { background: #6366f1; }
.score-segment.average { background: #f59e0b; }
.score-segment.below { background: #f97316; }
.score-segment.poor { background: #ef4444; }

.score-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Workflow Diagram */
.workflow-diagram {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.workflow-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-width: max-content;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 140px;
}

.workflow-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.workflow-icon svg {
  width: 28px;
  height: 28px;
  color: white;
}

.workflow-step h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.workflow-step p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 120px;
}

.workflow-arrow {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  padding-top: 1rem;
}

.workflow-arrow svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

/* Credit Cost Badge */
.credit-cost {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.credit-cost svg {
  width: 12px;
  height: 12px;
}

/* Illustration Container */
.illustration-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2rem;
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.illustration-container svg {
  max-width: 100%;
  height: auto;
}

/* Code Blocks */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  color: #e6edf3;
}

/* FAQ Accordion */
.faq-list {
  margin: 1.5rem 0;
}

.faq-item {
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  cursor: pointer;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--hover);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-content {
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 900px) {
  .guide-sidebar {
    display: none;
  }

  .guide-content {
    padding: 1.5rem;
  }
}

/* Inline App Links */
.inline-app-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.4);
  transition: all 0.2s;
}

.inline-app-link:hover {
  border-bottom-color: var(--primary);
  text-decoration: none;
}

/* Guide Links (internal documentation links) */
.guide-link {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dotted rgba(139, 92, 246, 0.4);
  transition: all 0.2s;
}

.guide-link:hover {
  border-bottom-color: var(--secondary);
  text-decoration: none;
}

/* App Links Group */
.app-links-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.app-links-group .app-link.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.app-links-group .app-link.secondary:hover {
  background: var(--hover);
  border-color: var(--primary);
  color: var(--primary);
}

/* Screenshot Placeholder */
.screenshot-placeholder {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 2px dashed rgba(99, 102, 241, 0.3);
  margin: 1.5rem 0;
  padding: 0;
  overflow: hidden;
}

.screenshot-inner {
  padding: 2rem;
  text-align: center;
}

.screenshot-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
  opacity: 0.6;
  margin-bottom: 1rem;
}

.screenshot-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.screenshot-specs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.screenshot-specs .spec {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
}

.screenshot-specs .spec strong {
  color: var(--text-primary);
}

.screenshot-path {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Monaco', 'Menlo', monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  display: inline-block;
}

/* Screenshot Container (actual images) */
.screenshot-container {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--bg-secondary);
}

.screenshot-image {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-caption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* Illustration with Caption */
.illustration {
  margin: 1.5rem 0;
}

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

.illustration-caption {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.75rem;
  padding: 0 1rem;
}

/* Enhanced Illustration Container */
.illustration-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2rem;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.illustration-container svg {
  max-width: 100%;
  height: auto;
}

.illustration-container .illustration-caption {
  margin-top: 1rem;
}

/* Print Styles */
@media print {
  .guide-sidebar {
    display: none;
  }

  .guide-content {
    max-width: 100%;
  }

  .screenshot-placeholder {
    border-style: solid;
    page-break-inside: avoid;
  }

  .illustration-container {
    page-break-inside: avoid;
  }
}
