body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: #f0f4ff;
  color: #fff;
  background-color: #1e4ea8;

}

.container {
  display: flex;
  min-height: calc(100vh - 100px);
  overflow: hidden;
  justify-content: space-between;
}

/* ================= Header =============== */

.header-container {
  display: flex;
  overflow: hidden;
  box-sizing: border-box;
}

.header-container {
  display: flex !important;
}

.header-section {
  background-color: transparent;
  width: 100%;
  height: 70px;
  z-index: 999;
  padding: 0px;
}

.navbar-fixed-top {
  background-color: #1e4ea8;
  box-shadow: 0px 16px 28px 0px rgba(0, 0, 0, 0.05);
  height: 70px;
  border-bottom: 0;
  padding: 0;
}

.navbar {
  border: medium none;
  -moz-border-radius: 0;
  -webkit-border-radius: 0;
  -ms-border-radius: 0;
  border-radius: 0;
  margin: 0;
  position: relative;
  padding: 0;
  display: flex;
  justify-content: space-between !important;
  width: 100vw;


}



.navbar-header {
  padding: 17px 0;
}

.mainmenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}

/* Update the existing ul li styles */
.mainmenu ul li {
  background: transparent;
  margin: 0 !important;
  padding: 0px !important;
  border-radius: 5px;
  word-break: break-all;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
}

.mainmenu ul.nav>li>a {
  color: rgba(255, 255, 255, 0.9);
  font-family: "Poppins", sans-serif !important;
  display: inline-block;
  vertical-align: middle;
  padding: 0 10px;
  letter-spacing: 1px;
  font-size: 14px;
  font-weight: 500;
  text-transform: capitalize;
  line-height: 70px;
  z-index: 1;
  text-decoration: none;
}

ul.nav>li>a:hover,
ul.nav>li>a:focus,
ul.nav>li>a.active {
  background: none;
  color: #fff;
  opacity: 1;
}



/* ================= Header End =============== */
/* Sidebar */
.sidebar {
  width: 250px;
  background: #fff;
  padding: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 11111;
  color: rgba(0, 0, 0, 0.6) !important;
  border-right: 1px solid #e6eaf4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-main-content {
  flex: 1 1 auto;
  overflow-y: auto;
}

.brand {
  font-size: 25px;
  color: #333;
  font-family: "Poppins", sans-serif;
  letter-spacing: -1px;
  font-weight: 600;
  margin-left: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 25px;
  color: #fff;
  font-family: "Poppins", sans-serif;
  letter-spacing: -1px;
  font-weight: 600;
  margin-left: 13px;
}

.brand-icon {
  flex: 0 0 36px;
  padding-top: 0;
}

.brand-text {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Keep base navbar logo identical to results/base pages */
.sa-navbar .brand-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding-top: 0;
}

/* Preserve the larger icon only for the upload page mobile header */
.mobile-header .brand-icon {
  flex: 0 0 24px;
  padding-top: 0;
}

.sidebar.collapsed {
  width: 20px;
  padding: 0px 0px;
}



.sidebar-content {
  transition: opacity 0.3s ease;
  padding: 20px 16px 12px;
}

.sidebar-content h2 {
  margin-top: 0;
  margin-bottom: 16px;
  color: #1a1a2e;
  font-size: 1.05rem;
  font-weight: 700;
}

.sidebar.collapsed .sidebar-content {
  display: none;
}

/* Upload icon when collapsed */
.upload-icon-collapsed {
  display: none;
  text-align: center;
  margin-top: 100px;
  font-size: 30px;
}

.sidebar.collapsed .upload-icon-collapsed {
  display: block;
}

.upload-icon-collapsed {
  display: none !important;
}

/* Toggle button */
.toggle-btn {
  position: absolute;
  top: 10px;
  right: 0px;
  background: #fff;
  color: rgba(0, 0, 0, 0.6);
  border-radius: 0 5px 5px 0;
  padding: 8px 5px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.3s;
  z-index: 1001;
  border: 1px solid #dee2e6;
}


.sidebar.collapsed .toggle-btn {
  right: 0px;
}

.toggle-btn:hover {
  background: #15408a;
  color: white;
  border: none;
}

/* Upload box */
.upload-box {

  border: 2px dashed #ced4da;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 20px;
  overflow: hidden;
}

.selectedFileName {
  word-break: break-word;
}

