/**
 * Claude Code Templates - Terminal Theme for Docusaurus
 * Matching the main website's dark terminal aesthetic
 */

/* Terminal theme colors matching main site */
:root {
  /* Dark theme colors (terminal style) */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border-primary: #30363d;
  --border-secondary: #21262d;
  --text-primary: #c9d1d9;
  --text-secondary: #7d8590;
  --text-accent: #d57455;
  --text-success: #3fb950;
  --text-warning: #f97316;
  --text-error: #f85149;
  --text-info: #a5d6ff;
  --shadow-primary: rgba(0, 0, 0, 0.4);
  --shadow-secondary: rgba(1, 4, 9, 0.85);
  
  /* Docusaurus overrides - Force dark theme */
  --ifm-color-primary: #00d4aa;
  --ifm-color-primary-dark: #00c299;
  --ifm-color-primary-darker: #00b88f;
  --ifm-color-primary-darkest: #009973;
  --ifm-color-primary-light: #1addbb;
  --ifm-color-primary-lighter: #26e1c5;
  --ifm-color-primary-lightest: #4de6d2;
  
  /* Background colors */
  --ifm-background-color: var(--bg-primary);
  --ifm-background-surface-color: var(--bg-secondary);
  --ifm-color-content-secondary: var(--text-secondary);
  --ifm-color-content: var(--text-primary);
  
  /* Navbar and footer */
  --ifm-navbar-background-color: var(--bg-secondary);
  --ifm-navbar-link-color: var(--text-primary);
  --ifm-navbar-link-hover-color: var(--text-accent);
  --ifm-footer-background-color: var(--bg-secondary);
  --ifm-footer-color: var(--text-secondary);
  
  /* Code blocks */
  --ifm-code-font-size: 95%;
  --ifm-code-background: var(--bg-tertiary);
  --ifm-code-color: var(--text-primary);
  --ifm-pre-background: var(--bg-tertiary);
  --ifm-pre-color: var(--text-primary);
  --docusaurus-highlighted-code-line-bg: rgba(0, 212, 170, 0.1);
  
  /* Borders and dividers */
  --ifm-color-emphasis-200: var(--border-primary);
  --ifm-color-emphasis-300: var(--border-primary);
  --ifm-color-emphasis-400: var(--border-secondary);
  --ifm-hr-background-color: var(--border-primary);
  
  /* Cards and containers */
  --ifm-card-background-color: var(--bg-secondary);
  --ifm-card-border-radius: 8px;
  
  /* Typography - Improved readability */
  --ifm-font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --ifm-font-family-monospace: 'Monaco', 'Menlo', 'Ubuntu Mono', 'SF Mono', 'Cascadia Code', 'Roboto Mono', monospace;
  --ifm-heading-color: var(--text-primary);
  --ifm-link-color: var(--text-info);
  --ifm-link-hover-color: var(--text-accent);
  
  /* Font sizes - Better hierarchy */
  --ifm-font-size-base: 16px;
  --ifm-line-height-base: 1.7;
  --ifm-heading-line-height: 1.3;
  --ifm-h1-font-size: 2.25rem;
  --ifm-h2-font-size: 1.75rem;
  --ifm-h3-font-size: 1.4rem;
  --ifm-h4-font-size: 1.2rem;
  --ifm-h5-font-size: 1.1rem;
  --ifm-h6-font-size: 1rem;
  
  /* Improved spacing */
  --ifm-paragraph-margin-bottom: 1.25rem;
  --ifm-heading-margin-top: 2rem;
  --ifm-heading-margin-bottom: 1rem;
}

/* Force dark mode always */
[data-theme='light'] {
  --ifm-color-primary: #00d4aa;
  --ifm-color-primary-dark: #00c299;
  --ifm-color-primary-darker: #00b88f;
  --ifm-color-primary-darkest: #009973;
  --ifm-color-primary-light: #1addbb;
  --ifm-color-primary-lighter: #26e1c5;
  --ifm-color-primary-lightest: #4de6d2;
  
  --ifm-background-color: var(--bg-primary);
  --ifm-background-surface-color: var(--bg-secondary);
  --ifm-color-content-secondary: var(--text-secondary);
  --ifm-color-content: var(--text-primary);
  --ifm-navbar-background-color: var(--bg-secondary);
  --ifm-navbar-link-color: var(--text-primary);
  --ifm-navbar-link-hover-color: var(--text-accent);
  --ifm-footer-background-color: var(--bg-secondary);
  --ifm-footer-color: var(--text-secondary);
  --ifm-code-background: var(--bg-tertiary);
  --ifm-code-color: var(--text-primary);
  --ifm-pre-background: var(--bg-tertiary);
  --ifm-pre-color: var(--text-primary);
  --ifm-color-emphasis-200: var(--border-primary);
  --ifm-color-emphasis-300: var(--border-primary);
  --ifm-color-emphasis-400: var(--border-secondary);
  --ifm-hr-background-color: var(--border-primary);
  --ifm-card-background-color: var(--bg-secondary);
  --ifm-heading-color: var(--text-primary);
  --ifm-link-color: var(--text-info);
  --ifm-link-hover-color: var(--text-accent);
  --docusaurus-highlighted-code-line-bg: rgba(0, 212, 170, 0.1);
}

