/* =============================================================================
   ProteusJS v2.0.0 Documentation - COMPREHENSIVE STYLING
   Homepage fixes + Enhanced styling for all documentation pages
   ============================================================================= */

/* LOGO VISIBILITY FIX - HIGHEST PRIORITY */
.wy-side-nav-search {
  background: #ffffff !important;
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

.wy-side-nav-search img {
  max-width: 180px !important;
  max-height: 50px !important;
  background: #ffffff !important;
  border: 2px solid #667eea !important;
  border-radius: 6px !important;
  padding: 6px !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
  display: block !important;
  margin: 0 auto !important;
}

/* BASIC TYPOGRAPHY */
.wy-nav-content h1 {
  color: #667eea !important;
  text-align: center;
  margin-bottom: 20px;
}

.wy-nav-content h2 {
  color: #667eea !important;
  margin-top: 30px;
}

.wy-nav-content h3 {
  color: #764ba2 !important;
  margin-top: 20px;
}

/* CODE BLOCKS - COMPREHENSIVE SYNTAX HIGHLIGHTING FIX */
.highlight {
  background: #1e293b !important; /* Darker slate for better contrast */
  border: 1px solid #334155 !important;
  border-radius: 6px !important;
  margin: 16px 0 !important;
  max-height: 400px !important;
  overflow: auto !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.highlight pre {
  background: transparent !important;
  color: #e2e8f0 !important; /* Light gray text */
  padding: 16px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace !important;
}

/* Ensure all code text is light colored */
.highlight pre code,
.highlight code,
.highlight span {
  color: inherit !important;
  background: transparent !important;
}

/* Syntax highlighting colors for readability */
.highlight .k,  /* Keywords */
.highlight .kn, /* Keyword namespace */
.highlight .kp, /* Keyword pseudo */
.highlight .kr, /* Keyword reserved */
.highlight .kt { /* Keyword type */
  color: #8b5cf6 !important; /* Purple for keywords */
}

.highlight .s,  /* Strings */
.highlight .s1, /* String single */
.highlight .s2, /* String double */
.highlight .se, /* String escape */
.highlight .sh, /* String heredoc */
.highlight .si, /* String interpolation */
.highlight .sx { /* String other */
  color: #10b981 !important; /* Green for strings */
}

.highlight .c,  /* Comments */
.highlight .c1, /* Comment single */
.highlight .cm, /* Comment multiline */
.highlight .cp, /* Comment preproc */
.highlight .cs { /* Comment special */
  color: #6b7280 !important; /* Gray for comments */
  font-style: italic !important;
}

.highlight .n,  /* Names */
.highlight .na, /* Name attribute */
.highlight .nb, /* Name builtin */
.highlight .nc, /* Name class */
.highlight .nd, /* Name decorator */
.highlight .ne, /* Name exception */
.highlight .nf, /* Name function */
.highlight .ni, /* Name entity */
.highlight .nl, /* Name label */
.highlight .nn, /* Name namespace */
.highlight .no, /* Name constant */
.highlight .nt, /* Name tag */
.highlight .nv, /* Name variable */
.highlight .nx { /* Name other */
  color: #e2e8f0 !important; /* Light gray for names */
}

.highlight .m,  /* Numbers */
.highlight .mb, /* Number bin */
.highlight .mf, /* Number float */
.highlight .mh, /* Number hex */
.highlight .mi, /* Number integer */
.highlight .mo { /* Number oct */
  color: #f59e0b !important; /* Orange for numbers */
}

.highlight .o,  /* Operators */
.highlight .ow { /* Operator word */
  color: #ec4899 !important; /* Pink for operators */
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
  .wy-side-nav-search img {
    max-width: 140px !important;
    max-height: 40px !important;
  }
  
  .wy-nav-content h1 {
    font-size: 1.8rem !important;
  }
}

/* ENSURE CONTENT FLOWS PROPERLY */
.wy-nav-content {
  line-height: 1.6;
}

.wy-nav-content .section {
  max-width: 100%;
}

/* TOCTREE BASIC STYLING */
.toctree-wrapper .caption {
  font-weight: bold;
  color: #667eea !important;
  margin-bottom: 10px;
}

/* =============================================================================
   ENHANCED STYLING FOR ALL OTHER PAGES (NON-HOMEPAGE)
   ============================================================================= */

/* CSS Variables for enhanced styling */
:root {
  --proteus-primary: #667eea;
  --proteus-secondary: #764ba2;
  --proteus-accent: #f093fb;
  --proteus-gradient: linear-gradient(135deg, #667eea, #764ba2);
  --proteus-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --proteus-font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
  --proteus-gray-50: #f8fafc;
  --proteus-gray-100: #f1f5f9;
  --proteus-gray-200: #e2e8f0;
  --proteus-gray-300: #cbd5e1;
  --proteus-gray-400: #94a3b8;
  --proteus-gray-500: #64748b;
  --proteus-gray-600: #475569;
  --proteus-gray-700: #334155;
  --proteus-gray-800: #1e293b;
  --proteus-gray-900: #0f172a;
  --proteus-space-1: 0.25rem;
  --proteus-space-2: 0.5rem;
  --proteus-space-3: 0.75rem;
  --proteus-space-4: 1rem;
  --proteus-space-5: 1.25rem;
  --proteus-space-6: 1.5rem;
  --proteus-space-8: 2rem;
  --proteus-space-10: 2.5rem;
  --proteus-radius-sm: 0.25rem;
  --proteus-radius: 0.5rem;
  --proteus-radius-lg: 0.75rem;
  --proteus-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --proteus-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --proteus-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Typography */
.wy-nav-content {
  font-family: var(--proteus-font-family);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--proteus-font-family);
  font-weight: 700;
}

/* Enhanced Admonitions */
.admonition {
  border-radius: var(--proteus-radius-lg);
  border: 1px solid var(--proteus-gray-200);
  box-shadow: var(--proteus-shadow);
  margin: var(--proteus-space-6) 0;
  overflow: hidden;
  background: var(--proteus-gray-50);
}

.admonition-title {
  background: rgba(102, 126, 234, 0.1);
  color: inherit;
  padding: var(--proteus-space-4);
  margin: 0;
  font-weight: 600;
  font-family: var(--proteus-font-family);
}

.admonition.tip {
  border-left: 4px solid var(--proteus-primary);
}

.admonition.warning {
  border-left: 4px solid #f59e0b;
}

.admonition.note {
  border-left: 4px solid var(--proteus-secondary);
}

/* Enhanced Table Styling */
.wy-table-responsive {
  margin: var(--proteus-space-6) 0;
  border-radius: var(--proteus-radius-lg);
  overflow: hidden;
  box-shadow: var(--proteus-shadow);
  border: 1px solid var(--proteus-gray-200);
}

.wy-table-responsive table {
  border: none;
  background: white;
}

.wy-table-responsive table td,
.wy-table-responsive table th {
  white-space: normal;
  padding: var(--proteus-space-4);
  border-bottom: 1px solid var(--proteus-gray-200);
  font-family: var(--proteus-font-family);
}

.wy-table-responsive table th {
  background: var(--proteus-gray-50);
  font-weight: 600;
  color: var(--proteus-gray-700);
}

/* Enhanced Navigation */
.wy-menu-vertical a {
  color: var(--proteus-gray-700);
  padding: var(--proteus-space-3) var(--proteus-space-4);
  border-radius: var(--proteus-radius-sm);
  margin: var(--proteus-space-1) var(--proteus-space-2);
  transition: var(--proteus-transition);
}

.wy-menu-vertical a:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--proteus-primary);
}

.wy-menu-vertical a.current {
  background: var(--proteus-gradient);
  color: white;
  font-weight: 600;
}

/* Enhanced Buttons */
.btn-proteus {
  background: var(--proteus-gradient);
  color: white;
  border: none;
  padding: var(--proteus-space-4) var(--proteus-space-6);
  border-radius: var(--proteus-radius);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--proteus-space-2);
  font-weight: 600;
  transition: var(--proteus-transition);
  cursor: pointer;
}

