/* Modular CSS slice extracted from style.css (10044-10759) */
.sub-new-file-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.sub-new-file-tag-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0 0.15rem;
}

.btn-edit-submission {
  color: #2563eb;
  border-color: #bfdbfe;
  font-weight: 600;
}

.btn-edit-submission:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.btn-delete-submission {
  color: #ef4444;
  border-color: #fca5a5;
  font-weight: 600;
}

.btn-delete-submission:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
}

/* ==========================================================================
   AUTO-DETECT LOADING OVERLAY & INTERACTION LOCKING (EDTECH PREMIUM)
   ========================================================================== */

.auto-detect-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: all !important;
  user-select: none;
}

.auto-detect-loading-overlay.active {
  display: flex !important;
  opacity: 1 !important;
}

.auto-detect-loading-card {
  background: #ffffff;
  border: 1.5px solid #bfdbfe;
  border-radius: 18px;
  padding: 1.75rem 1.5rem;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px -15px rgba(37, 99, 235, 0.22), 0 0 0 1px rgba(37, 99, 235, 0.08);
  transform: scale(0.95);
  animation: autoDetectCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  z-index: 1051;
}

.auto-detect-spinner-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 1.15rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auto-detect-spinner {
  position: absolute;
  inset: 0;
  border: 3.5px solid #e0e7ff;
  border-top-color: #2563eb;
  border-right-color: #7c3aed;
  border-radius: 50%;
  animation: spinAutoDetect 0.9s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

.auto-detect-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.35);
  animation: pulseAutoDetect 1.8s ease-out infinite;
}

.auto-detect-icon {
  font-size: 1.5rem;
  line-height: 1;
  animation: floatAutoDetect 2s ease-in-out infinite alternate;
}

.auto-detect-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a8a;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.01em;
}

.auto-detect-desc {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
  margin: 0 0 1rem 0;
}

.auto-detect-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #4338ca;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.auto-detect-locked {
  pointer-events: none !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  filter: grayscale(15%);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

@keyframes spinAutoDetect {
  to { transform: rotate(360deg); }
}

@keyframes pulseAutoDetect {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.18); opacity: 0.18; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes floatAutoDetect {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-3px) scale(1.1); }
}

@keyframes autoDetectCardIn {
  to { transform: scale(1); }
}

@media (max-width: 640px) {
  .auto-detect-loading-card {
    padding: 1.25rem 1rem;
    width: 94%;
  }
  .auto-detect-title {
    font-size: 0.95rem;
  }
  .auto-detect-desc {
    font-size: 0.78rem;
    margin-bottom: 0.75rem;
  }

  /* Responsive styles for Edit Exam Modal */
  #modal-edit-exam .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    padding: 1rem !important;
    margin: 1rem auto !important;
    border-radius: var(--radius-md) !important;
  }
  #form-edit-exam div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
  #form-edit-exam .form-control {
    font-size: 0.9rem !important;
    min-height: 40px !important;
  }
}

/* --- VIETQR PAYMENT MODAL RESPONSIVE & COPY BUTTONS --- */
.btn-copy-inline {
  transition: all 0.2s ease-in-out;
  user-select: none;
}
.btn-copy-inline:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.btn-copy-inline:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  #modal-subscription-payment .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  #payment-qr-img {
    width: 180px !important;
    height: 180px !important;
  }
  .vietqr-transfer-info-card {
    font-size: 0.8rem !important;
    padding: 0.75rem !important;
  }
  .vietqr-transfer-info-card strong {
    font-size: 0.85rem !important;
  }
  #payment-transfer-content {
    font-size: 0.82rem !important;
    padding: 0.1rem 0.35rem !important;
  }
}

/* --- CHANGE PASSWORD MODAL & PASS TOGGLES --- */
#modal-change-password .modal-content {
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-xl);
}

.btn-toggle-pass-inline {
  font-size: 0.75rem;
  color: var(--iris-600);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-toggle-pass-inline:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--iris-700);
}

.btn-toggle-pass-inline:active {
  transform: scale(0.97);
}

#chg-pass-error {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

@media (max-width: 480px) {
  #modal-change-password .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    padding: 1.25rem 1rem !important;
    margin: 1rem auto !important;
  }
  #modal-change-password .form-control {
    font-size: 0.95rem;
    padding: 0.75rem 0.85rem;
    min-height: 44px;
  }
  #modal-change-password .btn {
    min-height: 42px;
  }
}@media (max-width: 480px) {
  #modal-admin-assign-subscription .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    padding: 1.25rem 1rem !important;
    margin: 1rem auto !important;
  }
  #modal-admin-assign-subscription .form-control {
    font-size: 0.95rem;
    min-height: 44px;
  }
  #modal-admin-assign-subscription div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  #modal-admin-assign-subscription .btn {
    min-height: 42px;
  }
}

/* ==========================================================================
   Export Options Modal & Responsive Cards
   ========================================================================== */
.export-option-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.export-option-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}
#card-export-zip:hover {
  border-color: #16a34a !important;
}
#card-export-merged:hover {
  border-color: #3b82f6 !important;
}
#card-export-xlsx:hover {
  border-color: #2563eb !important;
}

