/* --- Global Reset & Typography --- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background-color: #fafafa;
  color: #222;
}

/* --- Top Bar --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: #111;
}

.brand-logo {
  height: 32px;
  width: auto;
  vertical-align: middle;
}

.brand span {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 1.32rem;
  font-weight: 650;
  letter-spacing: .4px;
  text-transform: uppercase;
  display:inline-block;
  color:#0c0c0c;
  text-decoration:none;
  transition: all .22s ease;
}

.brand span:hover {
  transform: translateY(-1px) scale(1.02);
  color:#0045ff;
  text-shadow: 0 0 6px rgba(0,68,255,.35);
}
.brand a {
  text-decoration:none;
  color:inherit;
}
.brand a:hover {
  text-decoration:none;
}
/* --- Topbar language dropdown --- */
.topbar-language-dropdown {
  position: relative;
  display: inline-block;
  font-family: Arial, sans-serif;
}

.topbar-language-dropdown {
  position: relative; /* MUST contain both button and menu */
  display: inline-block;
}

.lang-button {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

/* dropdown menu hidden by default */
.lang-menu {
  position: absolute;
  top: 100%;      /* exactly below the button */
  left: 0;
  background: #2563eb;
  border-radius: 6px;
  min-width: 180px;
  margin: 0;      /* remove gaps */
  padding: 0.25rem 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
}

/* Show menu when hovering the container */
.topbar-language-dropdown:hover .lang-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* menu items */
.lang-menu li {
  list-style: none;
}

.lang-menu li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}

.lang-menu li a:hover {
  background: #2563eb;
}

/* normalize flag sizes */
.lang-menu img.lang-flag {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}


.menu-toggle {
  font-size: 1.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}
.menu-toggle:hover {
  background: #f2f2f2;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 56px; /* below topbar */
  left: 0;
  width: 260px;
  height: calc(100vh - 56px);
  background-color: #fff;
  border-right: 1px solid #e5e5e5;
  overflow-y: auto;            /* independent scroll */
  overflow-x: hidden;
  transition: transform 0.3s ease;
  z-index: 999;
  scrollbar-width: thin;
  scrollbar-color: #bbb #f1f1f1;
  z-index: 2000;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

/* collapsed on mobile */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
  }
}

/* --- Menu Structure --- */
.menu {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.menu-section {
  border-bottom: 1px solid #f0f0f0;
}

.menu-header {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-weight: 600;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: #333;
  transition: background 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu-header:hover {
  background: #f7f7f7;
}

/* --- Expand/Collapse Arrows --- */
.menu-header::after {
  content: "▼";
  font-size: 0.8rem;
  color: #888;
  transition: transform 0.3s ease;
}
.menu-section:not(.expanded) .menu-header::after {
  transform: rotate(-90deg);
}

/* --- Submenu Links --- */
.submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem 0;
  display: none;
/*  max-height: 0;
  overflow: hidden; */
  transition: max-height 240ms ease; 
}

.menu-section.expanded .submenu {
  display: block;
}
.submenu li a {
  display: block;
  padding: 0.45rem 1.75rem;
  text-decoration: none;
  color: #444;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.submenu li a:hover {
  background-color: #f0f0f0;
  color: #000;
}
.submenu li a.active {
  background-color: #e8f0fe;
  font-weight: 600;
}

/* --- Reset and normalize spacing for main content --- */
.content p,
.content ol,
.content ul,
.content blockquote,
.content h1,
.content h2,
.content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;  /* uniform, tighter spacing */
}
/* --- Main Content Area --- */
.content {
  margin-left: 260px;
  padding: 80px 1.5rem 2rem;
  max-width: 1100px;
}
/* --- Main Content Adjustments for Mobile --- */
.content p {
  line-height: 1.55; 
  margin: 0 0 0.5rem 0; 
  font-size: 1rem; 	
}
/* --- Adjust ordered lists in main content --- */
.content ol {
  margin-top: 0;       /* remove extra gap above first <li> */
  margin-bottom: 1rem; /* spacing below the list */
  padding-left: 1.75rem; /* standard indent */
}

.content ol li {
  line-height: 1.6; /* comfortable spacing within <li> */
  margin-bottom: 0.65rem; /* spacing between <li> items */
}

/* Optional: remove extra space if preceding <p> adds too much */
.content p + ol {
  margin-top: 0.15rem;
}

