/* ====== GLOBAL RESET & BASE STYLES ====== */
* {
  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;
}

/* ====== LAYOUT STRUCTURE ====== */
.help-container {
  display: flex;
  min-height: 100vh;
}

/* ====== SIDEBAR STYLES ====== */
.sidebar {
  width: 280px;
  background: #111111;
  border-right: 1px solid #222;
  border-bottom: 1px solid #222;
  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;
}

/* ====== MAIN CONTENT AREA ====== */
.content {
  flex: 1;
  padding: 40px 60px;
  max-width: 900px;
  min-height: calc(100vh - 200px);
  width: 100%;
  overflow-x: hidden;
}

/* ====== BREADCRUMB ====== */
.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.breadcrumb span,
.breadcrumb a {
  color: #3b82f6 !important;
  text-decoration: none;
}

.breadcrumb .current,
.breadcrumb span:last-child,
.breadcrumb strong {
  color: #ffffff !important;
  font-weight: normal;
}

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

.breadcrumb .separator {
  color: #93c5fd !important;
  margin: 0 8px;
}

/* ====== HEADINGS & TYPOGRAPHY ====== */
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;
}

/* ====== ANOVA-SPECIFIC STYLES ====== */
body.anova-page {
  background: #000000 !important;
  color: #ffffff !important;
}

.anova-container {
  width: 100%;
  max-width: none;
  background: #000000;
  border-radius: 16px;
  padding: 40px;
  margin: 0 auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.75);
  border: 1px solid #1e293b;
}

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

.anova-subtitle {
  color: #94a3b8;
  font-size: 1rem;
  margin-bottom: 30px;
}

/* ====== CALCULATION BOXES - FIXED TEXT ALIGNMENT ====== */
.calculation-box {
  background: #000000;
  border: 1px solid #334155;
  padding: 15px;
  margin: 10px 0;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  width: 100%;
  text-align: left !important; /* Force left alignment on all devices */
  display: block !important;
}

/* Important override for desktop and mobile */
.calculation-box * {
  text-align: left !important;
}

/* ====== TABLES ====== */
.table-container {
  overflow-x: auto;
  margin-bottom: 30px;
  background: #000000;
  border-radius: 10px;
  border: 2px solid #3b82f6;
  padding: 10px;
  width: 100%;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #000000;
  color: #ffffff;
  table-layout: auto;
  min-width: 0;
}

th, td {
  padding: 15px 12px;
  text-align: center;
  border: 1px solid #1e293b;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 300px;
}

.raw-data-cell {
  min-width: 200px;
  max-width: 250px;
}

/* ANOVA table specific */
.anova-table {
  background: #000000;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  border: 1px solid #1e293b;
  width: 100%;
  overflow-x: auto;
}

.anova-table table {
  width: 100%;
  min-width: 600px;
}

.anova-table th,
.anova-table td {
  padding: 12px 8px;
  font-size: 0.95em;
}

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

.test-section {
  margin-bottom: 40px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid #334155;
}

.test-title {
  font-size: 1.4rem;
  color: #3b82f6;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3b82f6;
}

.step-header {
  font-size: 1.1rem;
  font-weight: bold;
  color: #94a3b8;
  margin: 20px 0 10px;
  padding-left: 10px;
  border-left: 3px solid #3b82f6;
}

.result-box {
  background: #1e293b;
  border: 1px solid #3b82f6;
  padding: 15px;
  margin: 20px 0;
  border-radius: 8px;
  font-weight: bold;
}

.significant {
  color: #4ade80 !important;
  font-weight: bold;
}

.not-significant {
  color: #f87171 !important;
  font-weight: bold;
}

/* ====== SCROLL TO TOP BUTTON ====== */
.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;
  display: flex;
  align-items: center;
  justify-content: center;
}

