/* Modular CSS slice extracted from style.css (3588-4306) */
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
  transition: var(--fast-transition);
}

.form-control:focus {
  border-color: var(--primary, #0284c7);
  box-shadow: 0 0 0 3px rgba(0, 197, 223, 0.25);
}

/* Grading Workspace Modal */
.workspace-modal {
  width: 95vw;
  max-width: 1560px;
  height: 92vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.workspace-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.viewer-pane {
  flex: 3;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  position: relative;
}

.viewer-toolbar {
  height: 48px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-btn {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--fast-transition);
}

.tool-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.viewer-canvas-area {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 1.5rem;
  position: relative;
  background: #f1f5f9;
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 20px 20px;
}

.document-page-wrapper {
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease-out;
  background: #ffffff;
}

.document-page-image {
  max-width: 100%;
  max-height: 75vh;
  display: block;
}

.grading-pane {
  flex: 2;
  background: #ffffff;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.question-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: var(--fast-transition);
}

.question-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.q-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.q-score-input {
  width: 60px;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-align: center;
}

.q-feedback {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.q-correction {
  font-size: 0.8rem;
  color: #1e40af;
  background: #eff6ff;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-top: 0.35rem;
}

.score-overview-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.total-score-badge {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  font-family: var(--font-heading);
}

.teacher-comment-box {
  margin-top: 0.5rem;
}


/* Mobile Bottom Navigation Dock */
.mobile-bottom-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 1100;
  align-items: center;
  justify-content: space-around;
  pointer-events: auto;
}

.dock-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--fast-transition);
  padding: 0.35rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.dock-item:hover {
  color: var(--text-main);
}

.dock-item.active {
  color: var(--primary);
  font-weight: 700;
}

.dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-icon svg {
  stroke: currentColor;
}

/* Floating Action Button (FAB) */
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 72px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--primary-glow);
  align-items: center;
  justify-content: center;
  z-index: 95;
  cursor: pointer;
  transition: var(--fast-transition);
}

.mobile-fab:hover {
  transform: scale(1.05);
}

/* Toast Container - Elevated Above All Modals (Apple-Grade Haute-Tech Toast) */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 110000;
  pointer-events: none;
  max-width: min(92vw, 440px);
}

.toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-md, 12px);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toastIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  word-break: break-word;
}

.toast-success {
  background: rgba(6, 78, 59, 0.94);
  border-color: rgba(52, 211, 153, 0.35);
  color: #ecfdf5;
  box-shadow: 0 12px 32px -4px rgba(6, 78, 59, 0.45), 0 0 0 1px rgba(52, 211, 153, 0.2);
}

.toast-error {
  background: rgba(127, 29, 29, 0.94);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fef2f2;
  box-shadow: 0 12px 32px -4px rgba(127, 29, 29, 0.45), 0 0 0 1px rgba(248, 113, 113, 0.2);
}

.toast-warning {
  background: rgba(120, 53, 15, 0.94);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fffbeb;
  box-shadow: 0 12px 32px -4px rgba(120, 53, 15, 0.45), 0 0 0 1px rgba(251, 191, 36, 0.2);
}

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

@media (max-width: 768px) {
  .toast-container {
    top: 1rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(92vw, 420px);
    align-items: center;
  }
}

/* --- RESPONSIVE ADAPTATIONS (HAUTE-TECH PRECISION) --- */
@media (max-width: 1200px) {
  .bento-hud-grid { grid-template-columns: repeat(2, 1fr); }
  .speedgrader-studio-layout { grid-template-columns: 200px 1fr 300px; }
}

@media (max-width: 1024px) {
  .cockpit-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-float);
    z-index: 150;
  }
  .cockpit-sidebar.open {
    transform: translateX(0);
  }
  .btn-sidebar-toggle { display: inline-flex; }
  .spotlight-trigger-box { min-width: 160px; }
  .speedgrader-studio-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .studio-topbar { padding: 0 0.85rem; }
  .workspace-container { padding: 0.85rem 0.85rem 5.5rem 0.85rem; }
  .spotlight-trigger-box { display: none; }
  .breadcrumb-trail #bc-school,
  .breadcrumb-trail #bc-year,
  .breadcrumb-trail .breadcrumb-sep:nth-of-type(1),
  .breadcrumb-trail .breadcrumb-sep:nth-of-type(2) {
    display: none;
  }
  .bento-hud-grid { grid-template-columns: 1fr; }
  .exam-hero-bar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .mobile-bottom-dock { display: flex; }
  .mobile-fab { display: flex; }
}