#selectedFileName {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.doc-row {
  display: flex;
  align-items: flex-start;
}

.doc-main {
  margin-left: 3px;
}

.doc-name {
  color: #16356f;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.deletebtn {
  margin-top: 10px;
}

.progress {
  margin-bottom: 20px;
}

.progress-bar {
  width: 0%;
  height: 10px;
  background: #0ff32e;
  border-radius: 20px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.processing {
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    opacity: 0.85;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.85;
  }
}

.progress-fill {
  height: 100%;
  width: 80%;
  background: #1e4ea8;
  transition: width 0.3s;
}

/* Styling for the Range Input Container and Wrapper */
.range-wrapper {
  position: relative;
  padding-top: 25px;
  /* Space for the floating value */
  margin-bottom: 5px;
  margin-top: 10px;
}

.range-container {
  position: relative;
  padding: 0;
  height: 30px;
  /* Space for the track and the min/max labels below */
}

/* Current Value Display (The '14' shown above the thumb) */
span#rangeValue {
  position: absolute;
  top: 0;
  /** color: #fff; **/
  font-size: 14px;
  transform: translateX(-50%);
  /* Crucial for centering the text on the thumb */
  /* JavaScript will handle the 'left' property */
}

/* Style the Range Input Track and Thumb */
#quizRange {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #ccc;
  border-radius: 5px;
  outline: none;
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 2;
}

/* Style the track to show progress color */
#quizRange::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  height: 6px;
  background: linear-gradient(to right,
      #1e4ea8 var(--range-progress),
      #e0e0e0 var(--range-progress));
  border-radius: 5px;
}

/* Style the Thumb (the red circle/dot) */
#quizRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -5px;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #1e4ea8;
  cursor: grab;
  border: none;
  z-index: 3;
  position: relative;
}

/* Min/Max Labels at the bottom */
.range-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: absolute;
  bottom: 0;
  /* Position below the track */
  left: 0;
  /*  color: #fff; Use a subtle color */
  font-size: 14px;
}

.range-labels span:last-child {
  margin-right: -10px;
  /* Adjust right edge position if needed */
}

.range-labels span:first-child {
  margin-left: -5px;
  /* Adjust left edge position if needed */
}

.upload-box input {
  display: block;
  margin: 10px auto;
}

.small-text {
  font-size: 12px;
  opacity: 0.8;
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Uploaded-files list item styling */
.doc-list li {
  background: #eef3ff;
  margin: 5px 0;
  padding: 8px;
  border-radius: 10px;
  word-break: break-word;
  border: 1px solid #d8e3ff;

  /* New: Use Flexbox to align name and delete icon */
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.doc-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}

.doc-row .doc-select {
  margin-top: 0;
  flex: 0 0 auto;
  align-self: flex-start;
}

.doc-main {
  margin-left: 0;
  text-align: left;
}

/* Style for the Delete Icon */
.delete-file-btn {
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
  font-size: 14px;
  padding: 5px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.delete-file-btn:hover {
  color: #d9534f;
  opacity: 1;
}

.uploaded-file-item {
  background-color: transparent;
  padding: 0px;
  margin-bottom: 15px;
}

/* Ensure the file name uses available space */
.file-name {
  flex-grow: 1;
}

/* Main content */
.main {
  flex: 1;
  background: #fff;
  color: #2c65d1;
  padding: 4px 30px 30px 30px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.desktop-only {
  margin-top: -20px;
}

/* Mobile Header */
.mobile-header {
  display: none;
}

.mobile-toggle {
  font-size: 22px;
  color: #1e4ea8;
  cursor: pointer;
}

/* Cards, buttons, etc. */
/* 
.card {
  background: #1e4ea8;
  background: #eaf0ff; 
  border-radius: 15px;
  color: #eaf0ff;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

 */

.card,
.features {
  margin-bottom: 10px;
  line-height: 1.5;
}

.card label,
.features label {
  color: rgba(0, 0, 0, 0.8);
  margin-top: 10px;
}

.card h2,
.features h2 {
  color: rgba(0, 0, 0, 0.8);
  margin-bottom: 10px;

}

.features h2 {

  margin-bottom: 0px !important;
}

.range-labels,
span#rangeValue {
  color: rgba(0, 0, 0, 0.8);
}

.features {
  margin-bottom: 10px;
}


.features h2 {
  color: rgba(0, 0, 0, 0.8);
  margin-top: 10px;
}

.summary-design,
.features .summary-design,
.card .summary-design,
#answerText {
  color: black;
  border: 1px solid #dee2e6;
  padding: 15px;
  border-radius: 5px;
  line-height: 1.5;
  background-color: rgb(248, 249, 250);

}


#answerText {
  white-space: pre-wrap;
  background-color: rgb(248, 249, 250, 0.8);
  margin-bottom: 15px;

}

