/* ==================== General Body ==================== */
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f4f8;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==================== Header ==================== */
#header {
  width: 100%;
  flex-shrink: 0;
}

/* ==================== Main Layout ==================== */
.main-layout {
  display: flex;
  flex-grow: 1;
}

#sidebar {
  width: 250px;
  flex-shrink: 0;
  overflow-y: auto;
}

/* ==================== Sidebar ==================== */
.sidebar {
  width: 100%;
  background: #00274d;
  color: white;
  padding: 20px;
  box-sizing: border-box;
  font-family: inherit;
}

.sidebar h3 {
  color: white;
  margin-top: 0;
  margin-bottom: 10px;
}

.sidebar ul {
  list-style-type: none;
  padding: 0;
}

.sidebar ul li a {
  display: block;
  padding: 10px;
  color: #c0c0c0;
  text-decoration: none;
  border-bottom: 1px solid #0056b3;
  font-family: inherit;
}

.sidebar ul li a:hover {
  background: #0056b3;
  color: white;
}

.sidebar ul li a.active {
  background: #0056b3;
  color: white;
  font-weight: bold;
}

/* ==================== Main Content ==================== */
main {
  flex-grow: 1;
  padding: 20px;
}

/* ==================== Footer ==================== */
#footer {
  flex-shrink: 0;
}

/* ==================== Content Box ==================== */
.content-box {
  background-color: #ffffff;
  border: 1px solid #99c2ff;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: visible; /* Changed from hidden to visible to show nav buttons */
}

.content-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #0056b3, #3399ff);
  border-radius: 12px 0 0 12px;
}

.content-box h2 {
  color: #003366;
  border-bottom: 3px solid #0056b3;
  padding-bottom: 12px;
  margin-top: 0;
  margin-bottom: 22px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.content-box p,
.content-box ul,
.content-box ol {
  color: #1a1a1a;
  line-height: 1.75;
  font-size: 16px;
}

.content-box ul,
.content-box ol {
  padding-left: 28px;
}

.content-box li {
  margin-bottom: 12px;
}

.content-box:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-3px);
}

/* ==================== Highlight Box ==================== */
.highlight-box {
  background-color: #e6f2ff;
  border-left: 5px solid #0056b3;
  padding: 15px;
  margin: 20px 0;
  border-radius: 5px;
  font-size: 15px;
  color: #003366;
}

/* ==================== Table Styling ==================== */
table {
  width: 100%;
  max-width: 500px; /* keeps tables narrow on larger screens */
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 15px;
}

th, td {
  border: 1px solid #0056b3;
  padding: 8px 10px;
  text-align: center;
}

th {
  background-color: #e6f2ff;
  font-weight: bold;
}

td {
  background-color: #ffffff;
}

/* Mobile optimization for tables */
@media (max-width: 600px) {
  table {
    font-size: 13px;
    max-width: 100%;
  }

  th, td {
    padding: 6px;
  }
}

/* ==================== Navigation Buttons ==================== */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 25px; /* Space from last content */
}

.nav-btn {
  background: linear-gradient(90deg, #0056b3, #3399ff);
  color: white;
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
}

.nav-btn:hover {
  background: linear-gradient(90deg, #003366, #66b3ff);
  transform: translateY(-2px);
}

/* ==================== Mobile Optimization ==================== */
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column; /* Stack sidebar above main content */
  }

  #sidebar {
    width: 100%; /* Full width on mobile */
    height: auto; /* Let it expand naturally */
    order: -1; /* Move sidebar above main content */
    padding: 15px;
  }

  main {
    padding: 15px; /* Reduce padding for small screens */
  }

  .content-box {
    padding: 18px; /* Slightly smaller padding for readability */
  }

  .content-box h2 {
    font-size: 1.4rem; /* Reduce heading size */
    padding-bottom: 10px;
  }

  .content-box p,
  .content-box ul,
  .content-box ol {
    font-size: 15px; /* Slightly smaller text */
  }

  .content-box ul,
  .content-box ol {
    padding-left: 20px;
  }

  .nav-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px; /* Space between buttons */
  }

  .nav-btn {
    width: 100%; /* Full width buttons for easy tapping */
    text-align: center;
    padding: 12px 0;
  }

  #header, #footer {
    padding: 10px 15px; /* Adjust header/footer padding */
  }
}

/* ==================== Content Box Images ==================== */
.content-box img {
  width: 100%;       /* fills the container on small screens */
  max-width: 400px;  /* limits width on desktop */
  height: auto;      /* maintains aspect ratio */
  display: block;
  margin-top: 10px;
}