@media (max-width: 768px) {
  .content {
    margin-left: 0;
    padding: 80px 1rem 2rem;
  }
}
@media (min-width: 769px) {
  .menu-toggle {
    display:none;
  }
}
/* Responsive tweaks for phones */
@media (max-width: 480px) {
  .content {
    padding: 80px 0.75rem 2rem;
  }
  .content p {
    font-size: 1.05rem; /* slightly larger for readability on small screens */
    margin-bottom: 0.85rem; /* reduce vertical gap a bit */
  }
  .content h1, .content h2, .content h3 {
    font-size: 1.25rem; /* adjust headers slightly smaller for small screens */
  }
}

/* --- Footer --- */
.pagefooter {
  border-top: 1px solid #eee;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}
.pagefooter a {
  color: #0366d6;
  text-decoration: none;
}
.pagefooter a:hover {
  text-decoration: underline;
}

/* --- Utility Elements --- */
h1, h2, h3 {
  color: #111;
  font-weight: 600;
}
a {
  color: #0645ad;
}
a:hover {
  color: #0b0080;
}

.tblpic {
  margin: 1.5rem 0 1.5rem 0;
  display:flex;
  justify-content:flex-start;
  padding-left: 8px; /* nice subtle */
}

.video-promo {
  display:flex;
  align-items:center;
  gap:16px;
  padding:18px 22px;
  border-radius:16px;
  background: rgba(255,255,255,0.65);
  border:1px solid rgba(0,0,0,0.07);
  box-shadow:0 4px 14px rgba(0,0,0,0.08);
  backdrop-filter: blur(7px);
  transition: all .27s ease;
  text-decoration:none;
  color:#111;
}

.video-promo:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:0 8px 22px rgba(0,0,0,0.14);
  border-color:rgba(0,0,0,0.18);
}

.video-promo img {
  width:200px;
  height:auto;
  border-radius:12px;
}

.video-info {
  display:flex;
  flex-direction:column;
}

.video-title {
  font-size:1.25rem;
  font-weight:700;
  margin-bottom:4px;
}

.video-meta {
  font-size:0.9rem;
  color:#666;
}

.contentsPanel {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  font-size: 1rem;
  line-height: 1.65;
  transition: box-shadow 0.3s ease-in-out;
}

