#renderedLatex div {
  margin-bottom: 0.75rem;
}

#solutionText p {
  line-height: 1.6;
}

#languageToggle {
  display: none !important;
}

/* --- Question Image Styling --- */
.image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem; /* spacing between multiple images */
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.image-container img {
  max-width: 400px;
  width: auto;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid #d1d5db; /* light gray border */
}

/* Dark mode refinement (optional but recommended) */
.dark .image-container img {
  border-color: #374151;
}

/* --- Lightbox for Question Images --- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;            /* hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox-overlay.active {
  display: flex;            /* visible when active */
}

.lightbox-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 0.5rem;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  cursor: zoom-out;
  transition: transform 0.2s ease;
}

.lightbox-overlay img:hover {
  transform: scale(1.02);
}

body, input, textarea {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.answer-input {
  font-family: "DejaVu Sans", "Segoe UI Symbol", Arial, sans-serif;
}

.nav-link.active,
.mobile-link.active {
  color: #cde4ff;
  font-weight: 600;
  transition: color 0.3s ease;
}

/* --- Responsive helpers --- */
img, video { max-width: 100%; height: auto; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.container { padding-left: 1rem; padding-right: 1rem; }
.container.narrow { max-width: 800px; margin: 0 auto; }

/* === Navbar Styles === */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #cde4ff;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background-color: #fff;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.mobile-link {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.mobile-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.nav-logo {
  max-height: 48px;     /* Keeps consistent navbar height */
  width: auto;
  object-fit: contain;
  image-rendering: auto;
}

.symbol-btn {
  background-color: #e5e7eb;
  color: #1f2937;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}
.symbol-btn:hover {
  background-color: #2563eb;
  color: white;
}
.dark .symbol-btn {
  background-color: #374151;
  color: #f9fafb;
}
.dark .symbol-btn:hover {
  background-color: #2563eb;
}

#mathInput, textarea, input[type="text"] {
  font-family: 'Roboto Mono', 'DejaVu Sans Mono', 'Courier New', monospace;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
}
