/* Modular CSS slice extracted from style.css (10760-11476) */
@keyframes modalFadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.collusion-pair-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.collusion-pair-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
}

.gap-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gap-card:hover {
  border-color: #94a3b8 !important;
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.06);
}

.worksheet-preview-container {
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
  border: 1.5px solid #cbd5e1;
}

/* Touch scrolling optimization */
#collusion-modal-content,
#remediation-modal-content {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Remediation Class Badge & Grade Selector Styling */
.modal-content select.remediation-target-grade-select,
.remediation-modal-content select.remediation-target-grade-select,
#remediation-target-grade {
  width: auto !important;
  min-width: 170px !important;
  max-width: 240px !important;
  height: 36px !important;
  min-height: 36px !important;
  line-height: 1.4 !important;
  padding: 4px 28px 4px 10px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  background-color: var(--bg-main, #f8fafc) !important;
  color: #0284c7 !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  display: inline-block !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .remediation-modal-content select.remediation-target-grade-select,
[data-theme="dark"] #remediation-target-grade {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #38bdf8 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.remediation-selected-class-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  border: 1px solid rgba(14, 165, 233, 0.25);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .remediation-selected-class-badge {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

/* --- Tablet Breakpoint (max-width: 768px) --- */
@media (max-width: 768px) {
  .collusion-modal-content,
  .remediation-modal-content {
    width: 96vw !important;
    max-height: 94vh !important;
    padding: 1.15rem 1rem !important;
    border-radius: 14px !important;
  }
  
  .worksheet-preview-container {
    padding: 14px !important;
  }
  
  .collusion-pair-card {
    padding: 12px !important;
  }

  #btn-topbar-collusion,
  #btn-topbar-remediation {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.78rem !important;
  }
}

/* --- Mobile Standard Breakpoint (max-width: 640px) --- */
@media (max-width: 640px) {
  /* Prevent topbar horizontal clutter on mobile; features remain accessible via sidebar */
  #btn-topbar-collusion,
  #btn-topbar-remediation {
    display: none !important;
  }

  .topbar-utilities-wrapper {
    display: none !important;
  }

  .collusion-modal-header,
  .remediation-modal-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .collusion-modal-icon,
  .remediation-modal-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 1.15rem !important;
  }

  #collusion-modal-title,
  #remediation-modal-title {
    font-size: 1.05rem !important;
    line-height: 1.35;
  }

  .collusion-modal-subtitle,
  .remediation-modal-subtitle {
    font-size: 0.75rem !important;
    line-height: 1.35;
  }

  /* Full-width touch-friendly action buttons in modal footers */
  .collusion-modal-footer,
  .remediation-modal-footer {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  .collusion-footer-btns {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    gap: 0.5rem;
  }

  .collusion-footer-btns button,
  .remediation-modal-footer button {
    width: 100% !important;
    min-height: 42px !important;
    font-size: 0.9rem !important;
    justify-content: center !important;
  }

  .collusion-footer-note {
    text-align: center;
    font-size: 0.75rem !important;
  }
}

/* --- Foldable & Small Phone Breakpoint (max-width: 480px) --- */
@media (max-width: 480px) {
  .collusion-modal-content,
  .remediation-modal-content {
    width: 98vw !important;
    max-height: 96vh !important;
    padding: 0.9rem 0.75rem !important;
    border-radius: 12px !important;
  }

  #collusion-modal-title,
  #remediation-modal-title {
    font-size: 0.98rem !important;
  }

  .collusion-summary-card {
    padding: 10px !important;
    margin-bottom: 14px !important;
  }

  .collusion-summary-card > div:first-child {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .stat-pill {
    font-size: 0.72rem !important;
    padding: 3px 8px !important;
  }

  .gap-card {
    padding: 10px !important;
  }

  .exercise-preview-item {
    padding-bottom: 10px !important;
    margin-bottom: 12px !important;
  }
}

/* ==========================================================================
   Global KaTeX Math Rendering & Step-Item Typography
   ========================================================================== */
.katex {
  font-size: 1.05em;
  text-rendering: auto;
}

.katex-display {
  display: block;
  margin: 0.5rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.math-fallback {
  background: rgba(241, 245, 249, 0.9);
  color: #1e293b;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: 'KaTeX_Math', 'Cambria Math', 'Times New Roman', serif;
  font-size: 0.95em;
}

.math-display.math-fallback {
  display: block;
  padding: 0.4rem 0.65rem;
  margin: 0.4rem 0;
  border-left: 3px solid var(--primary-color, #2563eb);
  overflow-x: auto;
}

.rubric-step-item {
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: break-word;
}

.rubric-box-content {
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Exam Audit & Flawed Question Warning Styles */
.pedagogical-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

#modal-exam-audit-report {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 10080 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#modal-exam-audit-report.active {
  display: flex !important;
}

/* Modal Exam Audit Header Action Buttons (High contrast on dark gradient) */
#modal-exam-audit-report .modal-exam-audit-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#modal-exam-audit-report .modal-exam-audit-badges-wrap {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.45rem !important;
  align-items: center !important;
  margin-top: 0.25rem !important;
}

#modal-exam-audit-report .modal-exam-audit-badges-wrap .badge {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  border-radius: 6px !important;
  padding: 0.2rem 0.5rem !important;
  font-size: 0.75rem !important;
}

