* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #111111;
  color: #e0e0e0;
  line-height: 1.6;
}


.help-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  min-width: 280px;  /* Keep a reasonable minimum */
  width:auto;
  background: #111111;
  border-right: 1px solid #222;
  border-bottom: 1px solid #222;  /* ADD THIS LINE */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #222;
}

.sidebar-header h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.version {
  color: #888;
  font-size: 0.82rem;
}

.search-box {
  padding: 16px 20px;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ddd;
  font-size: 0.92rem;
}

.search-box input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}

.sidebar-nav {
  padding: 12px 0;
}

.section-title {
  padding: 16px 20px 8px;
  color: #888;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav a {
  display: block;
  padding: 10px 20px;
  color: #ccc;
  text-decoration: none;
  font-size: 0.94rem;
  transition: all 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #1f1f1f;
  color: #fff;
}

.parent-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.parent-toggle i {
  transition: transform 0.2s;
}

.parent-toggle.active i {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  background: #0d0d0d;
}

.submenu.show {
  display: block;
}

.submenu a {
  padding-left: 40px;
  font-size: 0.91rem;
}

.content {
  flex: 1;
  padding: 40px 60px;
  max-width: 900px;
  min-height: calc(100vh - 200px); /* Adjust based on footer height */
}

.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* All breadcrumb items (including separators like ">") */
.breadcrumb span,
.breadcrumb a {
  color: #3b82f6 !important; /* Blue for links */
  text-decoration: none;
}

/* Current/last page (not a link) */
.breadcrumb .current,
.breadcrumb span:last-child,
.breadcrumb strong {
  color: #ffffff !important; /* White for current page */
  font-weight: normal;
}

/* Links hover effect */
.breadcrumb a:hover {
  text-decoration: underline !important;
  color: #60a5fa !important;
}

/* Style for separators (">", "/", etc.) */
.breadcrumb .separator {
  color: #93c5fd !important; /* Lighter blue for separators */
  margin: 0 8px;
}

h1 {
  font-size: 2.1rem;
  margin-bottom: 12px;
  color: #fff;
}

.last-updated {
  color: #777;
  font-size: 0.85rem;
  margin-bottom: 32px;
}

section {
  margin-bottom: 40px;
}

section h2 {
  font-size: 1.45rem;
  color: #ddd;
  margin: 32px 0 16px;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
}

.note {
  background: #1a1a1a;
  border-left: 4px solid #3b82f6;
  padding: 12px 16px;
  margin: 16px 0;
}

.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3b82f6;
  border: 1px solid #2563eb;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 100;
}

.scroll-top.show {
  opacity: 0.7;
  visibility: visible;
}

.scroll-top:hover {
  background: #2563eb;
  color: #fff;
  opacity: 1;
  transform: translateY(-2px);
}