.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;
  }
  
  /* FIXED: Sidebar with proper content display */
  .sidebar {
    width: 85%;
    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 !important; /* Force display on mobile */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    background: #111111;
  }
  
  /* FIXED: Ensure sidebar content is visible */
  .sidebar.show,
  .sidebar.active {
    transform: translateX(0);
    display: block !important;
  }
  
  /* FIXED: Ensure sidebar content area is visible */
  .sidebar .sidebar-nav,
  .sidebar .sidebar-header,
  .sidebar .search-box {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  .content {
    padding: 20px;
    max-width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-top: 70px;
  }
  
  /* When sidebar is open, shift and dim content */
  body.sidebar-open .content {
    transform: translateX(85%);
    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;
  }
  
  .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;
  }
  
  /* 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,
  .sidebar-overlay.active {
    display: block;
  }
  
  /* When sidebar is open, prevent body scrolling */
  body.sidebar-open {
    overflow: hidden;
  }
  
  /* ANOVA adjustments for mobile */
  .anova-container {
    padding: 20px;
    border-radius: 12px;
  }
  
  .anova-title {
    font-size: 1.8rem;
  }
  
  .anova-subtitle {
    font-size: 0.95rem;
  }
  
  th, td {
    padding: 10px 5px;
    font-size: 0.85rem;
  }
  
  .test-section {
    padding: 15px;
  }
  
  /* Re-enable horizontal scroll for tables on mobile */
  .table-container {
    overflow-x: auto;
  }
  
  table {
    min-width: 600px;
  }
  
  .anova-table table {
    min-width: 550px;
  }
  
  /* Fix scroll-to-top button on mobile */
  .scroll-top {
    bottom: 15px !important;
    right: 15px !important;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

/* ====== DESKTOP STYLES ====== */
@media (min-width: 1025px) {
  /* Hide mobile header on desktop */
  .mobile-header,
  .sidebar-overlay {
    display: none !important;
  }

  /* Add this rule or modify existing .content rule */
  .content {
    max-width: 1200px !important; /* Or whatever value you prefer */
    width: calc(100% - 280px) !important; /* Make it fill remaining space */
    padding: 40px 60px 40px 80px !important; /* Optional: adjust padding */
  }
  
  /* 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;
  }
  
  /* ADD THIS: Force calculation boxes to align left on desktop */
  .calculation-box,
  .calculation-box * {
    text-align: left !important;
    justify-content: flex-start !important;
  }
  
  /* Ensure preformatted text in calculation boxes stays left */
  .calculation-box pre {
    text-align: left !important;
    margin-left: 0 !important;
  }
    /* ADD THIS: Force calculation boxes and all their content to align left */
  .anova-container .calculation-box,
  .content .calculation-box,
  .calculation-box,
  div.calculation-box {
    text-align: left !important;
    display: block !important;
  }
  
  /* Override any inline styles on calculation boxes */
  .calculation-box[style],
  div[class*="calculation-box"] {
    text-align: left !important;
  }
  
  /* Ensure all text and elements inside are left aligned */
  .calculation-box *,
  .calculation-box strong,
  .calculation-box span,
  .calculation-box br {
    text-align: left !important;
    float: none !important;
    display: inline !important;
  }
  
  /* Reset any centering on parent elements */
  .test-section,
  .tukey-section,
  .info-box {
    text-align: left !important;
  }
  
  .test-section .calculation-box,
  .tukey-section .calculation-box,
  .info-box .calculation-box {
    text-align: left !important;
  }
}

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

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

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

.section-title.hidden,
.has-children.hidden,
.submenu.hidden {
  display: none;
}

.sidebar-nav li.hidden {
  display: none;
}

.search-active {
  background: #1f1f1f;
}

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

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

.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);
}

/* ====== TEXT SPACING ====== */
.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;
}

.content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  line-height: 1.6;
}

section {
  margin-bottom: 48px;
}

.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: 1.1rem; /* Larger text */
}

.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.3rem; /* Larger brand name */
  display: inline-block;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  color: #aaa;
  font-style: italic;
  font-size: 1.15rem; /* Larger tagline */
}

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

.footer-copyright {
  color: #666;
  font-size: 1.05rem; /* Larger copyright */
}

.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;
  font-size: 1.1rem; /* Larger stats */
}

.stat-value {
  color: #ddd;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 1.1rem; /* Larger stats */
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  font-size: 1.1rem; /* Larger links */
}

.footer-link {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 1.1rem;
  padding: 4px 0;
}

.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: 1.2rem; /* Larger cat quote */
  margin-top: 0.5rem;
}

/* 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 ====== */
.content section#table-of-contents a,
.content .breadcrumb a {
    color: #3498db;
    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;
    border-bottom-color: #3498db;
}

.content section#table-of-contents a:visited,
.content .breadcrumb a:visited {
    color: #3498db;
}

.content section#table-of-contents a:active,
.content .breadcrumb a:active {
    color: #3498db;
}

.content section h2 a,
.content section h3 a,
.content section h4 a {
    color: inherit;
    text-decoration: none;
}

.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;
}

.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;
}