.contentsPanel:hover {
  box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

.contentsHeader {
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  color: #111827;
}

.contentsPanel > ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.contentsPanel > ul > li {
  position: relative;
  padding-left: 3rem; /* space for top-level badge */
  margin-bottom: 0.8rem;
  line-height: 1.45;
  transition: background 0.2s ease;
}

.contentsPanel > ul > li > span {
  position: absolute;
  left: 0;
  top: 0;
  background: #2563eb;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.contentsPanel > ul > li > b {
  display: inline;
  margin-bottom: 0.4rem;
  color: #111827;
}

.contentsPanel a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contentsPanel a:hover {
  color: #1d4ed8;
  text-decoration: underline; /* modern, no movement */
}

/* Nested lists just indent text, no badges */
.contentsPanel li ul {
  list-style: none;
  padding-left: 1rem;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.contentsPanel li ul li {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.35rem;
  padding-left: 0;
}

.contentsPanel li ul li > span {
  display: inline-block;
  background: #2593fb;  
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  margin-right: 0.5rem; /* <-- adds space between number and link text */
}
.contentsPanel li:hover {
  background-color: rgba(37, 99, 235, 0.05); /* subtle hover */
}

/* Modern blockquote styling */
.content blockquote,
.contentsPanel blockquote {
  position: relative;
  padding: 0.75rem 1rem;
  margin: 0rem 2rem 0.5rem 2rem; 
  border-left: 4px solid #2563eb; /* stylish blue accent */
  background-color: rgba(37, 99, 235, 0.05); /* subtle background */
  color: #111827;
  font-style: normal;
  font-size: 1.02rem;
  line-height: 1.55;
  border-radius: 8px;
  transition: background 0.2s ease;
}

ol + blockquote {
  margin-top: 0rem; /* smaller than the default */
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .content blockquote,
  .contentsPanel blockquote {
    background-color: rgba(96, 165, 250, 0.1);
    border-left-color: #60a5fa;
    color: #f3f4f6;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .contentsPanel { font-size: 1.05rem; line-height: 1.7; padding: 1rem; margin: 1rem 0; }
  .contentsPanel > ul > li { margin-bottom: 0.75rem; }
  .contentsPanel li ul li { font-size: 1rem; line-height: 1.65; }
}

@media (max-width: 480px) {
  .contentsHeader { font-size: 1.3rem; line-height: 1.75; }
  .contentsPanel > ul > li > span { font-size: 0.75rem; padding: 0.15rem 0.5rem; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .contentsPanel { background: #1f2937; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
  .contentsHeader { color: #f9fafb; }
  .contentsPanel > ul > li > b { color: #f3f4f6; }
  .contentsPanel a { color: #60a5fa; }
  .contentsPanel a:hover { color: #3b82f6; }
  .contentsPanel > ul > li > span { background: #3b82f6; }
}

.pagefooter {
  margin-top: 2rem;
  padding: 1.5rem 1rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 0.875rem;
  color: #4b5563;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: background 0.3s ease, color 0.3s ease;
}

.pagefooter a {
  color: #2563eb;
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.pagefooter a:hover {
  color: #1d4ed8;
  transform: translateY(-1px);
}

.footerlinks {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .pagefooter {
    background: #111827;
    color: #d1d5db;
    border-top-color: #374151;
    box-shadow: 0 2px 12px rgba(0,0,0,0.6);
  }
  .pagefooter a {
    color: #60a5fa;
  }
  .pagefooter a:hover {
    color: #3b82f6;
  }
}

.bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111827;
  color: #f9fafb;
  display: flex;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
  z-index: 1000;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center; /* centers everything horizontally */
  justify-content: center;
  text-align: center;
  z-index: 1000;
}

.bottombar-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bottombar {
}

.bottombar-section.social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* center the icons */
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.bottombar-section.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  padding: 0.25rem;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.bottombar-section.social a:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.bottombar-section.social svg {
  width: 24px;
  height: 24px;
  display: block;
  color: currentColor;
}

/* Responsive: stack on small screens */
@media (max-width: 640px) {
  .bottombar {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .bottombar-section.social {
    justify-content: center;
  }
}

/* Light mode support */
@media (prefers-color-scheme: light) {
  .bottombar {
    background: #f9fafb;
    color: #111827;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  }
  .bottombar-section.social a:hover {
    background: rgba(0,0,0,0.05);
  }
}

/* --- Normalize paragraph spacing across content panels and main content --- */
.content p,
.contentsPanel p,
.video-info p,
.tblpic p {
  margin-top: 0;
  margin-bottom: 0.75rem;  /* tighter spacing */
  line-height: 1.55;
}

/* Optional: tighten spacing after headings */
.content h1, .content h2, .content h3,
.contentsPanel h1, .contentsPanel h2, .contentsPanel h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;   /* tighter gap after headings */
}

/* Nested lists spacing */
.contentsPanel li, .contentsPanel li ul li {
  margin-bottom: 0.35rem;
}

/* --- Top Bar / Tabs Container --- */
.mainsection {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;  /* smaller vertical padding */
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tabs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* --- Buttons & Search unified --- */
.tabButton,
#simpleSearch button {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 6px;
  border: none;
  color: #fff;
  background-color: #2563eb;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.2;
  text-decoration: none; /* remove underline */
}

/* Subtle hover effect */
.tabButton:hover,
#simpleSearch button:hover {
  background-color: #1e40af; /* slightly darker blue */
  box-shadow: 0 2px 6px rgba(0,0,0,0.15); /* subtle lift */
  color: #fff; /* keep text white */
  transform: none; /* remove shift effect */
}

/* Active tab */
.tabButton.active {
  background-color: #10b981;
  color: #fff;
}

/* --- Search input styling --- */
#simpleSearch input[type="text"] {
  padding: 0.35rem 0.5rem;
  font-size: 0.92rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-right: 0.25rem;
}

/* --- Dark mode --- */
@media (prefers-color-scheme: dark) {
  .tabButton,
  #simpleSearch button {
    background-color: #3b82f6;
    color: #f9fafb;
  }
  .tabButton:hover,
  #simpleSearch button:hover {
    background-color: #2563eb;
  }
  #simpleSearch input[type="text"] {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #f3f4f6;
  }
}

/* --- Responsive for mobile --- */
@media (max-width: 640px) {
  .tabs {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .tabs ul {
    justify-content: center;
  }
  #simpleSearch input[type="text"] {
    width: 100%;
    margin-bottom: 0.25rem;
  }
}
@media (max-width: 768px) {
  /* Hide the left buttons */
  .tabs > ul.tabsRight {
    display: none !important;
  }

  /* Make the search take full width */
  .tabs > ul.tabsRight form#simpleSearch {
    display: flex;
    gap: 0.25rem;
    width: 100%;
  }

  .tabs > ul.tabsLeft form#simpleSearch input[type="text"] {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    box-sizing: border-box;
  }

  .tabs > ul.tabsLeft form#simpleSearch button {
    padding: 0.45rem 0.75rem;
  }
}