/* Mobile responsive styles */
@media (max-width: 1024px) {
  .help-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    display: none; /* Hidden by default on mobile */
  }
  
  .sidebar.show {
    display: block;
  }
  
  .content {
    padding: 20px;
    max-width: 100%;
  }
  
  /* Mobile header */
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #111111;
    border-bottom: 1px solid #222;
  }
  
  .mobile-header h1 {
    font-size: 1.3rem;
    margin: 0;
  }
  
  /* Hamburger menu button */
  .hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
  }
  
  /* Overlay for mobile menu */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  /* When sidebar is open, prevent body scrolling */
  body.sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 1024px) {
  .help-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 85vw;
    max-width: 320px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1001;
    overflow-y: auto;
    padding-top: 70px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: block;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .content {
    padding: 20px;
    max-width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-top: 70px; /* Account for fixed header */
  }
  
  /* When sidebar is open, shift and dim content */
  body.sidebar-open .content {
    transform: translateX(85vw);
    opacity: 0.3;
    pointer-events: none;
  }
  
  /* Mobile header */
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #111111;
    border-bottom: 1px solid #222;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1002;
    height: 70px;
    /* ADD THIS LINE: */
    overflow: visible !important;
  }
  
  .mobile-header h1 {
    font-size: 1.3rem;
    margin: 0;
  }
  
  /* Hamburger menu button */
  .hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    z-index: 1003;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ADD OR ENSURE THESE: */
    position: relative;
    right: 0;
    flex-shrink: 0; /* Prevents button from shrinking */
  }
  /* Overlay for mobile menu */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  /* When sidebar is open, prevent body scrolling */
  body.sidebar-open {
    overflow: hidden;
  }

    /* ====== FIX ASCII LINE OVERFLOW ON MOBILE ====== */
  .sidebar .ascii-line {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    white-space: normal;
    letter-spacing: -1px;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  .sidebar .ascii-marker {
    max-width: 100%;
    overflow: hidden;
    padding: 5px 10px;
    box-sizing: border-box;
  }
  
  .sidebar .ascii-label {
    max-width: 100%;
    word-wrap: break-word;
    white-space: normal;
    padding: 0 5px;
  }
    /* ====== FIX SIDEBAR OVERFLOW & CLOSE BUTTON VISIBILITY ====== */
  .sidebar {
    overflow-x: hidden !important; /* Prevents horizontal scroll */
  }
  
  .sidebar * {
    max-width: 100% !important; /* Force all elements to fit */
  }
  
  /* Ensure the hamburger/close button is always on screen */
  .mobile-header .hamburger-btn {
    position: static !important; /* Don't let it be positioned absolutely */
    margin-left: auto; /* Push to the right */
  }
}

@media (min-width: 1025px) {
  /* Hide mobile header on desktop */
  .mobile-header,
  .sidebar-overlay {
    display: none !important;
  }
  
  /* Always show sidebar on desktop */
  .sidebar {
    display: block !important;
    position: sticky !important;
    transform: none !important;
    width: 280px !important;
    padding-top: 0 !important;
    box-shadow: none !important;
  }
  
  .content {
    margin-top: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  
  /* Reset any inline styles */
  .sidebar.show {
    transform: none !important;
  }
}
/*SEARCH*/
/* Add to the end of the existing CSS, before the media queries */

/* Search highlight styles */
.search-highlight {
  background-color: rgba(59, 130, 246, 0.3);
  padding: 1px 3px;
  border-radius: 2px;
  color: #fff;
}

/* No results message */
.no-results {
  color: #888;
  font-style: italic;
  padding: 20px;
  text-align: center;
  display: none;
}

.no-results.show {
  display: block;
}

/* Hide sections without results */
.section-title.hidden,
.has-children.hidden,
.submenu.hidden {
  display: none;
}

/* Show/hide for search results */
.sidebar-nav li.hidden {
  display: none;
}

/* Make active search results more visible */
.search-active {
  background: #1f1f1f;
}

.search-active a {
  color: #fff;
}

/* Add to the existing .search-box styles */
.search-box {
  position: relative;
  padding: 16px 20px;
}

.search-box input {
  width: 100%;
  padding: 9px 36px 9px 36px; /* Adjusted for both icons */
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ddd;
  font-size: 0.92rem;
}

/* Search icon */
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 0.9rem;
  z-index: 1;
}

/* Clear button */
.search-clear {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  padding: 4px;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  background: #333;
  color: #fff;
}

.search-clear.show {
  display: flex;
}

.parent-toggle .toggle-icon {
  transition: transform 0.2s;
}

.parent-toggle.active .toggle-icon {
  transform: rotate(180deg);
}

/* IMPROVED TEXT SPACING - Add this */
.content p {
  margin-bottom: 1.2em;
  line-height: 1.7;
}

.content h2 {
  margin: 36px 0 20px;
}

.content h3 {
  margin: 28px 0 16px;
}

.content ul,
.content ol {
  margin: 20px 0 24px 20px;
  line-height: 1.6;
}

.content li {
  margin-bottom: 8px;
}

.content table {
  margin: 24px 0;
}

