/**
 * bento-speedgrader-rubric.css - AutoGrading Breakthrough Rubric & Feedback Inspection Ergonomics
 * Focus: High-density 40px Unified Action Dock, Streamlined Navigator Strip, and Split 50/50 Focus Inspector.
 */

/* 1. UNIFIED ACTION DOCK (2-Tier Executive Ergonomics) */
.sg-unified-action-dock {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 9px;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.35rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

[data-theme="dark"] .sg-unified-action-dock,
body.dark-mode .sg-unified-action-dock {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

/* Tier 1: Assessment Core Dock */
.sg-assessment-core-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 28px;
  width: 100%;
}

.sg-scoring-dock-left {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.sg-score-capsule {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 1px 3px;
  flex-shrink: 0 !important;
}

[data-theme="dark"] .sg-score-capsule,
body.dark-mode .sg-score-capsule {
  background: #0f172a;
  border-color: #334155;
}

.sg-score-capsule input.form-control {
  width: 38px !important;
  height: 24px !important;
  padding: 0 1px !important;
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  text-align: center !important;
  border: none !important;
  background: transparent !important;
  color: #082850 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .sg-score-capsule input.form-control,
body.dark-mode .sg-score-capsule input.form-control {
  color: #38bdf8 !important;
}

.sg-score-denom-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.sg-ai-disclaimer-icon {
  font-size: 0.75rem;
  cursor: help;
  opacity: 0.85;
  margin-left: 2px;
}

.btn-sg-pager-nav {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-sg-pager-nav:hover {
  background: #f8fafc;
  border-color: var(--primary, #00c5df);
  color: var(--primary, #00c5df);
}

[data-theme="dark"] .btn-sg-pager-nav,
body.dark-mode .btn-sg-pager-nav {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.btn-sg-save-capsule {
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 7px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.btn-sg-grade-cta {
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 8px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.btn-sg-grade-cta[style*="display: none"] {
  display: none !important;
}

/* Tier 2: Reading Modes & Utility Strip */
.sg-reading-utility-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 26px;
  width: 100%;
  padding-top: 0.28rem;
  border-top: 1px dashed var(--bento-border, #e2e8f0);
}

[data-theme="dark"] .sg-reading-utility-strip,
body.dark-mode .sg-reading-utility-strip {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.sg-reading-utility-strip .sg-rubric-view-filter-bar {
  flex: 1;
  min-width: 0;
}

.sg-utility-tools-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.sg-scoring-dock-right {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.sg-dock-btn {
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 6px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

#btn-sg-regrade-ai,
#btn-sg-open-rubric-quick,
#btn-sg-toggle-all-rubrics {
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.sg-dock-btn:hover {
  border-color: var(--primary, #00c5df) !important;
  color: var(--primary, #00c5df) !important;
}

/* Backward compatibility fallback classes */
.speedgrader-right-pane .sg-sticky-cta-dock,
.sg-scoring-capsule-row,
.ai-pedagogical-disclaimer-pill {
  display: none !important;
}

/* 2. STREAMLINED NAVIGATOR STRIP (Question Ribbon + Reading Mode Filter) */
.sg-navigator-strip {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.sg-question-ribbon {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 0.1rem 0.05rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.sg-question-ribbon::-webkit-scrollbar {
  display: none;
}

.sg-q-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.4rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

[data-theme="dark"] .sg-q-chip,
body.dark-mode .sg-q-chip {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.sg-q-chip:hover {
  border-color: var(--primary, #00c5df);
  color: var(--primary, #00c5df);
}

.sg-q-chip.active {
  background: #ecfeff;
  border-color: var(--primary, #00c5df);
  color: #082850;
  box-shadow: 0 1px 3px rgba(0, 197, 223, 0.15);
}

[data-theme="dark"] .sg-q-chip.active,
body.dark-mode .sg-q-chip.active {
  background: rgba(0, 197, 223, 0.2);
  border-color: #38bdf8;
  color: #e0f2fe;
}

.sg-q-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sg-q-chip-dot.correct { background: #16a34a; }
.sg-q-chip-dot.partial { background: #ca8a04; }
.sg-q-chip-dot.incorrect { background: #dc2626; }

/* Segmented View Mode Filter */
.sg-rubric-view-filter-bar {
  display: flex;
  background: #f1f5f9;
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

[data-theme="dark"] .sg-rubric-view-filter-bar,
body.dark-mode .sg-rubric-view-filter-bar {
  background: #0f172a;
}

.sg-view-filter-btn {
  flex: 1;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.2rem;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.sg-view-filter-btn.active {
  background: #ffffff;
  color: var(--primary, #00c5df);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .sg-view-filter-btn.active,
body.dark-mode .sg-view-filter-btn.active {
  background: #1e293b;
  color: #38bdf8;
}

/* 3. HIGH-PRODUCTIVITY RUBRIC CARDS & CALLOUT TYPOGRAPHY */
.sg-rubric-card {
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 9px;
  background: var(--bento-surface, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .sg-rubric-card,
body.dark-mode .sg-rubric-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

.sg-rubric-card.highlight-target {
  border-color: var(--primary, #00c5df) !important;
  box-shadow: 0 0 0 2px rgba(0, 197, 223, 0.25) !important;
}

.sg-rubric-header {
  padding: 0.4rem 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
}

[data-theme="dark"] .sg-rubric-header,
body.dark-mode .sg-rubric-header {
  background: #0f172a;
}

.sg-rubric-card.open .sg-rubric-header {
  border-bottom-color: var(--bento-border, #e2e8f0);
}

.sg-rubric-card:not(.open) .sg-rubric-body {
  display: none !important;
}

.sg-rubric-card.open .sg-rubric-body {
  display: block !important;
  padding: 0.55rem;
}

/* Structured AI Feedback Callouts */
.rubric-callout-feedback {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #78350f;
}

[data-theme="dark"] .rubric-callout-feedback,
body.dark-mode .rubric-callout-feedback {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  border-left-color: #f59e0b;
}

.rubric-callout-criteria {
  background: #f0fdf4;
  border-left: 3px solid #10b981;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #064e3b;
}

[data-theme="dark"] .rubric-callout-criteria,
body.dark-mode .rubric-callout-criteria {
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
  border-left-color: #10b981;
}

.rubric-callout-solution {
  background: #f8fafc;
  border-left: 3px solid #6366f1;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #1e1b4b;
}

[data-theme="dark"] .rubric-callout-solution,
body.dark-mode .rubric-callout-solution {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border-left-color: #818cf8;
}

/* 4. SPLIT 50/50 TRUE FOCUS INSPECTOR MODE */
.speedgrader-studio-layout.rubric-expanded {
  grid-template-columns: 52px 1fr 1fr !important;
}

@media (max-width: 1024px) {
  .speedgrader-studio-layout.rubric-expanded {
    grid-template-columns: 52px 1fr minmax(460px, 1fr) !important;
  }
}

.btn-sg-expand-rubric.active {
  background: var(--primary, #00c5df) !important;
  color: #ffffff !important;
  border-color: var(--primary, #00c5df) !important;
}

/* 5. RESPONSIVE TEXT COLLAPSE ON NARROW DOCKS (<= 1280px) */
@media (max-width: 1280px) {
  .btn-sg-expand-rubric .sg-expand-text {
    display: none !important;
  }
  .btn-sg-expand-rubric {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    padding: 0 !important;
  }
  .sg-reading-utility-strip .sg-view-filter-btn .sg-filter-label {
    display: none !important;
  }
  .sg-reading-utility-strip .sg-view-filter-btn {
    padding: 0.18rem 0.25rem !important;
    font-size: 0.72rem !important;
  }
}

.speedgrader-studio-layout.rubric-expanded .sg-reading-utility-strip .sg-view-filter-btn .sg-filter-label {
  display: inline !important;
}

@media (min-width: 1281px) {
  .speedgrader-studio-layout.rubric-expanded .btn-sg-expand-rubric .sg-expand-text {
    display: inline !important;
  }
}