/* ====== SPECIAL ELEMENTS ====== */
.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 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 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;
  }
}

/* ====== UTILITY CLASSES ====== */
.info-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

.info-box h3 {
  color: #3b82f6;
  margin-bottom: 15px;
}

.rat-data {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  font-family: 'Courier New', monospace;
}

.calculations {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  font-family: 'Courier New', monospace;
  line-height: 1.7; /* Add this - adjust as needed */
}

.formula {
  background: #000;
  border: 2px solid #3b82f6;
  padding: 15px;
  margin: 15px 0;
  border-radius: 8px;
  font-family: 'Cambria Math', serif;
  font-size: 1.1rem;
  text-align: center;
}

.highlight {
  background: rgba(59, 130, 246, 0.2) !important;
  font-weight: bold;
}

.conclusion {
  background: rgba(34, 197, 94, 0.1);
  border: 2px solid #22c55e;
  padding: 25px;
  border-radius: 12px;
  margin: 30px 0;
}

.conclusion h3 {
  color: #22c55e;
  margin-bottom: 15px;
}

/* ANOVA specific utility classes */
.pairwise-comparison {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #475569;
  padding: 15px;
  margin: 10px 0;
  border-radius: 8px;
}

.quick-check-section {
  margin-bottom: 40px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid #334155;
}


.quick-check-title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.tukey-section {
  margin-bottom: 40px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid #334155;
}

.tukey-title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.test-section {
  margin-bottom: 40px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid #334155;
}

@media (min-width: 1025px) {
  .calculation-box {
    text-align: left !important;
    display: block !important;
  }
  
  .calculation-box * {
    text-align: left !important;
  }
}

/* Force left alignment for calculation boxes - highest priority */
@media (min-width: 1025px) {
  body .anova-container .calculation-box,
  body .content .calculation-box,
  body .test-section .calculation-box,
  body div.calculation-box,
  body .calculation-box {
    text-align: left !important;
  }
  
  body .calculation-box *,
  body .calculation-box strong,
  body .calculation-box span {
    text-align: left !important;
  }
}

/*extra class to solve the calculation-boxes since this calss is not aligning to the left so we are making a new one*/
/* ====== NEW CLASS FOR LEFT-ALIGNED BOXES ====== */
.calculation-left {
  background: #000000;
  border: 1px solid #334155;
  padding: 15px;
  margin: 10px 0;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  width: 100%;
  text-align: left !important; /* Force left alignment */
  display: block !important;
}

/* Important override for desktop and mobile */
.calculation-left * {
  text-align: left !important;
}

/* Desktop specific fix */
@media (min-width: 1025px) {
  .calculation-left,
  .calculation-left * {
    text-align: left !important;
  }
}

/* PNG styling - matches GIF and video */
.png-image {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 1rem 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.png-image:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
 /*jumpscare*/
      /* JUMP SCARE OVERLAY */
    .jumpscare-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background-color: black;
      display: none;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      cursor: pointer;
      animation: jumpscareAppear 0.1s ease-out;
    }

    .jumpscare-image {
      max-width: 100%;
      max-height: 100%;
      width: auto;
      height: auto;
      object-fit: contain;
    }

    @keyframes jumpscareAppear {
      0% {
        opacity: 0;
        transform: scale(0.8);
      }
      100% {
        opacity: 1;
        transform: scale(1);
      }
    }

    @keyframes jumpscareShake {
      0%, 100% { transform: translateX(0); }
      10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
      20%, 40%, 60%, 80% { transform: translateX(10px); }
    }

    .jumpscare-active {
      animation: jumpscareShake 0.5s ease-in-out;
    }

      /* GIF styling - updated to match video */
  .gif-image {
    width: 100%;
    max-width: 800px; /* Same as video container */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 1rem 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .gif-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.3s ease;
  }

  .gif-link:hover {
    transform: scale(1.05);
  }

  .gif-link:hover .gif-image {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  }

  /* Video container */
  .video-container, .gif-container {
    margin: 2rem 0;
    max-width: 800px;
  }

  /* Video styling - matches GIF */
  .help-video {
    width: 100%;
    max-width: 800px; /* Explicit max-width */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  /* Hover effects for BOTH */
  .gif-image:hover, .help-video:hover {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  }

  .video-caption {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
    font-size: 0.9rem;
  }

  /* ============================================
   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;
}

/* FIX THE FOOTER GAP - Step 1 */
.site-footer {
  margin-top: 0 !important;
}