.btn-proteus:hover {
  transform: translateY(-1px);
  box-shadow: var(--proteus-shadow-md);
  color: white;
  text-decoration: none;
}

/* Enhanced Lists */
ul, ol {
  margin: var(--proteus-space-4) 0;
  padding-left: var(--proteus-space-6);
}

li {
  margin-bottom: var(--proteus-space-2);
  line-height: 1.6;
}

/* Enhanced Blockquotes */
blockquote {
  border-left: 4px solid var(--proteus-primary);
  background: rgba(102, 126, 234, 0.05);
  padding: var(--proteus-space-4) var(--proteus-space-6);
  margin: var(--proteus-space-6) 0;
  border-radius: 0 var(--proteus-radius) var(--proteus-radius) 0;
  font-style: italic;
}

/* Enhanced Search */
.wy-side-nav-search input[type=text] {
  border: 2px solid var(--proteus-gray-200);
  border-radius: var(--proteus-radius);
  padding: var(--proteus-space-3) var(--proteus-space-4);
  font-family: var(--proteus-font-family);
  transition: var(--proteus-transition);
  background: var(--proteus-gray-50);
}

.wy-side-nav-search input[type=text]:focus {
  border-color: var(--proteus-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

/* Enhanced Top Navigation */
.wy-nav-top {
  background: var(--proteus-gradient);
  border-bottom: none;
  box-shadow: var(--proteus-shadow);
}

.wy-nav-top a {
  color: white !important;
  font-weight: 600;
  transition: var(--proteus-transition);
}

.wy-nav-top a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Version Badge */
.version-badge {
  background: var(--proteus-gradient);
  color: white;
  padding: var(--proteus-space-2) var(--proteus-space-4);
  border-radius: var(--proteus-radius);
  font-size: 0.8em;
  font-weight: 600;
  display: inline-block;
  margin-left: var(--proteus-space-2);
}

/* Enhanced Content Sections */
.wy-nav-content .section h2 {
  margin-top: var(--proteus-space-10);
  padding-top: var(--proteus-space-6);
  border-top: 2px solid rgba(102, 126, 234, 0.1);
  color: var(--proteus-primary) !important;
  font-size: 1.8rem;
  font-weight: 700;
}

.wy-nav-content .section h3 {
  color: var(--proteus-secondary) !important;
  margin-top: var(--proteus-space-6);
  font-size: 1.3rem;
  font-weight: 600;
}

/* Enhanced Sidebar */
.wy-nav-side {
  background: var(--proteus-gray-50);
  border-right: 1px solid var(--proteus-gray-200);
}

/* Enhanced Content Area */
.wy-nav-content-wrap {
  background: white;
}

/* Enhanced Paragraph Spacing */
.wy-nav-content .section p {
  margin-bottom: var(--proteus-space-4);
  line-height: 1.7;
}

/* Enhanced Code Inline - Ensure it doesn't conflict with code blocks */
.wy-nav-content p code,
.wy-nav-content li code,
.wy-nav-content td code,
.wy-nav-content h1 code,
.wy-nav-content h2 code,
.wy-nav-content h3 code,
.wy-nav-content h4 code,
.wy-nav-content h5 code,
.wy-nav-content h6 code {
  background: var(--proteus-gray-100) !important;
  color: var(--proteus-gray-800) !important;
  padding: 0.2em 0.4em !important;
  border-radius: var(--proteus-radius-sm) !important;
  font-family: var(--proteus-font-mono) !important;
  font-size: 0.9em !important;
  border: 1px solid var(--proteus-gray-200) !important;
}

/* Ensure code blocks override inline code styling */
.highlight code,
.highlight pre code,
.highlight span code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

/* Additional ReadTheDocs theme overrides for code blocks */
.rst-content .highlight {
  background: #1e293b !important;
}

.rst-content .highlight pre {
  color: #e2e8f0 !important;
  background: transparent !important;
}

/* Force light text in all code contexts */
.highlight *,
.rst-content .highlight *,
div[class*="highlight"] *,
pre[class*="highlight"] * {
  color: #e2e8f0 !important;
}

/* Specific overrides for common syntax elements */
.highlight .p { color: #e2e8f0 !important; } /* Punctuation */
.highlight .w { color: #e2e8f0 !important; } /* Whitespace */
.highlight .err { color: #ef4444 !important; background: transparent !important; } /* Errors */

/* Language-specific improvements */
.highlight .language-bash .nb,
.highlight .language-shell .nb {
  color: #06b6d4 !important; /* Cyan for bash builtins */
}

.highlight .language-javascript .nx,
.highlight .language-js .nx {
  color: #e2e8f0 !important; /* Light for JS variables */
}

.highlight .language-python .bp {
  color: #8b5cf6 !important; /* Purple for Python builtins */
}

.highlight .language-html .nt {
  color: #ec4899 !important; /* Pink for HTML tags */
}

.highlight .language-css .k {
  color: #06b6d4 !important; /* Cyan for CSS properties */
}

/* Final fallback - ensure no dark text on dark background */
.highlight,
.highlight pre,
.highlight code,
.rst-content .highlight,
.rst-content .highlight pre,
.rst-content .highlight code {
  color: #e2e8f0 !important;
}

/* Override any remaining dark colors */
.highlight .black,
.highlight .dark,
[class*="highlight"] .black,
[class*="highlight"] .dark {
  color: #e2e8f0 !important;
}

/* Ensure proper contrast for all text elements in code blocks */
.highlight span[style*="color:#000"],
.highlight span[style*="color:#333"],
.highlight span[style*="color:#666"],
.highlight *[style*="color:#000"],
.highlight *[style*="color:#333"],
.highlight *[style*="color:#666"] {
  color: #e2e8f0 !important;
}

/* Enhanced Links */
.wy-nav-content a {
  color: var(--proteus-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--proteus-transition);
}

.wy-nav-content a:hover {
  color: var(--proteus-secondary);
  border-bottom-color: var(--proteus-secondary);
}

/* Enhanced Footer */
.rst-footer-buttons {
  margin-top: var(--proteus-space-10);
  padding-top: var(--proteus-space-6);
  border-top: 1px solid var(--proteus-gray-200);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .wy-nav-content {
    padding: var(--proteus-space-4);
  }

  .wy-nav-side {
    width: 280px;
  }

  .wy-nav-content h1 {
    font-size: 2rem !important;
  }

  .wy-nav-content h2 {
    font-size: 1.5rem !important;
  }
}
