body, html {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background-color: #f0f0f0;
  font-family: Arial, sans-serif;
}

.main-container {
  display: flex;
  height: 100%;
}

.sidebar {
  width: 350px;
  background-color: #fff;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: margin-right 0.3s ease;
}

.sidebar.hidden {
  margin-right: -350px;
}

.toc-header {
  padding: 20px;
  border-bottom: 1px solid #ddd;
  background-color: #f8f9fa;
}

.toc-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.toc-body {
    overflow-y: auto;
    flex-grow: 1;
}

.list-group-item {
  cursor: pointer;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.list-group-item:first-child { border-top: 0; }
.list-group-item:last-child { border-bottom: 0; }

.list-group-item.active {
  background-color: #b59b77;
  color: #fff;
  border-color: #b59b77;
}

.list-group-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #343a40;
  padding: 20px;
  position: relative;
  transition: width 0.3s ease;
}

#menu-toggle-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 15px;
  cursor: pointer;
}

#menu-toggle-btn:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

#image-slider {
  width: 100%;
  height: 90%;
}

.carousel-inner {
  height: 100%;
}

/* FIX: Removed flex properties that broke the slider */
.carousel-item {
  height: 100%;
}

/* FIX: Centering the image correctly */
.carousel-item img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  /* Center the image within the carousel item */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.carousel-control-prev, .carousel-control-next { width: 5%; }

.carousel-control-prev-icon, .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.page-number-display {
  margin-top: 10px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
}