/* ==========================================================================
   Discipleship Interactive Assessment & Learning System
   Modern Glassmorphism Design • Responsive • Accessible
   ========================================================================== */

:root {
  --asmt-bg: #0f172a;
  --asmt-card-bg: rgba(30, 41, 59, 0.85);
  --asmt-card-border: rgba(255, 255, 255, 0.1);
  --asmt-text-main: #f8fafc;
  --asmt-text-muted: #94a3b8;
  --asmt-accent: #6366f1;
  --asmt-accent-hover: #4f46e5;
  --asmt-accent-light: rgba(99, 102, 241, 0.15);
  --asmt-success: #10b981;
  --asmt-success-bg: rgba(16, 185, 129, 0.15);
  --asmt-success-border: rgba(16, 185, 129, 0.35);
  --asmt-error: #ef4444;
  --asmt-error-bg: rgba(239, 68, 68, 0.15);
  --asmt-error-border: rgba(239, 68, 68, 0.35);
  --asmt-amber: #f59e0b;
  --asmt-amber-bg: rgba(245, 158, 11, 0.15);
  --asmt-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  --asmt-radius: 16px;
  --asmt-radius-sm: 8px;
  --asmt-transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Overlay */
.asmt-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  background-color: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.asmt-overlay.asmt-active {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.asmt-modal {
  width: min(1040px, 98vw);
  max-width: 98vw;
  height: 94vh;
  max-height: 96vh;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--asmt-card-border);
  border-radius: var(--asmt-radius);
  box-shadow: var(--asmt-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--asmt-text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transform: translateY(12px) scale(0.99);
  transition: transform 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.asmt-overlay.asmt-active .asmt-modal {
  transform: translateY(0) scale(1);
}

/* Modal Header - Compact Single Row */
.asmt-header {
  padding: 0.55rem 1.15rem;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  min-height: 48px;
  box-sizing: border-box;
}

.asmt-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.asmt-topic-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.asmt-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.asmt-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.asmt-header-progress-badge {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.asmt-header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

/* Tools / Menu Toggle Button */
.asmt-tools-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--asmt-transition);
  line-height: 1.2;
}

.asmt-tools-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.asmt-tools-toggle-btn.asmt-active {
  background: var(--asmt-accent);
  border-color: var(--asmt-accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.asmt-tools-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

/* Close Button */
.asmt-close-btn {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--asmt-transition);
  padding: 0;
  line-height: 1;
}

.asmt-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Collapsible Secondary Toolbar / Tools Drawer */
.asmt-subtoolbar {
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--asmt-card-border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex-shrink: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, padding 0.28s ease;
}

.asmt-subtoolbar.asmt-tools-collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  pointer-events: none !important;
  margin: 0 !important;
}

.asmt-subtoolbar.asmt-tools-open {
  max-height: 320px;
  opacity: 1;
  padding: 0.65rem 1.15rem;
  overflow-y: auto;
}

/* View Mode Segmented Control */
.asmt-view-toggle {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 3px;
  gap: 2px;
}

.asmt-toggle-btn {
  background: transparent;
  border: none;
  color: var(--asmt-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--asmt-transition);
}

.asmt-toggle-btn.asmt-active {
  background: var(--asmt-accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.asmt-toggle-btn:hover:not(.asmt-active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.asmt-meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.asmt-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.asmt-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--asmt-text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--asmt-transition);
}

.asmt-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--asmt-text-main);
}

.asmt-chip.asmt-active {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
}

.asmt-search-wrap {
  position: relative;
  min-width: 180px;
}

.asmt-search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.8rem;
  padding: 5px 10px 5px 28px;
  border-radius: 20px;
  outline: none;
  transition: var(--asmt-transition);
}

.asmt-search-input:focus {
  border-color: var(--asmt-accent);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.asmt-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--asmt-text-muted);
  pointer-events: none;
}

/* Question Jump Bar (Pill Rail) */
.asmt-jump-rail-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.asmt-jump-rail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--asmt-text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.asmt-jump-rail {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.asmt-jump-rail::-webkit-scrollbar {
  height: 4px;
}

.asmt-jump-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.asmt-jump-pill {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--asmt-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--asmt-transition);
  padding: 0;
  position: relative;
}