[data-theme='dark'] {
  --ifm-color-primary: #00d4aa;
  --ifm-color-primary-dark: #00c299;
  --ifm-color-primary-darker: #00b88f;
  --ifm-color-primary-darkest: #009973;
  --ifm-color-primary-light: #1addbb;
  --ifm-color-primary-lighter: #26e1c5;
  --ifm-color-primary-lightest: #4de6d2;
  --docusaurus-highlighted-code-line-bg: rgba(0, 212, 170, 0.1);
}

/* Global terminal styling */
html[data-theme='light'], 
html[data-theme='dark'] {
  background: var(--bg-primary);
  color: var(--text-primary);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-size: var(--ifm-font-size-base) !important;
  line-height: var(--ifm-line-height-base) !important;
}

/* Navbar customization */
.navbar {
  background: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-primary);
  box-shadow: 0 1px 0 var(--border-primary);
}

.navbar__brand {
  color: var(--text-accent) !important;
  font-weight: normal;
}

.navbar__link {
  color: var(--text-primary) !important;
  transition: color 0.2s ease;
}

.navbar__link:hover {
  color: var(--text-accent) !important;
}

.navbar__link--active {
  color: var(--text-accent) !important;
}

/* Sidebar customization */
.theme-doc-sidebar-container {
  background: var(--bg-secondary) !important;
  border-right: 1px solid var(--border-primary);
}

.theme-doc-sidebar-item-link {
  color: var(--text-secondary) !important;
  border-radius: 6px;
  margin: 2px 0;
  transition: all 0.2s ease;
}

.theme-doc-sidebar-item-link:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

.theme-doc-sidebar-item-link--active {
  background: var(--bg-tertiary) !important;
  color: var(--text-accent) !important;
  border-left: 3px solid var(--text-accent);
}

.theme-doc-sidebar-item-category {
  margin: 8px 0;
}

.theme-doc-sidebar-item-category-level-1 > .theme-doc-sidebar-item-link {
  color: var(--text-primary) !important;
  font-weight: 500;
}

/* Main content */
.main-wrapper {
  background: var(--bg-primary) !important;
}

