:root {
  --background: #ffffff;        /* Main background – pure white for max contrast */
  --foreground: #1a1a1a;        /* Main text – darker for better readability */
  
  --sidebar-bg: #eceff3;        /* Sidebar background – slightly brighter gray */
  --sidebar-border: #c2c4c9;    /* Sidebar border – slightly darker gray */
  --sidebar-hover-bg: #d6dae2;  /* Sidebar hover – more contrast */
  --sidebar-hover-fg: #0d0d0d;  /* Sidebar hover text – almost black */
  
  --dropdown-bg: #ffffff;       /* Dropdown background – pure white */
  --dropdown-border: #c8cbd2;   /* Dropdown border – slightly darker gray */
  --dropdown-hover-bg: #d6dae2; /* Dropdown hover – soft gray for contrast */
  --dropdown-hover-bg-light: #e1e5ec; /* Dropdown hover – soft gray for contrast */
  
  --header-bg: #ffffff;         /* Header background – white */
  --header-2-bg: #f3f4f7;       /* Secondary header background – subtle gray */
  --header-border: #b4b7be;     /* Header border – darker gray for separation */
  
  --accent-green: #52b84f;      /* Main accent – stronger, more saturated green */
  --accent-green-2: #7ed576;    /* Lighter accent – brighter for hover/secondary */
}



body {
  margin: 0;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
}

.body-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: var(--header-bg);
  color: var(--accent-green);
  font-size: 28px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 32px;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.15);
  z-index: 1002;
  letter-spacing: 1px;
}

.main-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-top: 56px;
  min-height: calc(100vh - 56px);
  box-sizing: border-box;
  overflow-x: hidden; /* prevent accidental horizontal scroll */
}


.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  height: calc(100vh - 56px);
  width: 220px;
  background-color: var(--sidebar-bg);
  /* border-right: 3px solid var(--sidebar-border); */
  padding-top: 20px;
  overflow-y: auto;
  z-index: 1001;
}

.sidebar button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 12px 20px;
  font-size: 16px;
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  border-left: 4px solid transparent;

}

.sidebar button:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--sidebar-hover-fg);
  border-left: 4px solid var(--accent-green);
  transition: all 0.15s ease-in-out;
}

.dropdown-content {
  display: none;
  background-color: var(--dropdown-bg);
  border-left: 2px solid var(--dropdown-border);
}

.dropdown-content a {
  display: block;
  padding: 8px 30px;
  text-decoration: none;
  color: var(--foreground);
  font-size: 14px;
}

.btn a {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.dropdown-content a:hover {
  background-color: var(--dropdown-hover-bg-light);
  color: var(--accent-green);
  transition: all 0.15s ease-in-out;
}


.main-content {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.content-header {
  width: 100%;
  height: 60px;
  background-color: var(--header-2-bg);
  color: var(--foreground);
  display: flex;
  align-items: center;
  padding-left: 20px;
  font-size: 24px;
  /* border-bottom: 2px solid var(--header-border); */
  /* box-shadow: 0 2px 8px 0 var(--sidebar-border, #2196f3, 0.1); */
  position: relative;
  z-index: 1;
}

.content {
  padding: 20px;
  background-color: var(--background);
  color: var(--foreground);
  flex: 1;
  margin: 0px 70px;
  font-size: 20px;
  line-height: 1.7em;
  box-sizing: border-box;
}
.content a {
  color: var(--accent-green);
  text-decoration: underline;
}
.content a:hover{
  color: var(--accent-green-2)
}
hr {
  width: 100%;
  border: none;
  border-top: 1px solid var(--header-border);
}
code {
  background-color: var(--sidebar-bg);
  padding: 2px;
  border-radius: 3px;
}

/* Responsive fixes: prevent long content from overflowing */
.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
}

.content pre {
  white-space: pre-wrap; /* allow long lines to wrap */
  word-break: break-word;
  overflow-x: auto; /* allow horizontal scroll when needed */
  background-color: var(--sidebar-bg);
  padding: 12px;
  border-radius: 4px;
}

.content code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Make sure the overall layout doesn't exceed the viewport */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Current-page dropdown styling */
.dropdown-btn.current {
  /* subtle highlight for the dropdown button itself */
  font-weight: 600;
  background-color: var(--sidebar-hover-bg);
  color: var(--sidebar-hover-fg);
  border-left: 4px solid var(--accent-green);
}

.dropdown-btn[aria-expanded="true"] {
  background-color: var(--sidebar-hover-bg);
}

/* Highlight the exact matching link inside the dropdown */
.dropdown-content a.current-link {
  background-color: var(--dropdown-hover-bg-light);
  color: var(--accent-green);
  font-weight: 700;
}

.dropdown-btn {
  transition: background-color 0.15s ease, border-left 0.15s ease;
}

/* Footer pagination (Back / Next) */
.page-footer {
  /* Stick to the bottom of the viewport, to the right of the fixed sidebar */
  position: fixed;
  left: 220px;
  right: 0;
  bottom: 0;
  /* Use the same color as page background for a cleaner, subtle footer */
  background: var(--background);
  padding: 6px 12px; /* skinnier */
  box-shadow: 0 -4px 10px rgba(0,0,0,0.04); /* more subtle */
  z-index: 1002;
  backdrop-filter: blur(0px);
}
.nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

/* Make sure page content isn't hidden behind the sticky footer */
.main-content {
  padding-bottom: 64px; /* reduced space for the skinnier footer */
}

.nav-footer .btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  background: transparent;
  color: var(--accent-green);
  text-decoration: none;
  border-radius: 0;
  font-weight: 600;
  box-shadow: none;
  transition: color 0.12s ease;
}
.nav-footer .btn:hover {
  text-decoration: underline;
  color: var(--accent-green-2);
}
/* Small screens: stack buttons vertically */
@media (max-width: 520px) {
  .nav-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-footer .btn {
    width: 100%;
    text-align: center;
  }
}

/* On very small screens (where sidebar may overlay), allow the footer to span full width */
@media (max-width: 520px) {
  .page-footer {
    left: 0;
    right: 0;
  }
}