/* ==========================================================================
   BENTO EXAM HUB SCALABLE DATA TABLE & MOBILE COMPACT LIST
   Engineered for 50-500+ Exams with High Information Density & Zero Lag
   ========================================================================== */

/* Search Box Container */
.exam-hub-search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 380px;
  background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 999px;
  padding: 0 0.85rem;
  height: 38px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.exam-hub-search-box-wrap:focus-within {
  border-color: var(--bento-accent-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: var(--bento-surface, #ffffff);
}

.exam-search-icon {
  color: var(--text-muted, #94a3b8);
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.exam-search-input-field {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-primary, #0f172a);
  font-family: inherit;
}

.exam-search-input-field::placeholder {
  color: var(--text-muted, #94a3b8);
}

.exam-search-clear {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.exam-search-clear:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Scalable Container */
.exam-hub-scalable-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Desktop Data Table */
.desktop-only-exam-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.exam-hub-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.exam-hub-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid var(--bento-border, #e2e8f0);
}

[data-theme="dark"] .exam-hub-table thead tr {
  background: #1e293b;
}

.exam-hub-table th {
  padding: 0.85rem 1rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.exam-hub-table-row {
  border-bottom: 1px solid var(--bento-border-subtle, #f1f5f9);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.exam-hub-table-row:last-child {
  border-bottom: none;
}

.exam-hub-table-row:hover {
  background: rgba(99, 102, 241, 0.04);
}

.exam-hub-table-row.active-row {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--bento-accent-primary, #6366f1);
}

.exam-hub-table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

/* Title Cell */
.exam-title-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.exam-title-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.exam-main-title {
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.exam-sub-info {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

/* Pills & Badges */
.scope-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.score-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 5px;
}

[data-theme="dark"] .score-badge {
  background: #334155;
  color: #cbd5e1;
}

/* Inline Progress */
.inline-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.inline-progress-track {
  width: 70px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

[data-theme="dark"] .inline-progress-track {
  background: #334155;
}

.inline-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.inline-progress-stats {
  font-size: 0.76rem;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
}

/* Status Pills */
.exam-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.exam-status-pill.status-done {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.exam-status-pill.status-pending {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.exam-status-pill.status-empty {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

[data-theme="dark"] .exam-status-pill.status-done {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .exam-status-pill.status-pending {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-theme="dark"] .exam-status-pill.status-empty {
  background: rgba(100, 116, 139, 0.2) !important;
  color: #94a3b8 !important;
  border-color: rgba(100, 116, 139, 0.3) !important;
}


/* Mobile Only Compact List */
.mobile-only-exam-list {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.exam-hub-mobile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.exam-hub-mobile-row:active {
  background: rgba(99, 102, 241, 0.06);
  transform: scale(0.99);
}

.exam-hub-mobile-row.active-mobile-row {
  border-color: var(--bento-accent-primary, #6366f1);
  background: rgba(99, 102, 241, 0.05);
}

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

.mob-row-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.mob-exam-title {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-exam-sub {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-scope-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
}

.mob-sep {
  color: #cbd5e1;
}

.mob-row-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.mob-chevron {
  color: #94a3b8;
  font-size: 1.15rem;
  font-weight: 300;
}

[data-theme="dark"] .exam-hub-mobile-row {
  background: #09234e !important;
  border-color: rgba(0, 197, 223, 0.16) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .exam-hub-mobile-row:active {
  background: #0d2c60 !important;
  border-color: #38bdf8 !important;
}

[data-theme="dark"] .mob-exam-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .mob-exam-sub {
  color: #94a3b8 !important;
}

[data-theme="dark"] .mob-sep {
  color: #475569 !important;
}

[data-theme="dark"] .mob-scope-tag {
  background: rgba(0, 197, 223, 0.15) !important;
  color: #38bdf8 !important;
}


/* ==========================================================================
   TIME NAVIGATOR RIBBON & MONTH STEPPER
   ========================================================================== */
.exam-hub-time-navigator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.time-stepper-box {
  display: inline-flex;
  align-items: center;
  background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 8px;
  padding: 2px 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-time-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #475569);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-time-nav:hover {
  background: #f1f5f9;
  color: var(--bento-accent-primary, #6366f1);
}

[data-theme="dark"] .btn-time-nav:hover {
  background: #334155;
}

.time-stepper-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  padding: 0 0.5rem;
  white-space: nowrap;
}

.time-scope-select-wrap {
  display: inline-flex;
  align-items: center;
}

.time-scope-dropdown {
  background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.time-scope-dropdown:focus {
  border-color: var(--bento-accent-primary, #6366f1);
}

/* ==========================================================================
   PAGINATION CONTROLS
   ========================================================================== */
.exam-hub-pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bento-surface, #ffffff);
  border-top: 1px solid var(--bento-border-subtle, #f1f5f9);
  border-radius: 0 0 12px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary, #475569);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-page-step {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--bento-border, #e2e8f0);
  background: #ffffff;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page-step:hover:not(:disabled) {
  border-color: var(--bento-accent-primary, #6366f1);
  color: var(--bento-accent-primary, #6366f1);
  background: rgba(99, 102, 241, 0.04);
}

.btn-page-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-page-num {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page-num:hover {
  background: #f1f5f9;
  color: var(--text-primary, #0f172a);
}

.btn-page-num.active {
  background: var(--bento-accent-primary, #6366f1);
  color: #ffffff;
  font-weight: 700;
}

.mobile-page-indicator {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  padding: 0 0.4rem;
}

.desktop-only-flex {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mobile-only-flex {
  display: none;
}

.desktop-only-text {
  display: block;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .desktop-only-exam-table {
    display: none !important;
  }
  .mobile-only-exam-list {
    display: flex !important;
  }
  .exam-hub-search-box-wrap {
    max-width: 100%;
    margin-bottom: 0.5rem;
  }
  .bento-exam-hub-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }
  .exam-hub-header-actions {
    margin-left: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }
  .exam-hub-view-modes {
    display: none !important;
  }
  .bento-view-switcher:not(.exam-hub-view-modes) {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .bento-view-switcher .btn-bento-view {
    justify-content: center !important;
    font-size: 0.76rem !important;
    padding: 0.4rem 0.2rem !important;
  }
  .btn-hub-create,
  #btn-hub-create-exam {
    width: 100% !important;
    justify-content: center !important;
    min-height: 40px !important;
    border-radius: 980px !important;
    font-size: 0.85rem !important;
  }
  .bento-filter-ribbon,
  .exam-hub-filter-ribbon {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }
  .exam-hub-time-navigator {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 0.35rem !important;
  }
  .exam-hub-status-filter,
  .bento-segmented-group.exam-hub-status-filter {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    width: 100% !important;
  }
  .time-stepper-box {
    flex: 1;
    justify-content: space-between;
  }
  .time-stepper-label {
    flex: 1;
    text-align: center;
  }
  .exam-hub-card,
  .bento-exam-hub-card {
    padding-bottom: calc(var(--mobile-dock-height, 70px) + 50px) !important;
  }
  .desktop-only-text, .desktop-only-flex {
    display: none !important;
  }
  .mobile-only-flex {
    display: flex !important;
    align-items: center;
  }
  .exam-hub-pagination-wrap {
    justify-content: center;
    border-radius: 10px;
    margin-top: 0.5rem;
  }
}

/* ==========================================================================
   SUBMISSIONS TABLE: STREAMLINED ACTIONS & FLOATING POPOVER MENU
   ========================================================================== */

.sub-row-action-popover {
  position: absolute;
  display: none;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 0.35rem;
  min-width: 220px;
  max-width: 260px;
  z-index: 9999;
  box-sizing: border-box;
}

[data-theme="dark"] .sub-row-action-popover,
body.dark-mode .sub-row-action-popover {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.sub-row-action-popover.open {
  display: flex !important;
  flex-direction: column;
  gap: 2px;
}

.sub-more-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.42rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--bento-text-main, #1e293b);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

[data-theme="dark"] .sub-more-item,
body.dark-mode .sub-more-item {
  color: #f1f5f9;
}

.sub-more-item:hover,
.sub-more-item:focus {
  background: rgba(0, 197, 223, 0.1);
  color: #082850;
  outline: none;
}

[data-theme="dark"] .sub-more-item:hover,
body.dark-mode .sub-more-item:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.sub-more-item-danger {
  color: #ef4444 !important;
}

.sub-more-item-danger:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

[data-theme="dark"] .sub-more-item-danger:hover,
body.dark-mode .sub-more-item-danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

.sub-more-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  width: 18px;
  display: inline-flex;
  justify-content: center;
}

.sub-more-divider {
  height: 1px;
  background: var(--bento-border, #e2e8f0);
  margin: 0.25rem 0.35rem;
}

[data-theme="dark"] .sub-more-divider,
body.dark-mode .sub-more-divider {
  background: rgba(255, 255, 255, 0.08);
}

.btn-sub-row-more {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  color: #64748b !important;
}

.btn-sub-row-more:hover,
.btn-sub-row-more.active {
  background: #e2e8f0 !important;
  color: #082850 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-sub-row-more:hover,
body.dark-mode .btn-sub-row-more:hover,
[data-theme="dark"] .btn-sub-row-more.active,
body.dark-mode .btn-sub-row-more.active {
  background: #334155 !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