.result-hidden {
  display: none;
}

#viewScoresBtn {
  margin-top: 10px;

}

.generate-row,
.submit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.submit-row #submitQuizBtn,
.submit-row #export-options .exportpdf {
  margin-bottom: 0;
}

/* Issue 2 — same height, vertically centred for generate-row buttons */
.generate-row>.question-toggle-btn {
  padding: 10px 20px;
  background: #1e4ea8;
  border: 1px solid #1e4ea8;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin-bottom: 0;
}

.generate-row>.question-toggle-btn:hover {
  background: #0b5ed7;
  border-color: #0b5ed7;
}

.generate-row .btn.mybutton {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

textarea {
  width: 95%;
  border-radius: 10px;
  border: 1px solid #ccc;
  padding: 10px;
  margin: 10px 0;
  font-family: inherit;
  text-align: left;
}

textarea::placeholder {
  text-align: left;
}


.mybutton {
  color: #1e4ea8;
  border: none;
  padding: 10px 20px !important;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 10px;
}


.exportpdf,
.viewscores {
  color: white;
  border: none;
  padding: 10px 20px !important;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 10px;
  background-color: #1e4ea8;
}

.deletebtn {
  color: white;
  border: none;
  padding: 10px 20px !important;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 10px;
  background-color: #dc3545;
}

.deletebtn:hover {
  background-color: #b02a37;
  border-color: #b02a37;
}



.warning {
  color: #ff7a00;
  font-weight: 500;
  margin-top: 10px;
}

footer {
  background-color: #fff;
  display: block;
  color: #777;
  text-align: center;
  width: 100% !important;
  padding: 10px 0;
  position: static;
  z-index: auto;
}


.sidebar-nav-bottom {
  display: block;
  margin-top: auto;
  padding: 0 12px 12px;
}

.upload-sidebar-auth-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav-bottom .nav-link {
  display: flex;
  background: #eef3ff;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: #16356f;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 14px;
  margin: 0 0 6px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
  border: 1px solid #d8e3ff;
  border-radius: 10px;
}

.sidebar-nav-bottom .nav-link:hover {
  background: #dfe9ff;
  transition: all 0.3s;
}

.sidebar-nav-bottom .nav-link.is-active {
  background: #1e4ea8;
  color: #fff;
  border-color: transparent;
}

.sidebar-nav-bottom .sa-sidebar-auth {
  list-style: none;
  margin: 0;
  padding: 0;
}



.sidebar-nav-bottom .sa-sidebar-auth+.sa-sidebar-auth {
  margin-top: 6px;
}

.sidebar-nav-bottom .sa-signin-btn {
  width: 100%;
  border-radius: 10px;
  justify-content: flex-start;
  padding: 10px 14px;
  box-shadow: none;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sidebar-nav-bottom .sa-settings-btn {
  background: #eef3ff;
  color: #16356f;
  border: 1px solid #d8e3ff;
}

.sidebar-nav-bottom .sa-settings-btn:hover {
  background: #dfe9ff;
}

.sidebar-nav-bottom .sa-logout-btn {
  background: rgb(229, 198, 86);
  color: #1f1f1f;
  border: 0;
}

/* --- Hide text when collapsed --- */
.sidebar.collapsed .sidebar-nav-bottom .nav-link {
  justify-content: center;
}

.sidebar.collapsed .sidebar-nav-bottom .nav-link i {
  font-size: 20px;
}

.sidebar.collapsed .sidebar-nav-bottom .nav-link::after {
  content: "";
  /* No label when collapsed */
}

.sidebar.collapsed .sidebar-nav-bottom .nav-link span {
  display: none;
}



/* 1. Style the Upload Icon */
.upload-box .upload-icon {
  font-size: 30px;
  color: #1e4ea8;
  margin-bottom: 1px;
}

/* 2. Style the Drag and Drop Text */
.upload-box .drag-text {
  font-size: 16px;
  margin-bottom: 10px;
}

/* Drag-over visual feedback */
.upload-box {
  border: 2px dashed #1e4ea8;
  transition: background-color 0.2s, border-color 0.2s;
}

.upload-box.dragover {
  background-color: #f0f6ff;
  border-color: #1e4ea8;
}

/* 3. Hide the Native File Input */
.custom-file-input-wrapper input[type="file"] {
  /* Completely hide the default input element */
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

/* 4. Style the Custom "Browse" Button (The label triggers the hidden input) */
.custom-upload-button {
  background-color: #fff;
  /* White background for the button */
  color: #1e4ea8;
  /* Dark blue text */
  padding: 8px 25px;
  border-radius: 20px;
  /* Rounded corners */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s;
  /* Center the button */
  margin: 0 auto 10px auto;
}

.custom-upload-button:hover {
  background-color: #eee;
}

/* Optional: Ensure small-text is centered */
.small-text {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 10px;
  /* Add space below the button */
}

.custom-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(14, 23, 43, 0.48);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 9999;

  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.custom-modal.show {
  opacity: 1;
  pointer-events: auto;
}



.custom-modal-content {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 18px 20px 16px;
  border-radius: 14px;
  width: 90%;
  max-width: 420px;
  box-sizing: border-box;
  border: 1px solid #e6edf8;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.26);
  animation: modal-rise 0.22s ease;
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mymodalbutton {
  background: linear-gradient(135deg, #1f3c88, #3268d6);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 22px rgba(50, 104, 214, 0.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.mymodalbutton:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(50, 104, 214, 0.35);
}

.notification_modal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.notification_modal p {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}

.custom-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4ff;
  color: #1f3c88;
  font-size: 20px;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.custom-modal-close:hover {
  background: #1f3c88;
  color: #fff;
  transform: rotate(90deg);
}

.custom-modal-btn {
  margin-top: 10px;
}

.custom-modal-close {
  cursor: pointer;
}

.custom-modal-content #customModalMsg {
  margin: 0;
  color: #334155;
  line-height: 1.5;
  font-size: 0.95rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.custom-modal-footer {
  display: flex;
  justify-content: flex-end;
  /* aligns button to the right */
  margin-top: 14px;
}

.features .slider-label {
  opacity: .6;
  font-size: 13px;
}

/* Layout for quiz area: list left, results right on desktop; stacked on mobile */
.quiz-columns {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.quiz-results-container {
  display: none;
  /* shown when populated */
  flex-direction: column;
}

@media (max-width: 667px) {

  /* On mobile show results full-width and appear after actions (use order) */
  .quiz-columns {
    flex-direction: column;
  }

  /* On mobile make results full-width and appear after the left column (questions + actions) */
  #examSummary,
  #quiz-results {
    width: 100% !important;
    order: 3;
    margin-top: 12px;
  }

  .quiz-left {
    order: 1;
  }

  .generate-row,
  .submit-row {
    order: 2;
  }
}

.quiz-result-card {
  flex: 1;
  background: #ffffff;
  border-radius: 10px;
  padding: 15px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
}

.quiz-result-card h3 {
  margin-bottom: 10px;
  color: #2f5db3;
}

.quiz-progress-bar {
  width: 100%;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}

.quiz-progress {
  height: 100%;
}

.quiz-progress-correct {
  background: #4caf50;
}

.quiz-progress-fail {
  background: #dc2626;
}

.quiz-view-results-btn {
  display: inline-block;
  background: #2f5db3;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  margin-top: 10px;
}

.quiz-view-results-btn:hover {
  background: #244a92;
}


/* ------------------ Responsive ------------------ */
@media (max-width: 667px) {
  .sidebar-nav-bottom {
    display: block;
    position: static;
    left: 0;
    width: 100%;
    text-align: left;
    margin-top: 20px;
    padding: 0;
  }

  #sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    /* FULL screen height */
    width: 260px;
    /* your sidebar width */
    background: #fff;
    z-index: 1000;

    transform: translateX(-100%);
    transition: transform 0.3s ease;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* smooth momentum scroll on iOS */
    overscroll-behavior: contain;
  }

  #sidebar.open {
    transform: translateX(0);
  }




  .sidebar-content {
    width: 90%;
    display: contents;
    justify-content: center;
    flex-direction: column;
  }

  /* Hide the upload form in the sidebar on mobile — it lives on the main page now */
  .sidebar-main-content {
    display: none;
  }

  /* Hide the desktop toggle */
  .toggle-btn {
    display: none;
  }

  /* Mobile header replaced by sa-navbar from base.html */
  .mobile-header {
    display: none;
  }

  .mobile-header .brand {
    margin-left: 0;
    font-size: 1.05rem;
    letter-spacing: 0;
    font-weight: 700;
  }

  .mobile-toggle {
    font-size: 20px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    cursor: pointer;
  }

  .sidebar-nav-bottom .nav-link {
    border-radius: 10px;
    margin: 6px 0;
    padding: 10px 14px;
    gap: 10px;
    background: #eef3ff;
    color: #16356f;
    border: 1px solid #d8e3ff;
    font-weight: 600;
  }

  .sidebar-nav-bottom .nav-link.is-active {
    background: linear-gradient(135deg, #1f3c88, #3268d6);
    color: #fff;
    border-color: transparent;
  }

  .sidebar-nav-bottom .sa-signin-btn {
    margin: 0;
  }

  /* Optional overlay blur effect */
  .sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: white;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: -1;
  }

  /* Main content adjustments */
  .main {
    padding: 0px;
    overflow: visible;
    height: auto;
    min-height: auto;
  }

  .generate-row,
  .submit-row {
    gap: 8px;
  }

  .generate-row>button,
  .submit-row>button {
    flex: 1 1 0;
    min-width: 0;
  }

  /* Make simulation toggle and generate buttons same height */
  .generate-row>.question-toggle-btn,
  .generate-row .btn.mybutton {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 8px;
    min-height: 44px;
  }

  /* Ensure generate-row children match height and center content */
  .generate-row>* {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  /* Force generate-row controls to identical height and padding */
  .generate-row>.question-toggle-btn,
  .generate-row>.btn.mybutton {
    padding: 10px 20px;
    min-height: 44px;
    height: 44px;
    box-sizing: border-box;
  }

  .submit-row #submitQuizBtn,
  .submit-row #export-options {
    flex: 1 1 0;
    max-width: none;
  }

  .submit-row #submitQuizBtn,
  .submit-row #export-options .exportpdf {
    width: 100%;
    margin-bottom: 0;
  }

  .submit-row #export-options .exportpdf {
    display: block;
  }

  .main-section {
    padding: 20px !important;
  }

  .mymodalbutton {
    padding: 5px 10px;

    font-size: 10px;
  }






}

/* ==========================================================================
   Scroll To Top
   ========================================================================== */
#scroll-to-top {
  background-color: #1e4ea8;
  display: none;
  width: 45px;
  height: 45px;
  text-align: center;
  font-size: 14px;
  border-radius: 50%;
  line-height: 45px;
  color: #fff;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  border: 1px solid #fff;
}