.content td,
.content th {
  padding: 10px 14px;
}

/* Add spacing to blockquote */
.content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  line-height: 1.6;
}

/* More spacing between sections */
section {
  margin-bottom: 48px;
}

/* Better line spacing for all text in content */
.content {
  line-height: 1.7;
}

/* ====== FOOTER STYLES ====== */

.site-footer {
  background: #111111;
  border-top: 1px solid #222;
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
  color: #888;
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-left {
  flex: 1;
  min-width: 300px;
}

.footer-right {
  flex: 1;
  min-width: 300px;
  text-align: right;
}

.evil-math-cat {
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  color: #aaa;
  font-style: italic;
}

.footer-brand {
  margin-bottom: 1rem;
}

.footer-copyright {
  color: #666;
  font-size: 0.85rem;
}

.footer-stats {
  background: #1a1a1a;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid #222;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-label {
  color: #aaa;
  font-weight: 500;
}

.stat-value {
  color: #ddd;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.footer-link {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.9rem;
}

.footer-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.footer-cat {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #222;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.ascii-cat {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  text-align: center;
  white-space: pre;
}

.cat-quote {
  color: #888;
  font-style: italic;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Dark mode toggle animation */
#dark-mode-toggle {
  cursor: pointer;
  user-select: none;
}

/* Responsive footer */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    padding: 0 20px;
  }
  
  .footer-right {
    text-align: left;
  }
  
  .footer-links {
    align-items: flex-start;
  }
  
  .stat-item {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .site-footer {
    padding: 2rem 0 1rem;
  }
}


/* ============================================
   Link Styling for Tutorial Pages
   ============================================ */

/* Table of Contents links */
.content section#table-of-contents a,
.content .breadcrumb a {
    color: #3498db; /* Dark blue-gray instead of bright blue */
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.content section#table-of-contents a:hover,
.content .breadcrumb a:hover {
    color: #3498db; /* Nice blue on hover */
    border-bottom-color: #3498db;
}

/* Remove the awful purple/red visited link color */
.content section#table-of-contents a:visited,
.content .breadcrumb a:visited {
    color: #3498db; /* Same as unvisited */
}

.content section#table-of-contents a:active,
.content .breadcrumb a:active {
    color: #3498db; /* Slightly darker blue when clicked */
}

/* Anchor links within the content */
.content section h2 a,
.content section h3 a,
.content section h4 a {
    color: inherit; /* Use the heading color */
    text-decoration: none;
}

/* Links in concept cards and examples */
.concept-card a,
.example a,
.formula a,
.real-world-example a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px dotted #3498db;
    padding-bottom: 1px;
}

.concept-card a:hover,
.example a:hover,
.formula a:hover,
.real-world-example a:hover {
    color: #2980b9;
    border-bottom-style: solid;
}

/* Remove default link styling for table of contents numbers */
.content section#table-of-contents ol {
    list-style-type: none;
    counter-reset: item;
    padding-left: 0;
}

.content section#table-of-contents ol li {
    counter-increment: item;
    margin-bottom: 10px;
    position: relative;
    padding-left: 30px;
}

.content section#table-of-contents ol li:before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    font-weight: bold;
    color: #3498db;
}

/* Breadcrumb styling */
.breadcrumb {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.breadcrumb a {
    color: #3498db;
}

.breadcrumb a:hover {
    color: #2980b9;
}

.breadcrumb span {
    color: #2c3e50;
    font-weight: 500;
}

/* Make sure table of contents section looks good */
.content section#table-of-contents {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
}

.content section#table-of-contents h2 {
    margin-top: 0;
    color: #2c3e50;
}

/* Improve all internal anchor links */
.content a[href^="#"]:not(.parent-toggle):not(.scroll-top):not(.hamburger-btn) {
    color: #3498db;
    text-decoration: none;
    position: relative;
    padding-left: 18px;
}

