
/* ============ Base styles ============ */

body {
  background: #052456 url('../img/space_bg_new.webp') repeat fixed;
  color: #1a1a1a;
  font-family: 'Inter', 'Nunito', sans-serif;
  line-height: 1.6;
  margin: 0;
}

.chobots-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.col-md-9 img {
  background-color: rgba(251, 251, 252, 0);
  border: 1px solid rgba(246, 247, 249, 0);
}

.col-md-9 {
  flex: 0 0 auto;
  width: 100%;
}

blockquote {
  padding-left: 10px;
  border-left: 4px solid #e6e6e6;
  background-color: #d7d7d796;
  padding-top: 4px;
  padding-bottom: 4px;
}

/* ============ Header and Navigation ============ */

.chobots-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(0, 0, 32, 0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
  width: 100%;
}

.logo img {
  max-width: 160px;
  height: auto;
  padding-bottom: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.site-nav li a {
  color: #ffd55a;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.site-nav li a:hover,
.site-nav li a:focus {
  color: #ffffff;
  background: rgba(255, 213, 90, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: #ffd55a;
  margin-right: 0.5rem;
}

.chobots-button-row {
  display: flex;
  /* justify-content: center; */
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 2rem auto;
  padding: 0;
  max-width: 100%;
  text-align: center;
}

.chobots-button {
  width: 100px;
  height: auto;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: transparent;
  box-shadow: none;
  display: block;
}

.chobots-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============ Content area ============ */

.content-wrapper {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  padding: 3rem 4rem;
  max-width: min(95%, 1200px);
  margin: 4rem auto;
  box-shadow:
    0 0 20px rgba(173, 216, 255, 0.2),
    0 8px 20px rgba(0, 0, 0, 0.3);
  position: relative;
}

.content-wrapper nav {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
  max-width: 300px;
}

.content-wrapper nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.content-wrapper nav li {
  margin-bottom: 0.5rem;
}

.content-wrapper nav a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(240, 240, 255, 0.7);
  color: #052456;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.content-wrapper nav a:hover,
.content-wrapper nav a:focus {
  background: #dbe8ff;
  color: #003388;
  text-decoration: none;
}

/* ============ Floating TOC Sidebar ============ */

#toc-collapse {
  opacity: 0.05;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 280px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 999;
  font-size: 0.95rem;
  transition: opacity 0.8s ease-in-out, transform 0.3s ease-in-out;
  animation: toc-entry 1s ease-out;
}

.bg-body-tertiary {
  --bs-bg-opacity: 0.1;
  background-color: rgba(var(--bs-tertiary-bg-rgb),var(--bs-bg-opacity))!important;
}

.navbar-expand-md .navbar-collapse {
  display: inline-table;
}

#toc-collapse.hidden {
  opacity: 0.1;
}

#toc-collapse:hover,
#toc-collapse:focus-within {
  opacity: 1;
  transform: scale(1.01);
}

@keyframes toc-entry {
  0%   { opacity: 0; transform: translateY(20px) rotate(-1deg); }
  50%  { transform: translateY(-4px) rotate(1deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}

#toc-collapse ul.nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

#toc-collapse .nav-item {
  margin-bottom: 0.6rem;
}

#toc-collapse .nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: #052456;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

#toc-collapse .nav-link:hover,
#toc-collapse .nav-link:focus {
  background-color: rgba(213, 231, 255, 0.6);
  color: #003388;
}

/* Hide on smaller screens and fall back to inline rendering */
@media (max-width: 1200px) {
  #toc-collapse {
    position: static;
    top: auto;
    right: auto;
    width: 100%;
    max-height: none;
    box-shadow: none;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
  }
}

/* ============ Floating Helper Box ============ */

#helper-box {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: #3399ff;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-size: 0.95rem;
  transition: opacity 0.5s ease, transform 0.3s ease;
  z-index: 9999;
  max-width: 280px;
  opacity: 1;
}

#helper-box.hidden {
  opacity: 0.1;
  pointer-events: auto;
}

#helper-box:hover,
#helper-box:focus-within {
  opacity: 1;
  transform: scale(1.02);
}

#helper-box a {
  color: #fff;
  text-decoration: underline;
}

#helper-box a:hover {
  color: #dbe8ff;
}

/* ============ Footer ============ */

.chobots-footer {
  text-align: center;
  margin: 2rem auto;
  padding: 1rem 0 2rem;
  font-size: 0.85rem;
  color: #8faecc;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-width: min(95%, 900px);
}

/* ============ Responsive behavior ============ */

@media (max-width: 768px) {
  .site-nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(0, 0, 32, 0.9);
    margin-top: 0.5rem;
    border-radius: 8px;
    padding: 0.5rem 1rem;
  }

  .site-nav ul.show {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .content-wrapper {
    padding: 2rem 1rem;
    margin: 3rem 0.5rem;
  }

  .content-wrapper nav {
    max-width: none;
    margin-bottom: 1rem;
  }

  .chobots-footer {
    max-width: none;
    margin: 1rem 0.5rem;
  }

  #helper-box {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

/* ============ Accessibility ============ */

a:focus,
button:focus {
  outline: 2px dashed #ffd55a;
  outline-offset: 2px;
}
