.selected-questions-summary .summary-total-row {
  background-color: #f5f5f5;
  border-top: 2px solid #ddd;
}

.selected-questions-summary .summary-total-row td {
  font-weight: bold;
}

/* Filter Mode Toggle Section */
.filter-choose-section {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

/* Question Type Counts Grid (Random Mode) */
.filter-row-question-type-counts {
  display: none;
}

#step-2.random_mode .filter-row-question-type-counts {
  display: flex;
}

#step-2.random_mode .filter-group-question-type {
  display: none;
}

.filter-group-question-type-counts {
  flex: 1;
}

.question-type-counts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 20px;
}

.question-type-count-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.question-type-count-label {
  font-size: 13px;
  color: #666;
  font-weight: 400;
}

.question-type-count-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  transition: border-color 0.2s ease;
}

.question-type-count-input:focus {
  outline: none;
  border-color: #8B0000;
}

.question-type-count-input::-webkit-outer-spin-button,
.question-type-count-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.question-type-count-input[type=number] {
  -moz-appearance: textfield;
}

.question-type-count-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  padding: 20px;
}

/* Hide/Show elements based on mode */
#step-2.manual_mode .random-mode-only {
  display: none;
}

#step-2.random_mode .manual-mode-only {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .question-type-counts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .question-type-counts-grid {
    grid-template-columns: 1fr;
  }

  .filter-mode-btn {
    padding: 10px 16px;
    font-size: 14px;
  }
}



/* Default message styling */
.question-list-default-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.question-list-default-message b {
  display: block;
  font-size: 18px;
  margin-bottom: 10px;
}

/* Language switching - show Chinese by default, hide English */
/* .question-content.english {
  display: none;
}

.question-content.chinese {
  display: block;
} */

/* When English mode is active (add class to parent) */
/* .lang-en .question-content.chinese {
  display: none;
}

.lang-en .question-content.english {
  display: block;
} */

/* ===== Step 3 Filter Menu Styles ===== */

.step-3-filter-menu {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step-3-menu-item {
  border-bottom: 1px solid #e0e0e0;
  background-color: #fff;
  transition: background-color 0.2s ease;
}

.step-3-menu-item:hover {
  background-color: #f9f9f9;
}

.step-3-menu-item:last-child {
  border-bottom: none;
}

/* Menu Item Header */
.step-3-menu-item-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.step-3-menu-item-drag,
.step-3-menu-question-drag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  cursor: grab;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.step-3-menu-item-drag:hover,
.step-3-menu-question-drag:hover {
  opacity: 1;
}

.step-3-menu-item-drag:active,
.step-3-menu-question-drag:active {
  cursor: grabbing;
}

.step-3-menu-item-drag svg,
.step-3-menu-question-drag svg {
  width: 16px;
  height: 16px;
}

.step-3-menu-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  line-height: 1.5;
}

.step-3-menu-item-count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background-color: #dc3545;
  color: #fff;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  padding: 0 8px;
  margin-right: auto;
}

.step-3-menu-item-delete,
.step-3-menu-question-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  border-radius: 4px;
}

.step-3-menu-item-delete:hover,
.step-3-menu-question-delete:hover {
  opacity: 1;
  background-color: #f5f5f5;
}

.step-3-menu-item-delete svg,
.step-3-menu-question-delete svg {
  width: 16px;
  height: 16px;
}

.step-3-menu-item-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.step-3-menu-item.expanded .step-3-menu-item-toggle {
  transform: rotate(180deg);
}

.step-3-menu-item-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.step-3-menu-item-toggle svg.expanded {
  transform: rotate(180deg);
}

/* Menu Item Content (Questions List) */
.step-3-menu-item-content {
  padding: 0 16px 8px 48px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.step-3-menu-item:not(.expanded) .step-3-menu-item-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.step-3-menu-question-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 12px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.step-3-menu-question-item:last-child {
  border-bottom: none;
}

.step-3-menu-question-item:hover {
  background-color: #fafafa;
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 4px;
}

.step-3-menu-question-code {
  flex: 1;
  font-size: 13px;
  color: #666;
  font-family: 'Courier New', monospace;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
  .step-3-menu-item-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .step-3-menu-item-content {
    padding-left: 40px;
  }

  .step-3-menu-item-title {
    font-size: 13px;
  }

  .step-3-menu-question-code {
    font-size: 12px;
  }
}

/* ===== Step 3 Loading Overlay Styles ===== */

#step-3-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#step-3-loading-overlay .step-3-loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: step-3-spin 1s linear infinite;
  margin-bottom: 20px;
}

#step-3-loading-overlay .step-3-loading-text {
  color: white;
  font-size: 16px;
  font-weight: bold;
}

@keyframes step-3-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ===== Step 4 Styles ===== */
.question_bank_exampaper_edit_form #step-4 .placeholder-content {
  display: flex;
  gap: 20px;
  padding: 0 20px 20px 20px;
}

.question_bank_exampaper_edit_form #step-4 .placeholder-content .step-4-Content-left {
  max-width: 400px;
  width: 100%;
}

.question_bank_exampaper_edit_form #step-4 .placeholder-content .step-4-Content-right {
  width: 100%;
}