@media (max-width: 640px) {
  #modal-export-options .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    padding: 1.25rem 1rem !important;
    margin: 1rem auto !important;
  }
  .export-option-card {
    padding: 1rem 0.85rem !important;
  }
  .export-option-card button {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   Sortable Table Headers
   ========================================================================== */
.submissions-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.submissions-table th.sortable-th:hover {
  background-color: #f1f5f9;
  color: var(--primary, #2563eb);
}

.submissions-table th.sortable-th .th-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.submissions-table th.sortable-th .sort-icon {
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1;
  color: #94a3b8;
  transition: transform 0.15s ease, color 0.15s ease;
}

.submissions-table th.sortable-th:hover .sort-icon {
  color: #64748b;
}

.submissions-table th.sortable-th.th-sorted-active {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-bottom: 2px solid #2563eb;
}

.submissions-table th.sortable-th.th-sorted-active .sort-icon {
  color: #2563eb;
  font-weight: 800;
  transform: scale(1.15);
}

@media (max-width: 768px) {
  .submissions-table th.sortable-th {
    padding: 0.75rem 0.5rem;
    min-height: 44px;
  }
}

/* ==========================================================================
   STUDENT PORTAL PROGRESSIVE STEPPER & MOBILE FLOW
   ========================================================================== */
.portal-stepper-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-surface, #ffffff);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  opacity: 0.5;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  cursor: pointer;
}

.stepper-step:hover {
  opacity: 0.85;
}

.stepper-step.active {
  opacity: 1;
}

.stepper-step.completed {
  opacity: 0.9;
}

.step-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stepper-step.active .step-icon-circle {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
  transform: scale(1.05);
}

.stepper-step.completed .step-icon-circle {
  background: #10b981;
  color: #ffffff;
}

.step-meta {
  display: flex;
  flex-direction: column;
}

.step-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stepper-step.active .step-name {
  color: #4f46e5;
}

.step-desc {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main, #1e293b);
}

.stepper-line {
  flex: 1;
  max-width: 60px;
  height: 2px;
  background: #e2e8f0;
  transition: background 0.3s ease;
}

.stepper-line.completed {
  background: #10b981;
}

/* Animations for progressive card transitions */
@keyframes portalCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-card-entering {
  animation: portalCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile responsive progressive flow */
@media (max-width: 768px) {
  .portal-stepper-container {
    padding: 0.65rem 0.85rem;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    border-radius: var(--radius-md, 10px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }
  .step-desc {
    display: none;
  }
  .step-name {
    font-size: 0.68rem;
  }
  .step-icon-circle {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }
  .stepper-line {
    max-width: 28px;
    height: 2px;
  }
  .portal-card {
    padding: 1.15rem 0.9rem !important;
  }
}

@media (max-width: 375px) {
  .portal-stepper-container {
    padding: 0.5rem 0.65rem;
    gap: 0.25rem;
  }
  .stepper-step {
    gap: 0.35rem;
  }
  .step-name {
    font-size: 0.62rem;
  }
  .stepper-line {
    max-width: 16px;
  }
}

@media (max-width: 480px) {
  .portal-manual-entry-box div {
    flex-direction: column;
  }
  .portal-manual-entry-box button {
    width: 100%;
    min-height: 44px;
  }
  #btn-portal-scan-qr {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }
}

/* ==========================================================================
   PORTAL ACCESS REQUIRED CARD & QR SCANNER (UI/UX Rich Aesthetics)
   ========================================================================== */
.portal-access-required-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: var(--radius-lg, 16px) !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04) !important;
  animation: portalCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portal-access-required-card .access-required-icon-wrap {
  transition: transform 0.25s ease;
}

.portal-access-required-card .access-required-icon-wrap:hover {
  transform: scale(1.06);
}

.portal-manual-entry-box {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-manual-entry-box:focus-within {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

@media (max-width: 480px) {
  .portal-access-required-card {
    padding: 1.5rem 1rem !important;
  }
  .portal-manual-entry-box div {
    flex-direction: column;
  }
  .portal-manual-entry-box button {
    width: 100%;
  }
}


/* ==========================================================================
   EXPORT PROGRESS MODAL (UI/UX Rich Aesthetics & Responsive Matrix)
   ========================================================================== */
.export-progress-modal-content {
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: exportModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes exportModalPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.export-progress-sparkle {
  animation: pulseSparkle 2s infinite ease-in-out;
}

@keyframes pulseSparkle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.5)); }
}

.export-progress-card {
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.export-progress-card:hover {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

/* Mobile & Foldable Responsive Breakpoints */
@media (max-width: 480px) {
  .export-progress-modal-content {
    padding: 1.15rem 1rem !important;
    width: 95vw !important;
    max-width: 95vw !important;
    border-radius: 14px !important;
  }
  #export-progress-title {
    font-size: 1rem !important;
  }
  #export-progress-subtitle {
    font-size: 0.72rem !important;
  }
  .export-progress-card {
    padding: 0.65rem 0.75rem !important;
    margin-bottom: 0.85rem !important;
  }
  #export-progress-student-name {
    font-size: 0.82rem !important;
    max-width: 160px;
  }
  #export-progress-detail-label {
    font-size: 0.7rem !important;
  }
  #export-progress-counter {
    font-size: 0.72rem !important;
    padding: 0.2rem 0.4rem !important;
  }
}

@media (max-width: 360px) {
  #export-progress-subtitle {
    display: none;
  }
  #export-progress-speed {
    display: none !important;
  }
}

/* ==========================================================================
   COLLUSION & REMEDIATION RESPONSIVE DESIGN SYSTEM (v1.9.9)
   Desktop, Tablet, Foldable & Mobile Ultra-Smooth Responsiveness
   ========================================================================== */

.collusion-modal-content,
.remediation-modal-content {
  animation: modalFadeInUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
}
