/* Documentation Page Styles
   ==========================
   Terminal-inspired styling for documentation interface
*/

/* Docs Container */
.docs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  line-height: 1.6;
}

/* Hero Section */
.docs-hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 3rem 0;
  background: var(--term-bg-alt);
  border: 1px solid var(--term-border);
  border-radius: 8px;
}

.docs-hero h1 {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  color: var(--term-primary);
  margin-bottom: 1rem;
  text-transform: lowercase;
}

.docs-hero p {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  color: var(--term-fg);
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA Buttons */
.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--term-primary);
  color: var(--term-bg);
  text-decoration: none;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  transition: all 0.3s ease;
  border: 1px solid var(--term-primary);
}

.cta-button:hover {
  background: var(--term-bg);
  color: var(--term-primary);
  transform: translateY(-2px);
}

.cta-button.secondary {
  background: var(--term-bg-alt);
  color: var(--term-fg);
  border: 1px solid var(--term-border);
}

.cta-button.secondary:hover {
  background: var(--term-bg-highlight);
  border-color: var(--term-primary);
}

/* Quick Start Section */
.quick-start {
  margin-bottom: 3rem;
}

.quick-start h2 {
  font-family: var(--font-mono);
  font-size: var(--font-size-2xl);
  color: var(--term-fg-bright);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.llm-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--term-secondary);
  color: var(--term-bg);
  border-radius: 4px;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  font-weight: bold;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--term-border);
  flex-wrap: wrap;
}

.tab {
  padding: 0.75rem 1rem;
  background: var(--term-bg-alt);
  border: 1px solid var(--term-border);
  border-bottom: none;
  color: var(--term-fg-dim);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  transition: all 0.3s ease;
  border-radius: 4px 4px 0 0;
}

.tab:hover {
  background: var(--term-bg-highlight);
  color: var(--term-fg);
}

.tab.active {
  background: var(--term-primary);
  color: var(--term-bg);
  border-color: var(--term-primary);
}

/* Tab Content */
.tab-content {
  display: none;
  background: var(--term-bg-alt);
  border: 1px solid var(--term-border);
  border-radius: 0 4px 4px 4px;
  padding: 3rem;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
}

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

/* Steps */
.step {
  margin-bottom: 3rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--term-border);
  overflow: hidden;
}