.theme-doc-markdown {
  background: var(--bg-primary) !important;
  max-width: 850px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Improved paragraph spacing and readability */
.theme-doc-markdown p {
  margin-bottom: 1.25rem !important;
  line-height: 1.7 !important;
  color: var(--text-primary) !important;
}

.theme-doc-markdown li {
  margin-bottom: 0.5rem !important;
  line-height: 1.6 !important;
}

.theme-doc-markdown ul, .theme-doc-markdown ol {
  padding-left: 1.5rem !important;
  margin-bottom: 1.25rem !important;
}

.theme-doc-markdown blockquote {
  border-left: 4px solid var(--text-accent);
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  color: var(--text-secondary) !important;
}

/* Headings - Improved typography hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary) !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  line-height: var(--ifm-heading-line-height) !important;
  margin-bottom: 1rem !important;
}

h1 {
  color: var(--text-accent) !important;
  border-bottom: 2px solid var(--border-primary);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem !important;
  font-size: var(--ifm-h1-font-size) !important;
  font-weight: 700 !important;
}

h2 {
  color: var(--text-accent) !important;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem !important;
  font-size: var(--ifm-h2-font-size) !important;
  position: relative;
}

h2::before {
  content: '> ';
  color: var(--text-success);
  font-family: var(--ifm-font-family-monospace);
  font-weight: bold;
  margin-right: 0.5rem;
}

h3 {
  color: var(--text-primary) !important;
  margin-top: 1.75rem;
  font-size: var(--ifm-h3-font-size) !important;
}

h3::before {
  content: '$ ';
  color: var(--text-warning);
  font-family: var(--ifm-font-family-monospace);
  font-weight: bold;
  margin-right: 0.5rem;
}

h4, h5, h6 {
  color: var(--text-primary) !important;
  margin-top: 1.5rem;
}

h4 {
  font-size: var(--ifm-h4-font-size) !important;
}

h5 {
  font-size: var(--ifm-h5-font-size) !important;
}

h6 {
  font-size: var(--ifm-h6-font-size) !important;
}

/* Code blocks */
.theme-code-block {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  margin: 1rem 0;
}

.prism-code {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

code {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-secondary);
  border-radius: 4px;
  padding: 3px 6px;
  font-family: var(--ifm-font-family-monospace) !important;
  font-size: 0.9em !important;
  font-weight: 500 !important;
}

pre {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

/* Tables */
table {
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
}

th {
  background: var(--bg-tertiary) !important;
  color: var(--text-accent) !important;
  border-bottom: 1px solid var(--border-primary);
}

td {
  border-bottom: 1px solid var(--border-secondary);
  color: var(--text-primary) !important;
}

/* Admonitions */
.theme-admonition {
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  margin: 1rem 0;
}

.theme-admonition-note {
  border-left: 4px solid var(--text-info);
}

.theme-admonition-tip {
  border-left: 4px solid var(--text-success);
}

.theme-admonition-warning {
  border-left: 4px solid var(--text-warning);
}

.theme-admonition-danger {
  border-left: 4px solid var(--text-error);
}

/* Cards */
.card {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px !important;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--text-accent) !important;
  box-shadow: 0 4px 12px var(--shadow-primary) !important;
}

/* Breadcrumbs */
.breadcrumbs {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.breadcrumbs__link {
  color: var(--text-secondary) !important;
}

.breadcrumbs__link:hover {
  color: var(--text-accent) !important;
}

.breadcrumbs__item--active .breadcrumbs__link {
  color: var(--text-primary) !important;
}

/* Footer */
.footer {
  background: var(--bg-secondary) !important;
  border-top: 1px solid var(--border-primary);
  color: var(--text-secondary) !important;
}

.footer__link-item {
  color: var(--text-secondary) !important;
}

.footer__link-item:hover {
  color: var(--text-primary) !important;
}

.footer__title {
  color: var(--text-primary) !important;
}

/* Search */
.DocSearch-Button {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 6px !important;
  color: var(--text-secondary) !important;
}

.DocSearch-Button:hover {
  background: var(--bg-primary) !important;
  border-color: var(--text-accent) !important;
  color: var(--text-primary) !important;
}

/* Pagination */
.pagination-nav__link {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
  transition: all 0.2s ease;
}

.pagination-nav__link:hover {
  background: var(--bg-tertiary) !important;
  border-color: var(--text-accent) !important;
  color: var(--text-accent) !important;
}

.pagination-nav__sublabel {
  color: var(--text-secondary) !important;
}

/* TOC */
.table-of-contents {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 1rem;
}

.table-of-contents__link {
  color: var(--text-secondary) !important;
  transition: color 0.2s ease;
}

.table-of-contents__link:hover {
  color: var(--text-primary) !important;
}

.table-of-contents__link--active {
  color: var(--text-accent) !important;
  border-left: 2px solid var(--text-accent);
  padding-left: 8px;
}

/* Toggle switch for theme (hide it since we force dark) */
.toggleButton_node_modules-\@docusaurus-theme-classic-lib-theme-ColorModeToggle-styles-module {
  display: none !important;
}

.react-toggle {
  display: none !important;
}

/* Custom terminal elements */
.terminal-prompt::before {
  content: '$ ';
  color: var(--text-success);
  font-weight: bold;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-success);
  animation: pulse 2s infinite;
  margin-right: 0.5rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Button customizations */
.button {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  color: var(--text-primary) !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}

.button:hover {
  background: var(--bg-primary) !important;
  border-color: var(--text-accent) !important;
  color: var(--text-accent) !important;
}

.button--primary {
  background: var(--text-accent) !important;
  border-color: var(--text-accent) !important;
  color: var(--bg-primary) !important;
}

.button--primary:hover {
  background: var(--text-primary) !important;
  border-color: var(--text-primary) !important;
  color: var(--bg-primary) !important;
}

/* Hero section customization */
.hero {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%) !important;
  border-bottom: 1px solid var(--border-primary);
}

.hero__title {
  color: var(--text-accent) !important;
  font-family: inherit !important;
}

.hero__subtitle {
  color: var(--text-secondary) !important;
}

/* Enhanced terminal command styling */
.terminal-command-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  font-family: var(--ifm-font-family-monospace);
}

.terminal-command-block::before {
  content: 'terminal';
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 500;
}