.asmt-jump-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

.asmt-jump-pill.asmt-current {
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.35);
}

.asmt-jump-pill.asmt-correct {
  background: var(--asmt-success-bg);
  border-color: var(--asmt-success-border);
  color: #34d399;
}

.asmt-jump-pill.asmt-wrong {
  background: var(--asmt-error-bg);
  border-color: var(--asmt-error-border);
  color: #f87171;
}

.asmt-jump-pill.asmt-understood {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.35);
  color: #38bdf8;
}

/* Progress bar strip */
.asmt-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  overflow: hidden;
}

.asmt-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
  transition: width 0.3s ease;
}

/* Modal Body / Scroll Content */
.asmt-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.asmt-body::-webkit-scrollbar {
  width: 6px;
}

.asmt-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Question Cards */
.asmt-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--asmt-transition);
  position: relative;
}

.asmt-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(30, 41, 59, 0.85);
}

.asmt-card.asmt-card-highlight {
  border-color: #818cf8;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
  animation: asmt-pulse 1.2s ease 1;
}

@keyframes asmt-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.asmt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.asmt-card-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.asmt-qnumber {
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.asmt-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.asmt-type-mcq {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.asmt-type-open {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.asmt-ref-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.asmt-question-text {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.5;
  color: #f1f5f9;
}

/* MCQ Options Grid */
.asmt-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.asmt-option-btn {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: var(--asmt-transition);
  position: relative;
}

.asmt-option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateX(3px);
}

.asmt-option-letter {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  flex-shrink: 0;
  transition: var(--asmt-transition);
}

.asmt-option-text {
  flex: 1;
}

/* Option States */
.asmt-option-btn.asmt-selected-correct {
  background: var(--asmt-success-bg) !important;
  border-color: var(--asmt-success) !important;
  color: #ffffff;
}

.asmt-option-btn.asmt-selected-correct .asmt-option-letter {
  background: var(--asmt-success);
  color: #ffffff;
}

.asmt-option-btn.asmt-selected-wrong {
  background: var(--asmt-error-bg) !important;
  border-color: var(--asmt-error) !important;
  color: #ffffff;
}

.asmt-option-btn.asmt-selected-wrong .asmt-option-letter {
  background: var(--asmt-error);
  color: #ffffff;
}

.asmt-option-btn.asmt-show-correct {
  border-color: var(--asmt-success) !important;
  background: rgba(16, 185, 129, 0.1) !important;
}

.asmt-option-btn.asmt-show-correct .asmt-option-letter {
  background: var(--asmt-success);
  color: #ffffff;
}

/* MCQ Explanation Panel */
.asmt-explanation-panel {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: asmt-slide-down 0.25s ease;
}

@keyframes asmt-slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.asmt-exp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.asmt-exp-title {
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.asmt-exp-title.asmt-correct {
  color: #34d399;
}

.asmt-exp-title.asmt-wrong {
  color: #f87171;
}

.asmt-exp-text {
  margin: 0;
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.asmt-exp-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.asmt-retry-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--asmt-text-muted);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--asmt-transition);
}

.asmt-retry-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Open-Ended Question Component */
.asmt-open-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.asmt-notes-area {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  min-height: 54px;
  resize: vertical;
  outline: none;
  transition: var(--asmt-transition);
}

.asmt-notes-area:focus {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(15, 23, 42, 0.75);
}

.asmt-notes-area::placeholder {
  color: #64748b;
  font-style: italic;
}

/* Native Accessible <details> for answers */
.asmt-disclosure {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
  transition: var(--asmt-transition);
}

.asmt-disclosure[open] {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(15, 23, 42, 0.8);
}

.asmt-disclosure-summary {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #c7d2fe;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  transition: var(--asmt-transition);
}

.asmt-disclosure-summary::-webkit-details-marker {
  display: none;
}

.asmt-disclosure-summary:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.asmt-disclosure-icon {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.asmt-disclosure[open] .asmt-disclosure-icon {
  transform: rotate(180deg);
}

.asmt-disclosure-content {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  animation: asmt-fade-in 0.22s ease;
}

@keyframes asmt-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.asmt-model-answer {
  margin: 0.65rem 0 0 0;
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.6;
}

.asmt-scripture-box {
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid #6366f1;
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
  color: #c7d2fe;
  display: flex;
  align-items: center;
  gap: 6px;
}

.asmt-key-points-list {
  margin: 0.2rem 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
}

.asmt-open-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.asmt-understand-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--asmt-transition);
}