.content a[href^="#"]:not(.parent-toggle):not(.scroll-top):not(.hamburger-btn):before {
    content: "🔗";
    position: absolute;
    left: 0;
    font-size: 0.8em;
    opacity: 0.7;
}

.content a[href^="#"]:not(.parent-toggle):not(.scroll-top):not(.hamburger-btn):hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Style for concept grid links */
.concept-grid a {
    color: #2c3e50;
    text-decoration: none;
}

.concept-grid a:hover {
    color: #3498db;
}

/* Make sure visited links in tables don't turn purple */
table a:visited {
    color: #3498db;
}

/* Alternative minimalist style */
.next-page-navigation {
    padding: 15px 0;
    margin: 30px 0;
    border-top: 1px solid #ecf0f1;
    border-bottom: 1px solid #ecf0f1;
}

.next-page-navigation a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 2px;
}

.next-page-navigation a:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

/*Footer text larger*/
/* Increase font sizes for better readability */
.site-footer {
  font-size: 1.1rem; /* Makes all footer text larger */
}

.footer-brand {
  font-size: 1.3rem; /* Makes the brand name larger */
}

.footer-tagline {
  font-size: 1.15rem; /* Makes the tagline larger */
}

.footer-links {
  font-size: 1.1rem; /* Makes links larger */
}

.footer-link {
  font-size: 1.1rem; /* Ensures links are larger */
  padding: 4px 0; /* Adds some spacing between links */
}

.footer-stats .stat-label,
.footer-stats .stat-value {
  font-size: 1.1rem; /* Makes stats text larger */
}

.cat-quote {
  font-size: 1.2rem; /* Makes the cat quote larger and more noticeable */
}

.footer-copyright {
  font-size: 1.05rem; /* Slightly larger copyright text */
}

/* Optional: Make the ASCII cat a bit larger */
.ascii-cat {
  font-size: 1.1rem;
  line-height: 1.2;
}

/*box plot*/
.box-plot-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 20px;
}

.box-plot-visual {
  width: 100%;
  order: 1;
}

.box-plot-svg-container {
  background-color: #111;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(108, 92, 231, 0.3);
  overflow-x: auto;
}

.box-plot-controls {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  padding: 25px;
  border-radius: 15px;
  border: 2px solid rgba(108, 92, 231, 0.3);
  order: 2;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 25px;
}

.box-plot-controls h4:first-child {
  grid-column: 1 / -1;
  margin-top: 0;
}

.box-plot-controls .slider-container {
  margin-bottom: 0;
}

.box-plot-controls .dataset-display {
  grid-column: 1 / -1;
}

/* ====== MOBILE RESPONSIVE FIXES ====== */
@media (max-width: 768px) {
  /* Prevent horizontal scroll on mobile */
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  .content {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  /* Fix scroll-to-top button - force it within viewport */
  .scroll-top {
    position: fixed !important;
    bottom: 15px !important;
    right: 15px !important;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    margin: 0 !important;
  }
  
  /* Fix box plot controls */
  .box-plot-controls {
    grid-template-columns: 1fr;
    padding: 15px;
    gap: 15px;
  }
  
  .box-plot-svg-container {
    padding: 10px;
    min-height: 200px;
  }
  
  /* Fix standard deviation boxes overflowing */
  .content div[style*="display: flex"] {
    flex-direction: column !important;
  }
  
  .content div[style*="flex: 1"] {
    flex: none !important;
    width: 100% !important;
    min-width: 100% !important;
  }
  
  /* Fix math formulas overflowing */
  .content math,
  .content math * {
    max-width: 100% !important;
    overflow-x: auto !important;
  }
  
  /* Ensure all inline styled divs respect container width */
  .content div[style*="padding"] {
    padding-left: 1em !important;
    padding-right: 1em !important;
  }
  
  /* Fix for the "Key Formulas" section */
  .content div[style*="background: #000"],
  .content div[style*="background:#000"] {
    overflow-x: auto !important;
    padding-left: 0.5em !important;
    padding-right: 0.5em !important;
  }
}

/*graphs styling*/