.step:last-child {
  border-bottom: none;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--term-primary);
  color: var(--term-bg);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: var(--font-size-base);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.step > div {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.step h4 {
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  color: var(--term-fg-bright);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.step p {
  font-family: var(--font-mono);
  color: var(--term-fg);
  margin-bottom: 1.5rem;
  line-height: 1.7;
  font-size: var(--font-size-base);
}

.step ul {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.step li {
  font-family: var(--font-mono);
  color: var(--term-fg);
  margin-bottom: 0.75rem;
  line-height: 1.6;
  font-size: var(--font-size-base);
}

.step code {
  background: var(--term-bg);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--term-secondary);
  font-size: 0.9rem;
  border: 1px solid var(--term-border);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Code Blocks */
.code-block {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 100%;
}

.code-block code {
  font-family: var(--font-mono);
  color: var(--term-fg);
  white-space: pre-wrap;
  line-height: 1.7;
  background: none;
  padding: 0;
  font-size: 0.9rem;
  display: block;
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Copy button for code blocks */
.code-block {
  position: relative;
}

.code-block:hover::after {
  content: 'Click to select';
  position: absolute;
  top: 8px;
  right: 12px;
  background: var(--term-primary);
  color: var(--term-bg);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  font-family: var(--font-sans);
  opacity: 0.9;
  pointer-events: none;
  z-index: 10;
  transition: all 0.2s ease;
}

.code-block[data-copied="true"]::after {
  content: '✓ Selected! Copy with Ctrl+C';
  background: var(--term-success);
  opacity: 1;
}

.code-block code:hover {
  cursor: pointer;
}

.code-block code:active {
  transform: scale(0.998);
}

/* Animation classes */
.animate-in {
  animation: slideInUp 0.6s ease-out forwards;
}

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

/* Loading states */
.step, .feature-card {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.step.animate-in, .feature-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced focus states for accessibility */
.tab:focus-visible {
  outline: 2px solid var(--term-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.cta-button:focus-visible {
  outline: 2px solid var(--term-primary);
  outline-offset: 2px;
}

/* Feature Cards */
.card-stack {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.gap-xl {
  gap: 2rem;
}

.feature-card {
  background: var(--term-bg-alt);
  border: 1px solid var(--term-border);
  border-radius: 4px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--term-primary);
  transform: translateY(-2px);
}

.feature-card h3 {
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  color: var(--term-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-card p {
  font-family: var(--font-mono);
  color: var(--term-fg);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.feature-card a {
  color: var(--term-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  transition: color 0.3s ease;
}

.feature-card a:hover {
  color: var(--term-primary);
}

/* MCP Setup Section */
.mcp-setup {
  margin-bottom: 3rem;
}

.mcp-setup h2 {
  font-family: var(--font-mono);
  font-size: var(--font-size-2xl);
  color: var(--term-fg-bright);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.docs-grid div {
  background: var(--term-bg-alt);
  border: 1px solid var(--term-border);
  border-radius: 4px;
  padding: 1.5rem;
}

.docs-grid h4 {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  color: var(--term-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-grid p {
  font-family: var(--font-mono);
  color: var(--term-fg);
  line-height: 1.6;
}

/* LM Studio Deeplink */
.lmstudio-deeplink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--term-primary), var(--term-secondary));
  color: var(--term-bg);
  text-decoration: none;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  font-weight: bold;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lmstudio-deeplink:hover {
  background: var(--term-bg);
  color: var(--term-primary);
  border-color: var(--term-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.lmstudio-deeplink:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Integration Section */
.integration-section {
  margin-bottom: 3rem;
  text-align: center;
}

.integration-section h3 {
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  color: var(--term-fg-bright);
  margin-bottom: 0.5rem;
}

.docs-muted-text {
  font-family: var(--font-mono);
  color: var(--term-fg-dim);
  margin-bottom: 2rem;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.integration-item {
  background: var(--term-bg-alt);
  border: 1px solid var(--term-border);
  border-radius: 4px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--term-fg);
  text-align: center;
  transition: all 0.3s ease;
}

.integration-item:hover {
  border-color: var(--term-primary);
  color: var(--term-primary);
}

/* Feature Box */
.docs-feature-box {
  background: var(--term-bg-alt);
  border: 1px solid var(--term-border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 3rem;
  text-align: center;
}

.docs-feature-box h2 {
  font-family: var(--font-mono);
  font-size: var(--font-size-2xl);
  color: var(--term-fg-bright);
  margin-bottom: 1rem;
}

/* List Spacing */
.docs-list-spacing {
  margin: 1.5rem 0;
  padding-left: 2rem;
  max-width: 100%;
}

.docs-list-spacing li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  font-size: var(--font-size-base);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.docs-para-spacing {
  margin: 1.5rem 0;
  line-height: 1.7;
}

.docs-para-spacing strong {
  color: var(--term-fg-bright);
  font-weight: bold;
}

/* LM Studio Button */
.lmstudio-button-container {
  margin: 1.5rem 0;
  text-align: center;
}

.lmstudio-button {
  display: inline-block;
  transition: transform 0.2s ease;
}

.lmstudio-button:hover {
  transform: translateY(-2px);
}

.lmstudio-button img {
  height: 40px;
  width: auto;
}

.deeplink-note {
  margin-top: 0.75rem;
  font-size: var(--font-size-small);
  color: var(--term-muted);
  font-style: italic;
}

/* Condensed Features Overview */
.tools-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.tool-category {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: 4px;
  font-size: var(--font-size-small);
  transition: all 0.3s ease;
}

.tool-category:hover {
  border-color: var(--term-primary);
  background: var(--term-bg-highlight);
}

.category-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

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

.resource-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--term-text);
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
  transition: all 0.3s ease;
}

.resource-link:hover {
  border-color: var(--term-primary);
  color: var(--term-primary);
  background: var(--term-bg-highlight);
  transform: translateX(4px);
}

/* Enhanced Styles and Fixes */
.docs-container {
  max-width: 1400px;
}

/* Better hero spacing */
.docs-hero {
  padding: 4rem 2rem;
  margin-bottom: 4rem;
}

/* Improve button consistency */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
}

.cta-button span {
  display: inline-block;
}

/* Better tab content padding */
.tab-content {
  padding: 3rem;
}

/* Improve code block readability */
.code-block {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.code-block code {
  display: block;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Add copy button styling for future enhancement */
.code-block::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--term-primary), var(--term-secondary));
  border-radius: 6px 6px 0 0;
}

/* Better tools overview spacing */
.tools-overview {
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Improve feature box spacing */
.docs-feature-box {
  padding: 3rem;
  margin: 4rem 0;
}

/* Fix list spacing */
.step ul li,
.step ol li {
  line-height: 1.8;
}

/* Improved inline code in paragraphs */
.step p code,
.docs-para-spacing code,
.tab-content p code:not(.code-block code) {
  background: var(--term-bg);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--term-secondary);
  font-size: 0.85rem;
  border: 1px solid var(--term-border);
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Inline code style for spans */
.code-inline {
  background: var(--term-bg);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--term-secondary);
  font-size: 0.85rem;
  border: 1px solid var(--term-border);
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Long code paths handling - improved for file paths */
.step li code,
.docs-list-spacing li code {
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
}

/* Special handling for file paths in configuration steps */
.step li code[data-filepath],
.docs-list-spacing li code {
  display: block;
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: var(--term-bg);
  border-left: 3px solid var(--term-primary);
  font-size: 0.85rem;
}

/* Responsive file paths */
@media (max-width: 768px) {
  .step li code,
  .docs-list-spacing li code {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }
}

/* Better link styling */
.tab-content a:not(.cta-button):not(.lmstudio-button) {
  color: var(--term-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tab-content a:not(.cta-button):not(.lmstudio-button):hover {
  color: var(--term-primary);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Better hover states */
.feature-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tab accessibility */
.tab:focus-visible {
  outline: 2px solid var(--term-primary);
  outline-offset: 2px;
}

/* Better Tab Styling */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--term-border);
  flex-wrap: wrap;
  background: var(--term-bg-alt);
  padding: 0.5rem;
  border-radius: 8px 8px 0 0;
}

.tab-content {
  background: var(--term-bg-alt);
  border: 1px solid var(--term-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 2rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Enhanced Step Layout */
.step {
  margin-bottom: 2.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--term-border);
  position: relative;
}

/* Better code formatting in steps */
.step .code-block {
  margin: 1rem 0;
}

.step strong + br + code {
  margin-top: 0.25rem;
}

.step::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 4rem;
  bottom: -1rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--term-primary), transparent);
  opacity: 0.3;
}

.step:last-child::before {
  display: none;
}

.step:last-child {
  border-bottom: none;
}

/* Better Integration Grid */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  margin: 2rem auto;
}

.integration-item {
  background: var(--term-bg);
  border: 2px solid var(--term-border);
  border-radius: 8px;
  padding: 1.5rem 1rem;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--term-fg);
  text-align: center;
  transition: all 0.3s ease;
  font-weight: 500;
}

.integration-item:hover {
  border-color: var(--term-primary);
  color: var(--term-primary);
  background: var(--term-bg-highlight);
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Enhanced Feature Cards */
.feature-card {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--term-primary), var(--term-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover {
  border-color: var(--term-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Responsive Design */
@media (max-width: 768px) {
  .docs-container {
    padding: 1rem;
    max-width: 100%;
  }
  
  .docs-hero {
    padding: 2rem 1rem;
    margin-bottom: 2rem;
  }
  
  .docs-hero h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }
  
  .docs-hero p {
    font-size: var(--font-size-base);
    margin-bottom: 1.5rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .cta-button {
    width: 100%;
    max-width: none;
    justify-content: center;
  }
  
  .tabs {
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: none;
  }
  
  .tab {
    border-radius: 0;
    border-bottom: 1px solid var(--term-border);
    margin-bottom: 0;
  }
  
  .tab:first-child {
    border-radius: 8px 8px 0 0;
  }
  
  .tab:last-child {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
  }
  
  .tab-content {
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
  }
  
  .step {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
  }
  
  .step::before {
    left: 1rem;
    top: 3rem;
  }
  
  .step-number {
    align-self: flex-start;
    width: 2rem;
    height: 2rem;
    font-size: var(--font-size-sm);
  }
  
  .step h4 {
    font-size: var(--font-size-lg);
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }
  
  .step p {
    margin-bottom: 1rem;
    font-size: var(--font-size-sm);
    line-height: 1.6;
  }
  
  .step ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
  }
  
  .step li {
    margin-bottom: 0.75rem;
    font-size: var(--font-size-sm);
    line-height: 1.5;
  }
  
  .docs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .integration-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem auto;
  }
  
  .integration-item {
    padding: 1rem 0.75rem;
    font-size: var(--font-size-xs);
  }
  
  .code-block {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
  }
  
  .code-block code {
    font-size: 0.8rem;
    line-height: 1.5;
  }
  
  .code-block:hover::after {
    display: none;
  }
  
  .docs-feature-box {
    padding: 1.5rem;
    margin: 2rem 0;
  }
  
  .resource-links {
    gap: 1rem;
    grid-template-columns: 1fr;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  .tools-overview {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .docs-hero h1 {
    font-size: 1.75rem;
  }
  
  .docs-hero p {
    font-size: var(--font-size-base);
  }
  
  .integration-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .integration-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .docs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}