.asmt-understand-btn:hover {
  background: #10b981;
  color: #ffffff;
}

.asmt-understand-btn.asmt-marked {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* Single Question Focus Mode Nav */
.asmt-focus-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.4rem;
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid var(--asmt-card-border);
  flex-shrink: 0;
}

.asmt-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--asmt-transition);
}

.asmt-nav-btn:hover:not(:disabled) {
  background: var(--asmt-accent);
  border-color: var(--asmt-accent);
}

.asmt-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Modal Footer */
.asmt-footer {
  padding: 0.85rem 1.4rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--asmt-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.asmt-footer-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.84rem;
  color: var(--asmt-text-muted);
}

.asmt-stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.asmt-stat-value {
  font-weight: 700;
  color: #ffffff;
}

.asmt-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.asmt-btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--asmt-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--asmt-transition);
}

.asmt-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.asmt-btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transition: var(--asmt-transition);
}

.asmt-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

/* Assessment Summary Overlay/Modal */
.asmt-summary-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 480px;
  margin: auto;
}

.asmt-summary-score-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(16, 185, 129, 0.25) 100%);
  border: 3px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

/* Assessment Launch Card in discipleship.ejs */
.asmt-launch-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  transition: var(--asmt-transition);
}

.asmt-launch-card:hover {
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -5px rgba(99, 102, 241, 0.2);
}

.asmt-launch-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.asmt-launch-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.asmt-launch-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.asmt-launch-desc {
  margin: 0.25rem 0 0 0;
  font-size: 0.84rem;
  color: #94a3b8;
}