#scroll-to-top:hover {
  background-color: #ff7a00;
  color: #fff;
}



/* Make the page a full-height flex column */
html,
body {
  height: 100%;
  margin: 0;
}

/* The container controls sidebar + main horizontally */
.container {
  display: flex;
  min-height: calc(100vh - 100px);
  /* Full viewport height */
  justify-content: space-between;
}

/* Make sure the main content area grows vertically to push the footer */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: rgba(0, 0, 0, 0.8);
  padding-bottom: 10px;
  min-height: calc(100vh - 74px)
}

/* The main-section grows, footer stays at bottom naturally */
.main-section {
  flex: 1;
}

/* Footer stays below all content, not fixed */
footer {
  background-color: #fff;
  color: #777;
  text-align: center;
  width: 100%;
  padding: 10px 0;
  position: relative;
  /* normal flow */
  margin-top: auto;
  /* push it to the bottom of main */
}


.marquee-container {
  width: 100%;
  overflow: hidden;

}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 18s linear infinite;
}

.marquee-track span {
  white-space: nowrap;
  padding: 15px 30px;
  font-size: 1.1rem;
  color: #2c65d1;
}

.marquee-track a {
  color: inherit;
  /* keeps the same color as text */
  text-decoration: underline;
  cursor: pointer;
}

