/* --- Base & Typography --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #1a1a1a;
}

/* --- Layout --- */

.navbar {
  background-color: #111;
  background-image: 
    linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0.9)),
    url("/static/IBTM-Color_page-0001.jpg");
  background-size: cover;
  background-position: center center;
  border-bottom: 1px solid #2a2a2a;
}

.sidebar, .offcanvas-start {
  position: sticky;
  top: 56px; 
  height: calc(100vh - 56px);
  overflow-y: auto;
  background-color: #111;
  background-image: 
    linear-gradient(rgba(10, 10, 10, 0.9), rgba(10, 10, 10, 0.95)),
    url("/static/IBTM-Color_page-0001.jpg");
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  border-right: 1px solid #2a2a2a;
}

.offcanvas-start {
  height: 100vh;
  top: 0;
  background-attachment: scroll;
}

.main-content {
  height: calc(100vh - 56px);
  overflow-y: auto;
}

/* --- Header Banner (index.html) --- */
.header-banner {
  background: url("/static/IBTM-Color_page-0001.jpg") center center / cover no-repeat;
  min-height: 40vh;
  position: relative;
  border: 1px solid #2a2a2a;
}

.header-banner .overlay {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Collapsible Sidebar --- */
.collapsible-sidebar-heading {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 0.75rem !important; /* Added padding for highlighter */
  cursor: pointer;
  display: flex !important;
  justify-content: space-between;
  align-items: center;

  /* --- NEW: Highlighter Styles --- */
  background-color: rgba(0, 204, 102, 0.1); /* Green "highlighter" */
  border-bottom: 1px solid rgba(0, 204, 102, 0.2);
  margin-top: 8px; /* Space between groups */
}

/* New style to remove top margin from the first group */
.category-group:first-child .collapsible-sidebar-heading {
  margin-top: 0;
}

/* --- REMOVED this block to hide the arrow icon --- */
/*
.collapsible-sidebar-heading::after {
  /* Bootstrap chevron icon */
  content: '\F282'; 
  font-family: 'bootstrap-icons';
  transition: transform 0.2s ease-in-out;
  font-size: 0.8rem;
}
*/

/* --- REMOVED this block as it's no longer needed --- */
/*
.collapsible-sidebar-heading[aria-expanded="false"]::after {
  transform: rotate(-90deg);
}
*/

.sidebar .nav-item .nav-link, 
.offcanvas-body .nav-item .nav-link {
  padding-left: 1.5rem !important;
}

/* --- Sidebar Navigation (Main Links) --- */
.sidebar .nav-link, .offcanvas-body .nav-link {
  color: #adb5bd !important;
  border-radius: 0.375rem;
  margin-bottom: 4px;
  transition: all 0.2s ease-in-out;
  font-weight: 500;
  background-color: transparent; 
}

.sidebar .nav-link:hover, .offcanvas-body .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(0, 204, 102, 0.15);
  transform: translateX(4px);
}

.sidebar .nav-link.active, .offcanvas-body .nav-link.active {
  background-color: #00cc66 !important;
  color: #000 !important;
  font-weight: 700;
  border: none;
}

/* --- FIX: Removed Floating Table of Contents --- */
/* (Styles for .floating-toc-container and .floating-toc removed) */


/* --- Main Article Styling --- */
.article-content h2,
.content-section h2 {
  font-weight: 600;
  color: #00ff88;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
  margin-top: 2.5rem;
}

.article-content h3,
.content-section h3 {
  font-weight: 600;
  color: #00cc66;
  margin-top: 2rem;
}

.article-content p, 
.content-section p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #e0e0e0;
}

.article-content a,
.content-section a {
  color: #00cc66;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed #00cc66;
  transition: all 0.2s ease;
}

.article-content a:hover,
.content-section a:hover {
  color: #00ff88;
  background-color: rgba(0, 204, 102, 0.1);
  border-bottom: 1px solid #00ff88;
}
/* Ensure lightbox-wrapped images don't get double borders */
.article-content a[href$=".png"],
.article-content a[href$=".jpg"],
.article-content a[href$=".jpeg"] {
  border-bottom: none;
  background-color: transparent;
}
.article-content a[href$=".png"]:hover,
.article-content a[href$=".jpg"]:hover,
.article-content a[href$=".jpeg"]:hover {
  opacity: 0.9;
}


.article-content img {
  border: 1px solid #333;
  cursor: zoom-in;
}

/* Blockquotes */
.article-content blockquote,
.content-section blockquote {
  border-left: 4px solid #00cc66;
  padding: 1rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 0 0.375rem 0.375rem 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: #f0f0f0;
}

/* Code blocks */
.article-content pre,
.content-section pre {
  background-color: #111;
  border: 1px solid #333;
  border-radius: 0.375rem;
  padding: 1rem;
  overflow-x: auto;
}
.article-content code,
.content-section code {
  color: #00ff88;
  background-color: rgba(0, 204, 102, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
}
.article-content pre code {
  background-color: transparent;
  padding: 0;
}

/* --- FIX: Added styling for INLINE Table of Contents --- */
.toc {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
  border-radius: 0.375rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.toc > ul {
  padding-left: 1rem;
  margin-bottom: 0;
}
.toc ul li {
  list-style-type: none;
  margin-bottom: 0.5rem;
}
.toc a {
  text-decoration: none;
  border: none;
  font-weight: 600;
}
.toc a:hover {
  border: none;
}
/* (End TOC styles) */

/* Callout Block Styling */
.callout {
  border-left: 5px solid;
  border-radius: 0.375rem;
  margin: 1.5rem 0;
  background-color: rgba(0, 0, 0, 0.2);
}
.callout-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem 0.375rem 0 0;
}
.callout-body {
  padding: 1.25rem;
}
.callout-body p:last-child {
  margin-bottom: 0;
}

/* Note Callout (Green) */
.callout-note {
  border-left-color: #00cc66;
}
.callout-note .callout-header {
  color: #00ff88;
  border-bottom-color: #00cc66;
}

/* Warning Callout (Yellow/Orange) */
.callout-warning {
  border-left-color: #ffc107;
}
.callout-warning .callout-header {
  color: #ffc107;
  border-bottom-color: #ffc107;
}

/* Tip Callout (Blue/Cyan) */
.callout-tip {
  border-left-color: #0dcaf0;
}
.callout-tip .callout-header {
  color: #0dcaf0;
  border-bottom-color: #0dcaf0;
}


/* --- Back to Top Button --- */
#toTopBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 1050;
  opacity: 0.8;
  transition: all 0.3s ease;
}

#toTopBtn:hover {
  opacity: 1;
  transform: scale(1.05);
}