#modal-exam-audit-report .modal-exam-audit-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  flex-shrink: 0 !important;
}

#modal-exam-audit-report .modal-exam-audit-header-actions button,
#modal-exam-audit-report #btn-header-exam-audit-rerun,
#modal-exam-audit-report #btn-header-exam-audit-print,
#modal-exam-audit-report #btn-close-exam-audit-modal {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  border-radius: 8px !important;
  padding: 0.38rem 0.72rem !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#modal-exam-audit-report #btn-header-exam-audit-rerun {
  background: rgba(14, 165, 233, 0.25) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.6) !important;
}
#modal-exam-audit-report #btn-header-exam-audit-rerun:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  transform: translateY(-1px) !important;
}

#modal-exam-audit-report #btn-header-exam-audit-print {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
}
#modal-exam-audit-report #btn-header-exam-audit-print:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
  transform: translateY(-1px) !important;
}

#modal-exam-audit-report #btn-close-exam-audit-modal {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
}
#modal-exam-audit-report #btn-close-exam-audit-modal:hover {
  background: rgba(239, 68, 68, 0.8) !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 640px) {
  #modal-exam-audit-report .modal-content {
    width: 96% !important;
    margin: 0.5rem auto !important;
    max-height: 94vh !important;
  }
  #modal-exam-audit-report .modal-exam-audit-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    padding: 0.75rem 1rem !important;
  }
  #modal-exam-audit-report .modal-exam-audit-btn-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
    width: 100% !important;
  }
  #modal-exam-audit-report .modal-exam-audit-btn-group .btn {
    min-height: 42px !important;
    font-size: 0.78rem !important;
    padding: 0.4rem 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }
  #modal-exam-audit-report .modal-exam-audit-btn-group #btn-audit-print-pdf {
    grid-column: span 2 !important;
  }
}

@media (max-width: 380px) {
  #modal-exam-audit-report .modal-exam-audit-btn-group {
    grid-template-columns: 1fr !important;
  }
  #modal-exam-audit-report .modal-exam-audit-btn-group #btn-audit-print-pdf {
    grid-column: span 1 !important;
  }
}

/* ==========================================================================
   TEACHER PRESENTATION MODE (SMART BOARD & PROJECTOR CINEMATIC UX)
   ========================================================================== */
.teacher-presentation-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #090d16 !important;
  color: #f8fafc;
  z-index: 10080;
  overflow: hidden;
}

.teacher-presentation-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.teacher-presentation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.presentation-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.presentation-live-badge {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.presentation-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #f1f5f9;
}

.presentation-header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.presentation-theme-selector {
  display: flex;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
  border-radius: 6px;
}

.presentation-theme-selector .theme-btn {
  color: #94a3b8;
  border-color: transparent;
  padding: 0.25rem 0.5rem;
}

.presentation-theme-selector .theme-btn.active {
  background: #3b82f6;
  color: #ffffff;
}

.teacher-presentation-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 58% 42%;
  height: calc(100vh - 125px);
  overflow: hidden;
  position: relative;
}

.presentation-canvas-pane {
  position: relative;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease;
}

/* Theme variants */
.presentation-canvas-pane.theme-chalkboard {
  background: #064e3b !important;
}

.presentation-canvas-pane.theme-grid {
  background: #ffffff !important;
  background-image: linear-gradient(#e2e8f0 1px, transparent 1px), linear-gradient(90deg, #e2e8f0 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
}

.presentation-viewport-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.presentation-hint-banner {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(234, 88, 12, 0.92);
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.35);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 20;
  animation: pulseHint 2s infinite ease-in-out;
}

@keyframes pulseHint {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.03); }
}

.presentation-blank-curtain {
  position: absolute;
  inset: 0;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  cursor: pointer;
}

.blank-curtain-content {
  text-align: center;
  color: #e2e8f0;
}

.presentation-proof-pane {
  background: #111827;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.proof-pane-header {
  padding: 0.75rem 1rem;
  background: rgba(31, 41, 55, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.proof-header-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: #60a5fa;
  letter-spacing: 0.5px;
}

.proof-step-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
}

.presentation-proof-steps-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.presentation-step-item {
  padding: 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid transparent;
  transition: all 0.3s ease;
  opacity: 0.4;
}

.presentation-step-item.step-active {
  opacity: 1;
  background: rgba(59, 130, 246, 0.12);
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.presentation-step-item.step-passed {
  opacity: 0.75;
}

.presentation-step-item.step-future {
  opacity: 0.15;
}

.presentation-step-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #93c5fd;
  margin-bottom: 0.35rem;
}

.presentation-step-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Floating Dock */
.teacher-floating-dock {
  height: 65px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  backdrop-filter: blur(12px);
  z-index: 40;
}

.dock-left-info .dock-step-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #94a3b8;
}

.dock-center-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dock-btn {
  min-height: 42px;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  border-radius: 8px;
}

.dock-btn-play {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  border: none;
  min-width: 120px;
}

.dock-btn-hint {
  color: #fb923c;
  border-color: #ea580c;
}

.dock-right-shortcuts {
  display: flex;
  gap: 0.75rem;
}
