/* public/stylesheets/teacher-tools.css */

/* ============================================
   PPO TEACHER TOOLS STYLES
   Matches account/settings dashboard language
   ============================================ */

/* 1. PAGE SHELL */

.teacher-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 860px);
  gap: 1.25rem;
  max-width: 1140px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  align-items: start;
}

.teacher-main {
  min-width: 0;
}

/* 2. SIDEBAR */

.teacher-sidebar {
  background: #1a1f3d;
  color: #ffffff;
  border-radius: 0.9rem;
  padding: 1rem;
  min-height: calc(100vh - 130px);
  position: sticky;
  top: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Same spirit as .org-mini-card */
.teacher-org-card {
  margin-bottom: 0.9rem;
  padding: 0.9rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.teacher-org-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.teacher-org-icon {
  width: 42px;
  height: 42px;
  border-radius: 0.7rem;
  background: #ffffff;
  color: #1a1f3d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.teacher-org-name {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
}

.teacher-org-sub {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.teacher-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.teacher-nav a {
  color: #ffffff;
  text-decoration: none;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  font-weight: 500;
  font-size: 0.94rem;
  transition: all 0.2s ease;
}

.teacher-nav a:hover {
  background: #f3f4f6;
  color: #0b6cbd;
}

.teacher-nav a.active {
  background: linear-gradient(90deg, #4589b7 0%, #57c3a8 100%);
  color: #FBC257;
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(13, 110, 253, 0.2);
}

.teacher-sidebar-note {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.teacher-sidebar-note strong {
  display: block;
  color: #ffffff;
  font-size: 0.86rem;
  margin-bottom: 0.35rem;
}

.teacher-sidebar-note p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  line-height: 1.5;
}

.teacher-sidebar-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.teacher-sidebar-footer a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.88rem;
}

.teacher-sidebar-footer a:hover {
  color: #ffffff;
}

/* 3. HERO */

.teacher-hero {
  background: linear-gradient(90deg, #f8fbff 0%, #f8fffb 100%);
  border: 1px solid #e9eef5;
  border-radius: 0.9rem;
  padding: 1.15rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.teacher-kicker {
  margin: 0 0 0.35rem;
  color: #3a83c3;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.teacher-hero h1 {
  margin: 0;
  color: #2d4a73;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.25;
}

.teacher-hero p {
  margin: 0.45rem 0 0;
  color: #6b7280;
  max-width: 620px;
  line-height: 1.55;
  font-size: 0.94rem;
}

.teacher-hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* 4. BUTTONS */

.teacher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2rem;
  padding: 0.55rem 1.35rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.teacher-btn-primary {
  background: linear-gradient(90deg, #3a83c3 0%, #45b39d 100%);
  color: #ffffff;
}

.teacher-btn-primary:hover {
  background: linear-gradient(90deg, #356f9f 0%, #3c9c8b 100%);
  color: #ffffff;
}

.teacher-btn-outline {
  background: #ffffff;
  color: #495057;
  border: 1px solid #adb5bd;
}

.teacher-btn-outline:hover {
  background: #f1f3f5;
  color: #495057;
}

/* 5. STATS */

.teacher-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.teacher-stat-card {
  background: #ffffff;
  border: none;
  border-radius: 0.8rem;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.teacher-stat-card span {
  display: block;
  color: #6b7280;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.teacher-stat-card strong {
  display: block;
  color: #2d4a73;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

/* 6. PANELS */

.teacher-panel,
.teacher-getting-started {
  background: #ffffff;
  border: none;
  border-radius: 0.8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  margin-bottom: 1rem;
  overflow: hidden;
}

.teacher-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #f0f1f2;
}

.teacher-panel-header h2,
.teacher-getting-started h2 {
  margin: 0;
  color: #2d4a73;
  font-size: 1.05rem;
  font-weight: 700;
}

.teacher-panel-header p {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.teacher-small-link {
  font-weight: 600;
  color: #0b6cbd;
  text-decoration: none;
  font-size: 0.9rem;
}

.teacher-small-link:hover {
  text-decoration: underline;
}

/* 7. EMPTY STATES */

.teacher-empty-state {
  text-align: center;
  padding: 2.6rem 1rem;
  margin: 1rem;
  border: 1px dashed #d1d5db;
  border-radius: 0.9rem;
  background: #fafbfc;
}

.teacher-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  margin: 0 auto 0.85rem;
  background: #f8fbff;
  color: #3a83c3;
  font-size: 1.35rem;
  border: 1px solid #e9eef5;
}

.teacher-empty-state h3 {
  margin: 0;
  color: #2d4a73;
  font-weight: 700;
}

.teacher-empty-state p {
  max-width: 520px;
  margin: 0.45rem auto 1rem;
  color: #6b7280;
  line-height: 1.55;
  font-size: 0.92rem;
}

/* 8. TABLE */

.teacher-table-wrap {
  overflow-x: auto;
}

.teacher-table {
  width: 100%;
  border-collapse: collapse;
}

.teacher-table th {
  background-color: #f8f9fa;
  color: #495057;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f0f1f2;
}

.teacher-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f0f1f2;
  vertical-align: middle;
  color: #333;
  font-size: 0.92rem;
}

.teacher-table tbody tr:hover {
  background: #fafbfc;
}

.teacher-table td strong {
  display: block;
  color: #2d4a73;
  font-weight: 600;
}

.teacher-table td small {
  display: block;
  color: #6b7280;
  margin-top: 0.15rem;
  font-size: 0.78rem;
}

.teacher-table a {
  color: #0b6cbd;
  font-weight: 600;
  text-decoration: none;
}

.teacher-table a:hover {
  text-decoration: underline;
}

/* 9. BADGES & CODES */

.teacher-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.teacher-badge-draft {
  background: #f1f3f5;
  color: #495057;
}

.teacher-badge-published {
  background: rgba(69, 179, 157, 0.12);
  color: #287d70;
}

.teacher-badge-closed {
  background: #fff4f4;
  color: #b42318;
}

.teacher-code-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  background: #fffdf7;
  border: 1px solid #f3e7b8;
  color: #7b5a14;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.76rem;
}

/* 10. GETTING STARTED */

.teacher-getting-started {
  padding: 1.1rem;
}

.teacher-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.teacher-steps div {
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1rem;
  background: #fafbfc;
}

.teacher-steps span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(90deg, #3a83c3 0%, #45b39d 100%);
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.teacher-steps h3 {
  margin: 0;
  color: #2d4a73;
  font-size: 1rem;
  font-weight: 700;
}

.teacher-steps p {
  margin: 0.35rem 0 0;
  color: #6b7280;
  line-height: 1.45;
  font-size: 0.9rem;
}

/* 11. RESPONSIVE */

@media (max-width: 900px) {
  .teacher-shell {
    grid-template-columns: 1fr;
  }

  .teacher-sidebar {
    position: static;
    min-height: auto;
  }

  .teacher-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .teacher-nav a {
    text-align: center;
  }

  .teacher-sidebar-note,
  .teacher-sidebar-footer {
    display: none;
  }

  .teacher-hero {
    flex-direction: column;
  }

  .teacher-stats-grid,
  .teacher-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .teacher-shell {
    margin-top: 1rem;
    padding: 0 0.75rem;
  }

  .teacher-nav {
    grid-template-columns: 1fr;
  }

  .teacher-hero-actions {
    width: 100%;
  }

  .teacher-hero-actions .teacher-btn {
    width: 100%;
  }

  .teacher-stats-grid,
  .teacher-steps {
    grid-template-columns: 1fr;
  }

  .teacher-panel-header {
    flex-direction: column;
  }

  .teacher-table th:nth-child(3),
  .teacher-table td:nth-child(3) {
    display: none;
  }
}

/* 12. TEACHER FORM BASE */

.teacher-form {
  padding: 1.15rem;
}

.teacher-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.teacher-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.teacher-form-full {
  grid-column: 1 / -1;
}

.teacher-form-group label,
.teacher-filter-card label {
  color: #2d4a73;
  font-size: 0.84rem;
  font-weight: 700;
}

.teacher-form-group input,
.teacher-form-group select,
.teacher-form-group textarea,
.teacher-filter-card input {
  width: 100%;
  border: 1px solid #d7dde6;
  border-radius: 0.8rem;
  padding: 0.78rem 0.9rem;
  font-size: 0.94rem;
  color: #1f2937;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.teacher-form-group textarea {
  min-height: 92px;
  resize: vertical;
}

.teacher-form-group input:focus,
.teacher-form-group select:focus,
.teacher-form-group textarea:focus,
.teacher-filter-card input:focus {
  outline: none;
  border-color: #3a83c3;
  background: #fbfdff;
  box-shadow: 0 0 0 4px rgba(58, 131, 195, 0.14);
}

.teacher-form-group select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
}

/* 13. QUIZ BUILDER POLISH */

.teacher-quiz-builder {
  background: #fbfcfe;
}

.teacher-form-section {
  padding: 1.1rem;
  border: 1px solid #e6ebf2;
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.teacher-form-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #eef2f7;
}

.teacher-form-section-heading span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(90deg, #3a83c3 0%, #45b39d 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  box-shadow: 0 5px 12px rgba(58, 131, 195, 0.2);
}

.teacher-form-section-heading h3 {
  margin: 0;
  color: #2d4a73;
  font-size: 1.02rem;
  font-weight: 700;
}

.teacher-form-section-heading p {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.88rem;
  line-height: 1.45;
}

.teacher-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.teacher-filter-card {
  border: 1px solid #e6ebf2;
  border-radius: 0.9rem;
  padding: 0.95rem;
  background: #f8fbff;
}

.teacher-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.teacher-choice-card {
  position: relative;
  display: block;
  border: 1px solid #e1e7ef;
  border-radius: 1rem;
  padding: 1rem;
  background: #ffffff;
  cursor: pointer;
  min-height: 104px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.035);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.teacher-choice-card:hover {
  transform: translateY(-1px);
  border-color: #3a83c3;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.teacher-choice-card input {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  accent-color: #3a83c3;
}

.teacher-choice-card strong {
  display: block;
  color: #2d4a73;
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.teacher-choice-card span {
  display: block;
  color: #6b7280;
  font-size: 0.82rem;
  line-height: 1.35;
}

.teacher-choice-card:has(input:checked) {
  border-color: #3a83c3;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: 0 0 0 4px rgba(58, 131, 195, 0.12);
}

.teacher-time-limit-row {
  max-width: 340px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eef2f7;
}

.teacher-form-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.teacher-form-actions-sticky {
  justify-content: flex-end;
  padding: 1rem;
  margin: 0;
  border: 1px solid #e6ebf2;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

@media (max-width: 900px) {
  .teacher-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .teacher-form {
    padding: 0.85rem;
  }

  .teacher-form-grid,
  .teacher-filter-row,
  .teacher-choice-grid {
    grid-template-columns: 1fr;
  }

  .teacher-form-section {
    padding: 0.95rem;
  }

  .teacher-form-actions-sticky {
    flex-direction: column-reverse;
  }

  .teacher-form-actions-sticky .teacher-btn {
    width: 100%;
  }
}

/* ============================================
   14. TEACHER QUIZ PREVIEW
   ============================================ */

.teacher-preview-summary .teacher-panel-header {
  align-items: center;
}

.teacher-preview-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.1rem;
}

.teacher-preview-meta div {
  border: 1px solid #e9ecef;
  border-radius: 0.85rem;
  padding: 1rem;
  background: #fafbfc;
}

.teacher-preview-meta span {
  display: block;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.teacher-preview-meta strong {
  color: #2d4a73;
  font-size: 1rem;
  text-transform: capitalize;
}

.teacher-question-list {
  padding: 1.1rem;
}

.teacher-question-card {
  border: 1px solid #e6ebf2;
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.teacher-question-card:last-child {
  margin-bottom: 0;
}

.teacher-question-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #eef2f7;
  margin-bottom: 1rem;
}

.teacher-question-number {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: #f8fbff;
  border: 1px solid #e9eef5;
  color: #3a83c3;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.teacher-question-card h3 {
  margin: 0;
  color: #2d4a73;
  font-size: 1rem;
  line-height: 1.45;
}

.teacher-answer-pill {
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(69, 179, 157, 0.12);
  color: #287d70;
  font-size: 0.8rem;
  font-weight: 700;
}

.teacher-question-image-wrap {
  margin-bottom: 1rem;
}

.teacher-question-image {
  max-width: 100%;
  border-radius: 0.85rem;
  border: 1px solid #e6ebf2;
  background: #ffffff;
}

.teacher-question-statements {
  border: 1px solid #e6ebf2;
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  background: #fafbfc;
  margin-bottom: 1rem;
}

.teacher-question-statements p {
  margin: 0 0 0.4rem;
  color: #374151;
  line-height: 1.5;
}

.teacher-question-statements p:last-child {
  margin-bottom: 0;
}

.teacher-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.teacher-option {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  border: 1px solid #e6ebf2;
  border-radius: 0.85rem;
  padding: 0.85rem;
  background: #ffffff;
}

.teacher-option span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f1f3f5;
  color: #495057;
  font-weight: 700;
  flex-shrink: 0;
}

.teacher-option p {
  margin: 0;
  color: #374151;
  line-height: 1.45;
}

.teacher-option-correct {
  border-color: rgba(69, 179, 157, 0.45);
  background: #f8fffb;
}

.teacher-option-correct span {
  background: linear-gradient(90deg, #3a83c3 0%, #45b39d 100%);
  color: #ffffff;
}

.teacher-explanation-box {
  border-left: 4px solid #45b39d;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fffb;
  margin-bottom: 1rem;
}

.teacher-explanation-box strong {
  display: block;
  color: #287d70;
  margin-bottom: 0.35rem;
}

.teacher-explanation-box p {
  margin: 0;
  color: #374151;
  line-height: 1.5;
}

.teacher-question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.teacher-question-tags span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: #f8fbff;
  border: 1px solid #e9eef5;
  color: #495057;
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .teacher-preview-meta,
  .teacher-options-grid {
    grid-template-columns: 1fr;
  }

  .teacher-question-card-header {
    flex-direction: column;
  }

  .teacher-answer-pill {
    white-space: normal;
  }
}

/* ============================================
   15. TEACHER QUIZ RESULTS
   ============================================ */

.teacher-results-summary .teacher-panel-header {
  align-items: center;
}

.teacher-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.1rem;
}

.teacher-result-card {
  border: 1px solid #e9ecef;
  border-radius: 0.9rem;
  padding: 1rem;
  background: #fafbfc;
}

.teacher-result-card span {
  display: block;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.teacher-result-card strong {
  display: block;
  color: #2d4a73;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
}

.teacher-result-card .teacher-code-pill {
  display: inline-flex;
  font-size: 0.9rem;
}

.teacher-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.teacher-score-high {
  background: rgba(69, 179, 157, 0.12);
  color: #287d70;
}

.teacher-score-mid {
  background: #fff8e6;
  color: #8a5a00;
}

.teacher-score-low {
  background: #fff4f4;
  color: #b42318;
}

@media (max-width: 700px) {
  .teacher-results-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   16. MODULE / TOPIC ACCORDION
   ============================================ */

.teacher-topic-empty {
  border: 1px dashed #d1d5db;
  border-radius: 0.9rem;
  padding: 1rem;
  background: #fafbfc;
  color: #6b7280;
  font-size: 0.9rem;
}

.teacher-module-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.teacher-module-card {
  border: 1px solid #e6ebf2;
  border-radius: 0.95rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.teacher-module-header {
  width: 100%;
  border: 0;
  background: #f8fbff;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  text-align: left;
}

.teacher-module-title {
  color: #2d4a73;
  font-weight: 700;
  font-size: 0.95rem;
}

.teacher-module-count {
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
}

.teacher-module-body {
  display: none;
  padding: 1rem;
  border-top: 1px solid #eef2f7;
}

.teacher-module-card.open .teacher-module-body {
  display: block;
}

.teacher-topic-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.teacher-topic-action {
  border: 1px solid #d7dde6;
  background: #ffffff;
  color: #2d4a73;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.teacher-topic-action:hover {
  background: #f1f8ff;
  border-color: #3a83c3;
}

.teacher-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.teacher-topic-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border: 1px solid #e6ebf2;
  border-radius: 0.75rem;
  padding: 0.7rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.teacher-topic-check:hover {
  background: #f8fbff;
  border-color: #8ac4ea;
}

.teacher-topic-check input {
  margin-top: 0.15rem;
  accent-color: #3a83c3;
}

.teacher-topic-check span {
  color: #374151;
  font-size: 0.88rem;
  line-height: 1.35;
}

.teacher-topic-check:has(input:checked) {
  background: #f8fbff;
  border-color: #3a83c3;
  box-shadow: 0 0 0 3px rgba(58, 131, 195, 0.08);
}

@media (max-width: 700px) {
  .teacher-topic-grid {
    grid-template-columns: 1fr;
  }

  .teacher-module-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* ============================================
   TEACHER QUESTION SWAP - FINAL
   ============================================ */

.teacher-question-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-direction: column;
  flex-shrink: 0;
}

.teacher-swap-form {
  margin: 0;
  display: inline-flex;
}

.teacher-swap-btn {
  all: unset;

  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;

  min-width: 142px !important;
  height: 34px !important;
  padding: 0 1rem !important;

  border: 1px solid #d7dde6 !important;
  border-radius: 999px !important;
  background: #ffffff !important;

  color: #2d4a73 !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;

  cursor: pointer;
  overflow: visible !important;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.teacher-swap-btn:hover {
  background: #f8fbff !important;
  border-color: #3a83c3 !important;
  color: #1f5f99 !important;
  box-shadow: 0 4px 12px rgba(58, 131, 195, 0.12);
  transform: translateY(-1px);
}

.teacher-swap-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.teacher-swap-btn:hover .teacher-swap-icon {
  transform: rotate(180deg);
}

.teacher-swap-text {
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
  opacity: 1 !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

.teacher-question-swapping {
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.teacher-question-swapped {
  animation: teacherSwapFlash 0.85s ease;
}

@keyframes teacherSwapFlash {
  0% {
    background: #f8fffb;
    box-shadow: 0 0 0 4px rgba(69, 179, 157, 0.16);
  }

  100% {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  }
}

.teacher-preview-heading {
  flex: 1;
  min-width: 0;
}

.teacher-quiz-details-form {
  width: 100%;
  max-width: 720px;
}

.teacher-quiz-details-form .teacher-form-group {
  margin-bottom: 1rem;
}

.teacher-quiz-details-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #344054;
}

.teacher-quiz-details-form input,
.teacher-quiz-details-form textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  color: #101828;
  background: #fff;
}

.teacher-quiz-details-form input:focus,
.teacher-quiz-details-form textarea:focus {
  outline: none;
  border-color: #1570ef;
  box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.12);
}

.teacher-quiz-details-form textarea {
  resize: vertical;
}

.teacher-btn-small {
  padding: 0.55rem 0.9rem;
}

/* ==============================
   TEACHER PREVIEW PASSAGES
============================== */

.teacher-preview-passage {
  margin-top: 8px;
}

.teacher-preview-passage .accordion-item {
  overflow: hidden;
  border: 1px solid #e3e9f1 !important;
}

.teacher-preview-passage .accordion-button {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 18px 20px;

  color: #0f182b;
  background: #ffffff;

  font-size: 0.96rem;
}

.teacher-preview-passage .accordion-button:not(.collapsed) {
  color: #0f182b;
  background: #f4f7fb;
  box-shadow: none;
}

.teacher-preview-passage .accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}

.teacher-passage-emoji {
  flex: 0 0 auto;
}

.teacher-passage-body {
  padding: 20px;
  color: #33415c;
  line-height: 1.75;
}

.teacher-reference-code {
  width: fit-content;

  margin-bottom: 16px;
  padding: 6px 12px;

  border-radius: 999px;

  background: #eef4ff;
  color: #315b9d;

  font-size: 0.82rem;
  font-weight: 600;
}

.teacher-passage-content {
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: #27364f;
}
.quiz-reference-accordion .accordion-button {
  color: #0f182b;
  background: #f8fafc;
  box-shadow: none;
}

.quiz-reference-accordion .accordion-button:not(.collapsed) {
  color: #0f182b;
  background: #eef4ff;
  box-shadow: none;
}

.quiz-reference-accordion .accordion-button:focus {
  box-shadow: none;
}

.quiz-reference-body {
  padding: 1.25rem;
  color: #33415c;
  line-height: 1.75;
}

.quiz-reference-content {
  overflow-wrap: anywhere;
  font-size: 0.96rem;
}