.terminal-command-block pre {
  margin: 0;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

/* Enhanced list styling - DISABLED to prevent double numbering */
/*
.theme-doc-markdown ul li::before {
  content: '▸';
  color: var(--text-accent);
  font-weight: bold;
  margin-right: 0.5rem;
  margin-left: -1rem;
}

.theme-doc-markdown ol {
  counter-reset: custom-counter;
}

.theme-doc-markdown ol li {
  counter-increment: custom-counter;
  position: relative;
}

.theme-doc-markdown ol li::before {
  content: counter(custom-counter) '.';
  color: var(--text-accent);
  font-weight: bold;
  margin-right: 0.5rem;
  margin-left: -1.5rem;
  font-family: var(--ifm-font-family-monospace);
}
*/

/* Basic list styling without custom numbering */
.theme-doc-markdown ul li {
  color: var(--text-primary) !important;
}

.theme-doc-markdown ol li {
  color: var(--text-primary) !important;
}

/* Status indicators for documentation */
.doc-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--ifm-font-family-monospace);
}

.doc-status--updated::before {
  content: '●';
  color: var(--text-success);
}

.doc-status--draft::before {
  content: '●';
  color: var(--text-warning);
}

.doc-status--deprecated::before {
  content: '●';
  color: var(--text-error);
}

/* Enhanced code blocks */
.theme-code-block-highlighted-line {
  background: rgba(0, 212, 170, 0.1) !important;
  border-left: 3px solid var(--text-accent);
  padding-left: 1rem !important;
  margin-left: -1rem !important;
}

/* Enhanced link styling */
.theme-doc-markdown a {
  color: var(--text-info) !important;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.theme-doc-markdown a:hover {
  color: var(--text-accent) !important;
  border-bottom-color: var(--text-accent);
}

.theme-doc-markdown a code {
  color: inherit !important;
  background: rgba(0, 212, 170, 0.1) !important;
  border-color: var(--text-info) !important;
}

/* Enhanced table styling */
.theme-doc-markdown table {
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

.theme-doc-markdown th {
  font-weight: 600 !important;
  text-align: left;
  padding: 1rem 0.75rem !important;
}

.theme-doc-markdown td {
  padding: 0.75rem !important;
  vertical-align: top;
}

.theme-doc-markdown th code,
.theme-doc-markdown td code {
  font-size: 0.85em !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar__item {
    margin: 0;
  }
  
  .theme-doc-sidebar-container {
    background: var(--bg-primary) !important;
  }
  
  .theme-doc-markdown {
    padding: 0 0.75rem;
  }
  
  .theme-doc-markdown h1 {
    font-size: 2rem !important;
  }
  
  .theme-doc-markdown h2 {
    font-size: 1.5rem !important;
  }
  
  .theme-doc-markdown h3 {
    font-size: 1.25rem !important;
  }
  
  .terminal-command-block {
    padding: 0.75rem 1rem;
    margin: 1rem 0;
  }
  
  .theme-doc-markdown table {
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Utility classes for better content presentation */
.terminal-highlight {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--text-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
  font-family: var(--ifm-font-family-monospace);
  font-size: 0.9rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.feature-item:hover {
  border-color: var(--text-accent);
  box-shadow: 0 4px 12px var(--shadow-primary);
}

.feature-item h4 {
  color: var(--text-accent) !important;
  margin-top: 0 !important;
  margin-bottom: 0.75rem !important;
}

.feature-item h4::before {
  content: '◆ ';
  color: var(--text-success);
  margin-right: 0.5rem;
}

/* Enhanced focus states for accessibility */
.theme-doc-markdown a:focus,
.button:focus,
.navbar__link:focus {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Improved contrast for better readability */
.theme-doc-markdown strong {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

.theme-doc-markdown em {
  color: var(--text-accent) !important;
  font-style: normal;
  font-weight: 500;
}

/* Better spacing for content sections */
.theme-doc-markdown > * + * {
  margin-top: 1.5rem;
}

.theme-doc-markdown > h1 + *,
.theme-doc-markdown > h2 + *,
.theme-doc-markdown > h3 + *,
.theme-doc-markdown > h4 + *,
.theme-doc-markdown > h5 + *,
.theme-doc-markdown > h6 + * {
  margin-top: 1rem;
}

/* Terminal prompt styling for command examples */
.terminal-prompt {
  display: block;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-family: var(--ifm-font-family-monospace);
  position: relative;
}

.terminal-prompt::before {
  content: '$ ';
  color: var(--text-success);
  font-weight: bold;
}

.terminal-prompt code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: var(--text-primary) !important;
}
