/* Modular CSS slice extracted from style.css (2870-3587) */
.sg-page-tab-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.sg-page-tab-btn.active {
  background: #1e293b;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(15,23,42,0.18);
}

.sg-page-tab-badge {
  font-size: 0.68rem;
  padding: 0.05rem 0.35rem;
  border-radius: 9999px;
  font-weight: 700;
}

.sg-page-tab-btn.active .sg-page-tab-badge {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

.sg-page-tab-btn:not(.active) .sg-page-tab-badge {
  background: #f1f5f9;
  color: #475569;
}

.sg-rubric-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.sg-rubric-card:hover {
  transform: translateX(3px);
  border-color: #3b82f6 !important;
  box-shadow: 0 2px 6px rgba(59,130,246,0.12);
}

.speedgrader-canvas-viewport {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 1.5rem;
  position: relative;
  background: #f8fafc;
}

/* AnnotationViewer rendered inside SpeedGrader viewport (no toolbar mode) */
.speedgrader-canvas-viewport .viewer-canvas-area {
  width: 100%;
  height: 100%;
  align-items: flex-start;
  touch-action: pan-y pinch-zoom;
}

.speedgrader-canvas-viewport .document-page-image {
  max-height: 60vh;
}

.speedgrader-right-pane {
  background: var(--studio-surface);
  border: 1px solid var(--studio-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  max-height: 100%;
  align-self: stretch;
  height: 100%;
  color: var(--studio-text);
}

/* SpeedGrader Visual Rubric & Lightbox */
.sg-tab-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.sg-tab-btn:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
  color: var(--text-primary, #0f172a);
}

.sg-tab-btn.active {
  background: #ffffff;
  border-color: var(--border-color, #e2e8f0);
  color: var(--primary-color, #2563eb);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  font-weight: 600;
}

.sg-visual-rubric-pane {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sg-visual-rubric-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(241, 245, 249, 0.5);
  border: 1px dashed var(--border-color, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-secondary, #64748b);
}

.sg-visual-rubric-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.sg-visual-rubric-item {
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.sg-visual-rubric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

.sg-visual-rubric-img-wrap {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.sg-visual-rubric-img-wrap:hover img {
  transform: scale(1.02);
}

.sg-visual-rubric-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.2s ease;
}

/* Lightbox Modal */
.sg-rubric-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.sg-rubric-lightbox-modal.active {
  display: flex;
}

.sg-rubric-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
}

.sg-rubric-lightbox-dialog {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

.sg-rubric-lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: #f8fafc;
}

.sg-rubric-lightbox-title {
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  font-size: 0.95rem;
}

.sg-rubric-lightbox-body {
  padding: 1rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}

/* --- SPOTLIGHT COMMAND PALETTE (⌘K) --- */
.spotlight-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 10150;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.spotlight-backdrop.active {
  display: flex;
}

.spotlight-modal {
  width: 100%;
  max-width: 620px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  animation: spotlightPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spotlightPop {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.spotlight-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
}

.spotlight-input {
  flex: 1;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.spotlight-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--fast-transition);
}

.spotlight-item:hover, .spotlight-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* --- ALL MODALS (LEGACY COMPATIBILITY) --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex !important;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#modal-add-variant,
#modal-upload-rubric-files,
#modal-rubric-export {
  z-index: 10090 !important;
}

#modal-create-class,
#modal-edit-class {
  z-index: 10050;
}

#modal-edit-variant-content {
  z-index: 10090;
}

/* ==========================================================================
   CAMERA SCANNER VIEWPORT & CONTROLS (AUTOGRADING Live Document Scanner)
   ========================================================================== */
#modal-camera-scanner {
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#modal-camera-scanner .camera-modal-container {
  background: #090d16;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl, 20px);
  max-width: 680px;
  width: 95vw;
  max-height: 92vh;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  position: relative;
}

/* Top bar: Glassmorphic icon buttons and live status pill */
.camera-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  z-index: 10;
}

.btn-camera-glass-icon {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
}

.btn-camera-glass-icon:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: scale(1.05);
}

.camera-title-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.camera-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: cameraPulse 1.8s infinite;
}

@keyframes cameraPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Live Viewfinder */
.camera-viewfinder-box {
  background: #000000;
  border-radius: var(--radius-lg, 12px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  flex: 1;
}

.camera-viewfinder-box video#camera-video-stream {
  width: 100%;
  height: 100%;
  max-height: 58vh;
  object-fit: contain;
  display: block;
}

/* Visual Flash Effect on Shutter Tap */
@keyframes cameraShutterFlashAnim {
  0% {
    opacity: 0.85;
  }
  30% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
  }
}

.camera-shutter-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.2s ease-out;
}

.camera-shutter-flash.flash-active {
  animation: cameraShutterFlashAnim 0.25s ease-out forwards;
}

/* Document Frame Corner Guides (4 corners) */
.camera-doc-frame {
  position: absolute;
  inset: 16px;
  pointer-events: none;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.doc-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(255, 255, 255, 0.85);
  border-style: solid;
}

.corner-tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: 6px; }
.corner-tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: 6px; }
.corner-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 6px; }
.corner-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 6px; }

.doc-hint-badge {
  align-self: center;
  margin-top: auto;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Filmstrip Tray for multi-page captures */
.camera-filmstrip-tray {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.4rem;
  overflow-x: auto;
  scrollbar-width: thin;
  align-items: center;
  z-index: 10;
}

#modal-camera-scanner:not(.active) {
  display: none !important;
}

.camera-filmstrip-item {
  position: relative;
  width: 56px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid #4f46e5;
  background: #1e293b;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.camera-filmstrip-item img.filmstrip-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-filmstrip-item .filmstrip-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.camera-filmstrip-item .filmstrip-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  font-size: 0.62rem;
  text-align: center;
  color: #fff;
  font-weight: 700;
  padding: 2px 0;
}

.camera-filmstrip-item .btn-remove-filmstrip {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Bottom Action Bar */
.camera-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  gap: 0.75rem;
  z-index: 10;
}

.camera-bottom-side {
  flex: 1;
  display: flex;
  align-items: center;
}

.camera-bottom-side.left {
  justify-content: flex-start;
}

.camera-bottom-side.right {
  justify-content: flex-end;
}

.camera-status-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.camera-status-indicator .captured-count-num {
  color: #38bdf8;
  font-weight: 800;
}

.camera-bottom-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Tactile Shutter Button Ring */
.camera-shutter-trigger {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 4px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease;
  outline: none;
}

.camera-shutter-trigger:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.45);
}

.camera-shutter-trigger .shutter-inner-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.15s ease;
}

.camera-shutter-trigger:active .shutter-inner-circle {
  transform: scale(0.88);
}

/* Clean Finish Button: Never wrap, clear contrast */
.camera-finish-btn {
  white-space: nowrap !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 0.65rem 1.15rem !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

#modal-reset-student-password {
  z-index: 260;
}

#modal-reset-student-password .modal-content {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: modalPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}


.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  padding: 2rem;
  box-shadow: var(--shadow-float);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}