.marquee-track a:visited {
  color: inherit;
  /* prevents purple visited color */
}

.marquee-track a:hover,
.marquee-track a:focus {
  text-decoration: underline;
  /* keep underline on hover */
}

@keyframes marquee {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(-50%);
  }
}





.answer-correct {
  border: 2px solid #28a745;
  /* Bootstrap success green */
  background-color: #e9f9ee;
  border-radius: 10px;
  padding: 8px 12px;
  display: inline-block;
  margin-top: 10px;
}

.answer-wrong {
  border: 2px solid #dc3545;
  /* Bootstrap danger red */
  background-color: #fde8e8;
  border-radius: 10px;
  padding: 8px 12px;
  display: inline-block;
  margin-top: 10px;
}


#quizList {

  border-radius: 0.75rem;
  border: 1px solid white;
  padding: 1.5rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
  margin: 0px 0px 10px 0px;
}

.list-group-item {
  border: none;
  border-bottom: 1px solid #eee;
  padding: 1rem 0;
}

.list-group-item:last-child {
  border-bottom: none;
}

/* Explanation toggle button */
/* ── Sim panel inline auth message ─────────────────────────── */
.sim-auth-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 13px;
  color: #1e40af;
  animation: authTipIn 0.18s ease;
}

.sim-auth-msg-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.sim-auth-msg-link:hover { text-decoration: underline; }
/* ─────────────────────────────────────────────────────────── */

