/* ===== Layout wrapper ===== */

:root {
  --er-header-h: 56px;  /* tweak if you change header height */
}


.er-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Slim dark header ======================================= */

.er-header {
  background-color: #0f172a;      /* dark navy */
  color: #e5e7eb;                 /* slate-200 */
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  min-height: var(--er-header-h);
}

.er-header__inner {
  display: flex;
  align-items: center;
  padding: 0.55rem 1.5rem;
}

/* Logo */

.er-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.er-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  position: relative;
  /* Outer circle - cyan border */
  border-radius: 50%;
  border: 2px solid #38bdf8;     /* cyan accent */
  background: transparent;
}

/* Inner white circle - perfectly centered using pseudo-element */
.er-logo__mark::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #ffffff;
}

/* Center dot - perfectly centered */
.er-logo__mark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  background: #0f172a;
}

.er-logo__text {
  white-space: nowrap;
}

/* Spacer pushes header blocks to the right */

.er-header__spacer {
  flex: 1;
}

/* Right side: header region (user account menu) */

.er-header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

/* Tidy up menu output inside header region */

.er-header__right .menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.er-header__right .menu__item {
  list-style: none;
}

.er-header__right a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
}

.er-header__right a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ===== Main content & footer ================================== */

.er-main {
  flex: 1;
  display: flex;
  align-items: stretch;
  background-color: #f9fafb;
}

.er-main__inner {
  flex: 1;
  padding: 1.5rem 1.5rem 2.5rem;
}

/* Optional analysis sidebar region */
.er-analysis {
  flex: 0 0 340px;
  border-left: 1px solid #e5e7eb;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

/* Footer */

.er-footer {
  border-top: 1px solid #e5e7eb;
  background-color: #f3f4f6;
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Footer block content - horizontal layout */
.er-footer .block-content > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.er-footer .block-content > div > div:last-child {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Accessibility skip link */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: #111827;
  color: #ffffff;
  z-index: 200;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}
/* Right side: header region (user account menu etc.) */
.er-header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  font-size: 0.9rem;
}

/* Make the account menu horizontal in a single line */
.er-header__right ul.menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.er-header__right ul.menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Links inside the header */
.er-header__right a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
}

.er-header__right a:hover {
  color: #ffffff;
  text-decoration: underline;
}
/* ===== Force account menu horizontal in header ================= */

/* Remove extra spacing on the nav wrapper */
.er-header__right nav {
  margin: 0;
}

/* The UL inside the block (Bootstrap uses .nav, Drupal core sometimes .menu) */
.er-header__right nav > ul,
.er-header__right .nav,
.er-header__right .menu {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Each item */
.er-header__right .nav-item,
.er-header__right .menu__item,
.er-header__right li {
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

/* Links */
.er-header__right a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
}

.er-header__right a:hover {
  color: #ffffff;
  text-decoration: underline;
}
.er-header__hello {
  margin-right: 1rem;
  font-size: 0.9rem;
  color: #9ca3af;         /* light slate */
  white-space: nowrap;
}

/* ===== Mobile Responsive Header ================================= */

/* Tablets and below */
@media (max-width: 768px) {
  .er-header__inner {
    padding: 0.5rem 1rem;
  }
  
  .er-logo {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
  }
  
  /* Hide greeting on tablets - saves space */
  .er-header__hello {
    display: none;
  }
  
  /* Smaller account menu gap */
  .er-header__right ul.menu {
    gap: 0.75rem;
  }
}

/* Phones */
@media (max-width: 576px) {
  .er-header__inner {
    padding: 0.4rem 0.75rem;
  }
  
  /* Show only logo mark, hide text */
  .er-logo__text {
    display: none;
  }
  
  .er-logo__mark {
    width: 1.6rem;
    height: 1.6rem;
  }
  
  .er-logo__mark::before {
    width: 0.75rem;
    height: 0.75rem;
  }
  
  /* Smaller Navigate button */
  .er-header__nav .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Smaller account menu */
  .er-header__right {
    gap: 0.5rem;
    font-size: 0.8rem;
  }
  
  .er-header__right ul.menu {
    gap: 0.5rem;
  }
  
  /* Main content padding */
  .er-main__inner {
    padding: 1rem 0.75rem 1.5rem;
  }
}

/* Extra small phones */
@media (max-width: 380px) {
  .er-header__inner {
    padding: 0.35rem 0.5rem;
  }
  
  .er-header__nav .btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

/* ===== Test-Taking Page Mobile Adjustments ====================== */
@media (max-width: 576px) {
  .test-taking-page .er-header__inner {
    gap: 0.5rem;
  }
  
  .test-taking-page #timerDisplay {
    font-size: 11px !important;
    padding: 0.25rem 0.5rem !important;
  }
  
  /* Keep submit button readable but compact */
  .test-taking-page .btn-danger {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
  
  /* Make toggle bubbles button more visible */
  .test-taking-page #toggleBubbles {
    padding: 0.4rem 0.6rem;
  }
  
  /* Hide answered count on small screens to save space */
  .test-taking-page .text-white-50.small {
    display: none;
  }
}

/* Extra small phones - only then hide submit text */
@media (max-width: 380px) {
  .test-taking-page .btn-danger span {
    display: none;
  }
  
  .test-taking-page .btn-danger i {
    margin: 0 !important;
  }
}

/* ===== Question Palette (Bubble Sidebar) - Desktop ================ */
.er-bubble-sidebar {
  flex: 0 0 320px;
  width: 320px;
  max-width: 320px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
}

/* ===== Question Palette (Bubble Sidebar) - Mobile ================= */
.er-bubble-sidebar.mobile-open {
  position: fixed !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  z-index: 1050 !important;
  width: 320px !important;
  max-width: 90vw !important;
  min-width: 280px !important;
  height: 100vh !important;
  flex: none !important;
  box-shadow: -4px 0 20px rgba(0,0,0,0.4) !important;
  display: block !important;
}

/* Ensure bubble grid shows all 5 columns */
.er-bubble-sidebar #bubbleGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

/* Make close button visible on mobile */
.er-bubble-sidebar .btn-close {
  display: none;
}

.er-bubble-sidebar.mobile-open .btn-close {
  display: block !important;
  opacity: 1;
}

.sapi-did-you-mean .did-you-mean-prefix {
  color: #856404;
  font-weight: 500;
}

.sapi-did-you-mean a {
  color: #0056b3;
  font-weight: 600;
  text-decoration: underline;
  font-size: 1.1rem;
}

.sapi-did-you-mean a:hover {
  color: #003d82;
  text-decoration: none;
}

.sapi-did-you-mean .did-you-mean-suffix {
  color: #856404;
}

/* Did You Mean - Spellcheck Styling - UPDATED */
.sapi-did-you-mean {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%) !important;
  border: 2px solid #ffc107 !important;
  border-left: 5px solid #ff9800 !important;
  border-radius: 8px !important;
  padding: 15px 20px !important;
  margin: 20px 0 !important;
  font-size: 1.1rem !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.sapi-did-you-mean .did-you-mean-prefix {
  color: #856404 !important;
  font-weight: 600 !important;
}

.sapi-did-you-mean a {
  color: #0056b3 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  font-size: 1.2rem !important;
}

.sapi-did-you-mean a:hover {
  color: #003d82 !important;
}

.sapi-did-you-mean .did-you-mean-suffix {
  color: #856404 !important;
  font-weight: 600 !important;
}

.view-header {
  display: block !important;
  visibility: visible !important;
}