.asmt-launch-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  white-space: nowrap;
  transition: var(--asmt-transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.asmt-launch-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* ==========================================================================
   Comprehensive Mobile Phone Optimizations (Smartphones & Touch Devices)
   ========================================================================== */

@media (max-width: 768px) {
  /* Fullscreen Modal Experience on Phones (Edge-to-Edge) */
  .asmt-overlay {
    padding: 0;
    margin: 0;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 10000;
    overflow: hidden;
  }

  .asmt-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Compact Horizontal Mobile Header - Single Sleek Bar */
  .asmt-header {
    padding: 0.45rem 0.65rem;
    padding-top: calc(0.45rem + env(safe-area-inset-top, 0px));
    min-height: calc(44px + env(safe-area-inset-top, 0px));
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    box-sizing: border-box;
  }

  .asmt-header-left {
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
  }

  .asmt-topic-icon {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
    border-radius: 6px;
  }

  .asmt-title {
    font-size: 0.92rem;
    max-width: 44vw;
  }

  .asmt-header-progress-badge {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 10px;
  }

  .asmt-header-right {
    gap: 0.4rem;
  }

  .asmt-tools-toggle-btn {
    padding: 4px 8px;
    font-size: 0.74rem;
    min-height: 30px;
    gap: 4px;
    border-radius: 16px;
  }

  .asmt-close-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 1.2rem;
  }

  /* Collapsible Mobile Subtoolbar */
  .asmt-subtoolbar.asmt-tools-open {
    padding: 0.5rem 0.65rem;
    gap: 0.45rem;
    max-height: 48vh;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .asmt-meta-strip {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
  }

  .asmt-view-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .asmt-toggle-btn {
    padding: 4px 8px;
    font-size: 0.74rem;
    min-height: 28px;
    gap: 4px;
  }

  .asmt-search-wrap {
    flex: 1;
    min-width: 0;
  }

  .asmt-search-input {
    font-size: 16px; /* Crucial: Prevents iOS auto-zoom */
    min-height: 32px;
    padding: 4px 8px 4px 26px;
    border-radius: 16px;
  }

  .asmt-search-icon {
    left: 8px;
    font-size: 0.7rem;
  }

  /* Horizontal swipe for filter chips */
  .asmt-filter-chips {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    gap: 4px;
  }

  .asmt-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .asmt-chip {
    padding: 3px 8px;
    font-size: 0.72rem;
    min-height: 26px;
    border-radius: 14px;
  }

  /* Mobile Touch-Friendly Jump Rail */
  .asmt-jump-rail-container {
    gap: 0.4rem;
  }

  .asmt-jump-rail-label {
    font-size: 0.68rem;
  }

  .asmt-jump-rail {
    gap: 4px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .asmt-jump-pill {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
  }

  /* Mobile Body & Question Cards: Optimized Space for Questions */
  .asmt-body {
    padding: 0.45rem 0.55rem;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .asmt-card {
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    gap: 0.45rem;
  }

  .asmt-card-header {
    gap: 0.4rem;
  }

  .asmt-qnumber {
    font-size: 0.72rem;
    padding: 2px 6px;
  }

  .asmt-type-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .asmt-question-text {
    font-size: 0.94rem;
    line-height: 1.42;
    margin-bottom: 0.35rem;
  }

  /* Touch-Optimized MCQ Option Buttons */
  .asmt-options-list {
    gap: 5px;
  }

  .asmt-option-btn {
    min-height: 42px;
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
    gap: 0.6rem;
    border-radius: 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .asmt-option-btn:active:not(:disabled) {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.12);
  }

  .asmt-option-letter {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 0.78rem;
  }

  .asmt-option-text {
    line-height: 1.35;
  }

  .asmt-explanation-panel {
    padding: 0.65rem 0.75rem;
    gap: 0.35rem;
  }

  .asmt-exp-title {
    font-size: 0.78rem;
  }

  .asmt-exp-text {
    font-size: 0.84rem;
    line-height: 1.4;
  }

  /* Reflection Questions */
  .asmt-open-container {
    gap: 0.45rem;
  }

  .asmt-notes-area {
    font-size: 16px; /* Prevents iOS auto-zoom */
    min-height: 48px;
    padding: 0.5rem 0.65rem;
  }

  .asmt-disclosure-summary {
    padding: 0.55rem 0.7rem;
    font-size: 0.85rem;
    min-height: 38px;
    box-sizing: border-box;
  }

  .asmt-model-answer {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  .asmt-key-points li {
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
  }

  .asmt-scripture-box {
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
  }

  .asmt-understand-btn {
    width: 100%;
    min-height: 38px;
    justify-content: center;
    font-size: 0.82rem;
    padding: 6px 10px;
  }

  /* Touch Navigation in Focus Mode */
  .asmt-focus-nav {
    padding: 0.4rem 0.65rem;
    gap: 0.5rem;
    min-height: 42px;
  }

  .asmt-nav-btn {
    flex: 1;
    min-height: 38px;
    justify-content: center;
    font-size: 0.82rem;
    padding: 6px 10px;
  }

  /* Space-Efficient Mobile Footer */
  .asmt-footer {
    padding: 0.35rem 0.65rem calc(0.35rem + env(safe-area-inset-bottom, 0px)) 0.65rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .asmt-footer-stats {
    justify-content: flex-start;
    gap: 0.5rem;
    font-size: 0.76rem;
    flex: 1;
    min-width: 0;
  }

  .asmt-footer-actions {
    width: auto;
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
  }

  .asmt-footer-actions .asmt-btn-secondary {
    min-height: 32px;
    padding: 4px 9px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .asmt-footer-actions .asmt-btn-primary {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile Assessment Launch Cards in Discipleship Content */
  .asmt-launch-card {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.15rem 1rem;
    margin: 1.25rem 0;
    border-radius: 14px;
  }

  .asmt-launch-left {
    gap: 0.85rem;
  }

  .asmt-launch-icon {
    width: 44px;
    height: 44px;
    font-size: 1.35rem;
  }

  .asmt-launch-title {
    font-size: 1.05rem;
    line-height: 1.4;
  }

  .asmt-launch-desc {
    font-size: 0.82rem;
  }

  .asmt-launch-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    font-size: 0.95rem;
    padding: 12px;
    touch-action: manipulation;
  }

  .asmt-launch-btn:active {
    transform: scale(0.98);
  }
}

/* ==========================================================================
   Interactive Scripture Link Pills & Elevated Verse Popup
   ========================================================================== */

/* Glowing Scripture Pills within Assessment Modal & Cards */
.asmt-modal a[onclick*="popVerse"],
.asmt-card a[onclick*="popVerse"],
.asmt-summary-card a[onclick*="popVerse"],
.asmt-ref-tag a[onclick*="popVerse"],
.asmt-scripture-box a[onclick*="popVerse"] {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 6px !important;
  padding: 1px 7px !important;
  margin: 0 2px !important;
  font-weight: 600 !important;
  font-size: 0.9em !important;
  text-decoration: none !important;
  display: inline-block !important;
  line-height: 1.45 !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  vertical-align: baseline !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.asmt-modal a[onclick*="popVerse"]:hover,
.asmt-card a[onclick*="popVerse"]:hover,
.asmt-summary-card a[onclick*="popVerse"]:hover,
.asmt-ref-tag a[onclick*="popVerse"]:hover,
.asmt-scripture-box a[onclick*="popVerse"]:hover {
  background: rgba(56, 189, 248, 0.24) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(56, 189, 248, 0.28) !important;
}

.asmt-modal a[onclick*="popVerse"]:active,
.asmt-card a[onclick*="popVerse"]:active {
  transform: translateY(0);
}

/* Verse links inside MCQ option buttons */
.asmt-option-btn a[onclick*="popVerse"] {
  position: relative;
  z-index: 3;
  color: #38bdf8 !important;
}

.asmt-option-btn.asmt-selected-correct a[onclick*="popVerse"],
.asmt-option-btn.asmt-show-correct a[onclick*="popVerse"] {
  color: #6ee7b7 !important;
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
}

.asmt-option-btn.asmt-selected-wrong a[onclick*="popVerse"] {
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

/* Elevated Modern Verse Popup Dialog */
.verse-popup {
  position: fixed !important;
  width: auto !important;
  max-width: min(440px, calc(100vw - 24px)) !important;
  max-height: 360px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
  overflow: hidden !important;
  z-index: 999999999 !important;
  animation: asmt-pop-fade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes asmt-pop-fade {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.verse-popup__title {
  background: #4f46e5 !important;
  color: #ffffff !important;
  padding: 8px 14px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.verse-popup__body {
  padding: 12px 14px !important;
  font-size: 0.95rem !important;
  line-height: 1.65 !important;
  color: #1e293b !important;
  overflow-y: auto !important;
  max-height: 220px !important;
  cursor: default !important;
  -webkit-overflow-scrolling: touch !important;
}

.verse-popup__more {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 0.8rem !important;
  padding: 8px 12px !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.verse-popup__more div[onclick*="viewChapter"] {
  cursor: pointer !important;
  color: #4f46e5 !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.verse-popup__more div[onclick*="viewChapter"]:hover {
  text-decoration: underline !important;
}

.verse-popup__more div[onclick*="copy"] {
  cursor: pointer !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  padding: 2px 7px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  transition: all 0.12s ease !important;
}

.verse-popup__more div[onclick*="copy"]:hover {
  background: #e2e8f0 !important;
}

/* ==========================================================================
   Bible Panel & Verse Popup Z-Index Elevation
   The assessment modal overlay sits at z-index: 10000. All Bible UI must
   stack above it so it is never buried behind the quiz screen.
   ========================================================================== */

/* Bible search panel always above assessment modal */
#biblia,
.search-window-cover {
  z-index: 20000 !important;
}

/* Verse popup and context popup above everything */
#verse-popup,
.verse-popup {
  z-index: 30000 !important;
}

/* Commentary / context menus that appear within the Bible panel */
#popup,
#commentarybox {
  z-index: 30000 !important;
}

/* Reinforce when modal body lock is active */
body.asmt-modal-open #biblia,
body.asmt-modal-open .search-window-cover {
  z-index: 20000 !important;
}

body.asmt-modal-open #verse-popup,
body.asmt-modal-open .verse-popup {
  z-index: 30000 !important;
}