/* ── Auth tooltip (login-gate — inline, scrolls with content) ── */
.auth-tooltip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 12px;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  animation: authTipIn 0.18s ease;
}

.auth-tooltip-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 700;
}
.auth-tooltip-link:hover { color: #93c5fd; }

@keyframes authTipIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* ─────────────────────────────────────────────────────────── */

.explanation-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2c65d1;
  background: #eef3fd;
  border: 1px solid #c5d6f7;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.explanation-toggle:hover {
  background: #d8e6fb;
  color: #1a4ab5;
}

/* Explanation panel */
.explanation-panel {
  display: none;
  margin-top: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #444;
  background: #f8f9fc;
  border-left: 3px solid #2c65d1;
  border-radius: 0 8px 8px 0;
  animation: explanation-slide-in 0.18s ease;
}

@keyframes explanation-slide-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.fw-semibold {
  font-weight: 600;
}

.form-check {
  margin-top: 0.5rem;
}

.badge {
  border-radius: 0.5rem;
  font-size: 0.85rem;

}


/**** Flash Messages *****/

.flash-container {
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Base flash style */
.flash {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease;
  color: #fff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.flash-message {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Variants (like Bootstrap: success, error, warning, info) */
.flash-success {
  background-color: #198754;
}

/* green */
.flash-error {
  background-color: #dc3545;
}

/* red */
.flash-warning {
  background-color: #ffc107;
  color: #212529;
}

/* yellow */
.flash-info {
  background-color: #0dcaf0;
  color: #212529;
}

/* light blue */

/* Close button */
.flash-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
}


.flash {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1s ease, transform 1s ease;
}

.flash.fade-out {
  opacity: 0;
  transform: translateY(-10px);
  /* slightly slide up while fading */
}

.mobile_padding {

  padding: 0 15px;
}


/* Animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* ==========================================================================
   Results page
   ========================================================================== */


.results_container {
  padding: 1rem;

}

.results_container h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}







@media (max-width: 667px) {

  .flash-container {
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
  }

  .sidebar-nav-bottom-results {

    position: static;
    margin-top: 10px;

  }

  .result_side_hidden {
    display: block !important;
  }

  .result_side_hidden {
    position: fixed;
    top: 0;
    left: -110%;
    width: 90%;
    height: 100%;
    background: #1e4ea8;
    transition: left 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 80px;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
  }

  .marquee-track {
    animation-duration: 25s;
    /* slower for readability */
  }

  .marquee-track span {
    font-size: 1rem;
  }

  /* Animation moves FULL text width */
  @keyframes marquee {
    from {
      transform: translateX(0);
    }

    to {
      transform: translateX(-50%);
    }
  }


}

/* ==========================================================================
   Feedback Modal
   ========================================================================== */


/* Make main relative so absolute modal is inside it */
#main {
  position: relative;
}

/* Backdrop inside main */
.feedback-backdrop {
  position: absolute;
  /* was fixed */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.feedback-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Modal remains the same */
.feedback-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: feedback-scale-in 0.3s ease;
}


.feedback-modal *,
.feedback-modal *::before,
.feedback-modal *::after {
  box-sizing: border-box;
}


