/* Reset and Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  color: #e0e0e0;
  background-color: #1e1e1e;
  min-height: 100vh;
}

/* Header */
.site-header {
  background-color: #101010;
  color: #ffffff;
  padding: 1rem;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  height: 80px;
  position: relative; /* For positioning context */
}

.site-logo {
  height: 60px; /* Increased from 40px to 60px - adjust this value as needed */
  position: absolute;
  left: 1rem; /* Align with sidebar padding */
  top: 50%;
  transform: translateY(-50%); /* Center vertically */
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%; /* Ensure it spans the full width */
  height: 100%; /* Match header height */
}

.site-title {
  font-size: 1.2rem;
  color: #ffffff;
  margin: 0; /* Removed default margin */
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  font-style: italic
}

/* Layout Wrapper */
body > .layout-wrapper {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Sidebar */
.sidebar-left {
  width: 300px;
  background-color: #101010;
  padding: 0,5rem;
  border-right: 1px solid #2e2e2e;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-left .home-button {
  text-decoration: none;
  color: #e0e0e0;
  display: block;
  padding: 0.25rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  margin-bottom: 0,3rem;
  transition: background-color 0.2s ease;
}

.sidebar-left .home-button:hover {
  background-color: #2e2e2e;
}

@media (max-width: 768px) {
  .sidebar-left {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #2e2e2e;
    height: auto;
  }

  .site-logo {
    position: static; /* Reset to normal flow on mobile */
    left: auto;
    top: auto;
    transform: none;
    margin-bottom: 0.5rem; /* Space below logo */
    height: 50px; /* Slightly smaller on mobile for balance - adjust as needed */
  }

  .header-content {
    flex-direction: column;
    text-align: center;
  }

  body > .layout-wrapper {
    flex-direction: column;
  }
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  min-height: 0;
  background-color: #1e1e1e;
  overflow-x: hidden;
  width: 100%;
}

.main-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Sidebar Tree */
.nav-tree {
  flex: 1;
  padding-right: 0.5rem;
  overflow-y: auto;
}

.misc-tree {
  overflow-y: auto;
}

.nav-tree-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.nav-tree-list li {
  margin: 0.25rem 0;
}

.nav-tree-list ul {
  position: relative;
  z-index: 100;
  padding-left: 1.5rem;
  margin: 0;
}

.nav-tree-list a {
  text-decoration: none;
  color: #e0e0e0;
  display: block;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease, padding-left 0.2s ease;
  line-height: 1.2;
  font-size: 1rem;
  font-weight: normal;
}

.nav-tree-list a:hover {
  padding-left: 1.8rem;
  background-color: #2e2e2e;
}

.nav-tree-list a.active {
  background-color: #40667c;
  font-weight: bold;
  color: #ffffff;
}

.folder-header {
  cursor: pointer;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  color: #e0e0e0;
  line-height: 1.2;
  font-size: 1rem;
  font-weight: bold;
}

.folder-header:hover {
  background-color: #2e2e2e;
}

.folder-header .bold-header {
  font-weight: bold !important;
}

.folder-header a {
  font-weight: inherit;
}

.folder-toggle > .folder-header {
  font-weight: bold;
  cursor: pointer;
  padding-left: 1rem;
  display: block;
  user-select: none;
  color: #e0e0e0;
  line-height: 1.2;
  font-size: 1rem;
}

.folder-toggle ul {
  margin-left: 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid #2e2e2e;
  display: block;
}

/* Bold Header for Manual Control */
.bold-header {
  font-weight: bold !important;
}

/* Miscellaneous Separator */
.toc-separator {
  margin: 1.5rem 0;
  border: none;
  height: 1px;
  background-color: #2e2e2e;
}

/* Icon Styling */
.nav-tree-list i,
.nav-tree-list img,
.nav-tree-list span svg {
  vertical-align: middle;
  height: 1em;
  width: auto;
  margin-right: 0.5rem;
}

/* Optional Scrollbar Styling */
.sidebar-left::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar-left::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.sidebar-left::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
  background-color: #4e4e4e;
  border-radius: 4px;
}