@media (max-width: 540px) {
  .studio-topbar { padding: 0 0.65rem; gap: 0.5rem; }
  .breadcrumb-trail #bc-school,
  .breadcrumb-trail #bc-year,
  .breadcrumb-trail #bc-subject,
  .breadcrumb-trail .breadcrumb-sep {
    display: none !important;
  }
  .breadcrumb-trail #bc-class {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
  }
  .topbar-actions {
    gap: 0.35rem;
  }
  #btn-create-exam span {
    display: none;
  }
  #btn-create-exam {
    padding: 0.45rem 0.6rem;
  }
  #btn-batch-grade span {
    font-size: 0.75rem;
  }
  .modal-content {
    margin: 1rem 0.5rem;
    padding: 1.25rem;
  }
}

/* ==========================================================================
   VIEW WORK BUTTON - Distinctive Action Button for Viewing Submissions
   ========================================================================== */
.btn-view-work {
  background: var(--primary-light, #ecfeff) !important;
  color: var(--brand-navy, #082850) !important;
  border: 1.5px solid var(--primary, #00c5df) !important;
  font-weight: 700 !important;
  transition: all 0.15s ease;
}
.btn-view-work:hover {
  background: var(--primary, #00c5df) !important;
  color: var(--brand-navy, #082850) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 197, 223, 0.35);
}

/* ==========================================================================
   EXAM SHEET VIEWER - Modern Card-Based Document Viewer
   ========================================================================== */
.exam-sheet-card {
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  overflow: hidden;
  max-width: 100%;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  background: white;
  transition: box-shadow 0.2s ease;
}
.exam-sheet-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.exam-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bento-card-bg, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  gap: 0.5rem;
}

.exam-sheet-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--border-color, #e2e8f0);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s ease, transform 0.1s ease;
  cursor: pointer;
  color: inherit;
}
.exam-sheet-action-btn:hover {
  background: var(--primary-color, #2563eb);
  color: white;
  transform: scale(1.08);
}

.exam-sheet-image {
  max-width: 100%;
  max-height: 700px;
  display: block;
  object-fit: contain;
  margin: 0 auto;
  background: #f8fafc;
  cursor: zoom-in;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.exam-sheet-image:hover {
  opacity: 0.96;
}

#btn-modal-view-create-rubric:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.exam-file-fallback {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
  line-height: 1.8;
  background: #fef2f2;
  border-radius: 0 0 10px 10px;
}
.exam-file-fallback a {
  color: var(--primary-color, #2563eb);
  text-decoration: underline;
  font-weight: 600;
}

@media (max-width: 600px) {
  .exam-sheet-header {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
  .exam-sheet-image {
    max-height: 500px;
  }
  .exam-sheet-action-btn {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   PORTAL FLOW GRID RESPONSIVE
   ========================================================================== */
.portal-flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .portal-flow-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ==========================================================================
   MULTI-VARIANT EXAM & RUBRIC VIEWER STYLES (NEO-MINIMALISM BENTO HUB)
   ========================================================================== */
.variant-hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.variant-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.variant-hub-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.variant-hub-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.variant-hub-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.variant-hub-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.variant-hub-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

/* Backward-compatible legacy fallback class */
.modal-variant-ribbon {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: visible !important;
}

.variant-chips-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  overflow: visible !important;
}

.variant-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border-color, #cbd5e1);
  background: #ffffff;
  color: var(--text-main, #1e293b);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.variant-chip:hover {
  border-color: #6366f1;
  background: #f5f7ff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.12);
}

.variant-chip.active {
  border-color: #4f46e5;
  background: #eff6ff;
  color: #312e81;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.18);
  position: relative;
}

.variant-chip-badge {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--text-muted, #64748b);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.variant-chip.active .variant-chip-badge {
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
}

/* Scientific matrix micro styling when 6+ variants are loaded */
.variant-hub-grid.matrix-mode .variant-chip {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 6px;
}

.dual-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.upload-field-card {
  border-radius: var(--radius-md, 8px);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-field-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