@keyframes feedback-scale-in {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.feedback-title {
  margin: 0;
  font-size: 1.5rem;
  color: #111;
}

.feedback-subtitle {
  margin: 8px 0 20px;
  color: #555;
  font-size: 0.95rem;
}

.feedback-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.feedback-field {
  margin-bottom: 16px;
}

.feedback-select,
.feedback-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 0.95rem;
}

.feedback-textarea {
  min-height: 90px;
  resize: vertical;
}

/* Rating */
.feedback-stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 10px;
}

.feedback-stars input {
  display: none;
}

.feedback-stars label {
  font-size: 1.6rem;
  color: #ddd;
  cursor: pointer;
}

.feedback-stars input:checked~label,
.feedback-stars label:hover,
.feedback-stars label:hover~label {
  color: #f5b301;
}

/* Actions */
.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.feedback-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.feedback-cancel {
  background: #f2f2f2;
  color: #333;
}

.feedback-send {
  background: #2c65d1;
  color: #fff;
}

.feedback-send:hover {
  background: #1f4fb3;
}

.feedback-modal-flash {
  margin: 0 0 10px;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

.feedback-modal .feedback-modal-flash {
  margin: 0 0 10px !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 600px) {

  .feedback-modal {
    width: 80%;
    max-width: 320px;
    padding: 16px 20px;
    border-radius: 12px;

  }

  .feedback-select,
  .feedback-textarea {
    font-size: .7rem;
  }

  .feedback-title {
    font-size: 1.2rem;
  }

  .feedback-subtitle {
    font-size: 0.85rem;
  }

  .feedback-stars label {
    font-size: 1.6rem;
    /* smaller stars for touch */
  }

  .feedback-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .feedback-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.95rem;
  }

  .main {
    min-height: 100vh;
  }

  .fa-home:before,
  .fa-lightbulb-o:before,
  .fa-info-circle:before,
  .fa-comment:before {
    margin-right: 5px;
  }



  .fa-lightbulb-o:before {
    margin-right: 8px;
    padding-left: 2px;
    align-items: center;
  }
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  #main {
    position: relative;
    overflow-x: hidden;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
  }

  .sidebar-nav-bottom {
    display: block;
    margin-top: auto;
    /* push it to the bottom of sidebar content */
    position: static;
    /* no absolute/fixed here */
    width: 100%;
    margin-bottom: 15px;
  }

  #sidebar {
    position: fixed;
    top: 60px;
    /* height of mobile-header */
    left: 0;
    height: calc(100vh - 60px);
    width: 90vw;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }
}

/* ==========================================================================
   Question Toggle — Ask a Question collapsible
   ========================================================================== */

.question-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #1f3c88;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.question-toggle-btn .collapse-icon {
  transition: transform 0.3s ease;
  font-size: 0.85rem;
}

.question-toggle-btn[aria-expanded="true"] .collapse-icon {
  transform: rotate(180deg);
}

.question-collapse-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.question-collapse-panel.open {
  max-height: 900px;
}

/* Simulation settings styling */
.sim-settings-panel {
  border: 1px solid #e6e6e6;
  padding: 12px;
  border-radius: 8px;
  background: #fbfdff;
  max-width: 420px;
  margin-top: 5px;
}

.sim-settings-panel .sim-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-toggle-field {
  padding-bottom: 4px;
  border-bottom: 1px solid #e6edf8;
  margin-bottom: 4px;
}

.sim-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.sim-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sim-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d5def1;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.sim-toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.sim-toggle input:checked ~ .sim-toggle-slider {
  background: #1e4ea8;
}

.sim-toggle input:checked ~ .sim-toggle-slider::after {
  transform: translateX(20px);
}

.sim-toggle-state-off,
.sim-toggle-state-on {
  font-size: 0.86rem;
  font-weight: 600;
  transition: color 0.2s, font-weight 0.2s;
}

.sim-toggle-state-off {
  color: #334155;
}

.sim-toggle-state-on {
  color: #94a3b8;
}

.sim-toggle input:checked ~ .sim-toggle-state-off {
  color: #94a3b8;
  font-weight: 500;
}

.sim-toggle input:checked ~ .sim-toggle-state-on {
  color: #1e4ea8;
  font-weight: 700;
}

.simulation-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef3ff;
  border: 1px solid #d8e3ff;
}

.simulation-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e4ea8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.simulation-timer {
  font-size: 1rem;
  font-weight: 700;
  color: #16356f;
  font-variant-numeric: tabular-nums;
}

.sim-settings-panel .form-control {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  width: 140px;
}

@media (max-width: 667px) {
  .sim-settings-panel {
    max-width: 100%;
  }

  .sim-settings-panel {
    flex-direction: row;
  }

  .sim-settings-panel .sim-field {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .sim-settings-panel .form-control {
    width: 48%;
  }

  .generate-row,
  .submit-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* On mobile make quiz action buttons stack by default and be full width */
  .generate-row,
  .submit-row {
    flex-direction: column;
  }

  .generate-row .btn,
  .generate-row>.question-toggle-btn,
  .submit-row .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  /* Submit / Export row on mobile: two buttons side-by-side full width */
  .submit-row {
    flex-direction: row;
    gap: 8px;
  }

  .submit-row>* {
    flex: 1 1 0;
    min-width: 0;
  }

  /* For the generate-row, show two buttons side-by-side at half width on narrow screens */
  .generate-row {
    flex-direction: row;
    gap: 8px;
  }

  .generate-row>* {
    flex: 1 1 0;
    min-width: 0;
  }

  .generate-row>*+* {
    margin-left: 8px;
  }

  /* Reduce font size & padding of action buttons on mobile for a tighter fit */
  .generate-row .btn.mybutton,
  .generate-row>.question-toggle-btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* ==========================================================================
   Mobile-only Upload Section
   ========================================================================== */

.mobile-upload-section {
  display: none;
}

@media (max-width: 667px) {
  .mobile-upload-section {
    display: block;
    margin-bottom: 14px;
  }

  .mobile-uploaded-files-section {
    margin-bottom: 18px;
  }

  .mobile-uploaded-files-section h2 {
    margin: 0;
  }

  /* "Uploaded Files" collapsible toggle button */
  .mobile-upload-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: linear-gradient(135deg, #1f3c88, #3268d6);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-upload-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-collapse-icon {
    transition: transform 0.3s ease;
    font-size: 0.85rem;
  }

  .mobile-upload-toggle-btn[aria-expanded="true"] .mobile-collapse-icon {
    transform: rotate(180deg);
  }

  /* Collapsible panel for Uploaded Files */
  .mobile-upload-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s ease;
  }

  .mobile-upload-panel.open {
    max-height: 700px;
  }

  /* Uploaded files list in mobile panel */
  .mobile-doc-list {
    list-style: none;
    padding: 8px 0 0;
    margin: 0;
  }

  .mobile-doc-list .doc-item {
    border-bottom: 1px solid #e8edf8;
    padding: 10px 0;
  }

  .mobile-doc-list .doc-item:last-child {
    border-bottom: none;
  }

  .mobile-doc-list .doc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding-left: 18px;
    /* align with the icon in the toggle button */
  }

  .mobile-doc-list .doc-select {
    flex: 0 0 auto;
    margin: 0;
    /* remove browser default vertical offset */
    align-self: center;
  }

  .mobile-doc-list .doc-name {
    font-size: 0.88rem;
    color: #1f3c88;
    font-weight: 600;
    word-break: break-all;
    line-height: 1.3;
  }

  .mobile-no-files-msg {
    font-size: 0.88rem;
    color: #888;
    padding: 12px 0;
    text-align: center;
  }

  /* Tap-to-upload card — compact row layout */
  .mobile-upload-tap-area {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(135deg, #1f3c88, #3268d6);
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-upload-tap-area:active {
    opacity: 0.82;
  }

  .mobile-upload-big-icon {
    font-size: 1.8rem;
    color: #fff;
    flex: 0 0 auto;
  }

  .mobile-upload-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-upload-cta {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
  }

  .mobile-upload-formats {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
  }


  .mobile-selected-file-name {
    font-size: 0.85rem;
    color: #1f3c88;
    font-weight: 600;
    margin: 10px 0 0;
    text-align: center;
    word-break: break-all;
  }
}
/* Floating simulation countdown — appears bottom-right when banner is scrolled out of view */
.sim-floating-timer {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #1e4ea8;
  color: #fff;
  border-radius: 50px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.28);
  z-index: 1200;
  cursor: default;
  user-select: none;
  transition: opacity 0.2s;
}

.sim-floating-icon {
  font-size: 1.1rem;
}
