/* Nominations page — school enrollment index */

/* Two-column AM/PM session grid inside a disclosure card */
.nominations-sessions-grid {
  display: flex;
  align-items: stretch;
}

.nominations-sessions-grid>turbo-frame {
  flex: 1;
  min-width: 0;
}

.nominations-sessions-grid>turbo-frame:not(:last-child) {
  border-right: var(--border-width) solid var(--color-border);
}

/* Report variant (no turbo-frames) */
.nominations-sessions-grid--report>div {
  flex: 1;
  min-width: 0;
}

.nominations-sessions-grid--report>div:not(:last-child) {
  border-right: var(--border-width) solid var(--color-border);
}

.nominations-session-section {
  border-bottom: var(--border-width) solid var(--color-border);
}

.nominations-sessions-grid .nominations-session-section {
  border-bottom: none;
}

@media (max-width: 1500px) {
  .nominations-sessions-grid {
    flex-direction: column;
  }

  .nominations-sessions-grid>turbo-frame {
    width: 100%;
    flex: none;
  }

  .nominations-sessions-grid>turbo-frame:not(:last-child) {
    border-right: none;
    border-bottom: var(--border-width) solid var(--color-border);
  }

  .nominations-sessions-grid--report>div {
    width: 100%;
    flex: none;
  }

  .nominations-sessions-grid--report>div:not(:last-child) {
    border-right: none;
    border-bottom: var(--border-width) solid var(--color-border);
  }

  .nominations-sessions-grid .nominations-session-section {
    border-bottom: var(--border-width) solid var(--color-border);
  }

  .nominations-sessions-grid .nominations-session-section:last-child {
    border-bottom: none;
  }
}

.nominations-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  background: var(--color-background-alt);
  border-bottom: var(--border-width) solid var(--color-border);
}

.nominations-session-inline-error {
  padding: 0.5rem 1.25rem;
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  font-size: 0.875rem;
  border-top: var(--border-width) solid var(--color-border);
}

.nominations-session-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-dark);
}

.nominations-session-meta {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

/* Add-student row at the bottom of each session section */
.nominations-add-row {
  padding: 0.625rem;
  background: var(--color-background-alt);
  border-top: var(--border-width) solid var(--color-border);
}

.nominations-add-form {
  display: flex;
  align-items: center;
}

.nominations-add-fields {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.nominations-add-select {
  flex: 1;
}

/* Student combobox — searchable input with filtered dropdown */
.student-combobox {
  position: relative;
  flex: 1;
}

.student-combobox__input {
  width: 100%;
}

.student-combobox__dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  z-index: 200;
  background: white;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.student-combobox__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.4;
}

.student-combobox__option:hover:not(.student-combobox__option--disabled) {
  background: var(--color-gray-50);
}

.student-combobox__option--highlighted {
  background: var(--color-primary);
  color: white;
}

.student-combobox__option--highlighted .student-combobox__option-note {
  color: rgba(255, 255, 255, 0.75);
}

.student-combobox__option--disabled {
  cursor: default;
  color: var(--color-text-muted);
}

.student-combobox__option-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-combobox__option--disabled .student-combobox__option-name {
  font-weight: 400;
}

.student-combobox__option-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  font-style: italic;
}

.student-combobox__empty {
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* Neutral alternate count pill */
.alternate-pill {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-gray-100);
  border: var(--border-width) solid var(--color-gray-200);
  border-radius: var(--border-radius-full);
  padding: 0.125rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Enrollment progress summary bar */
.enrollment-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-background-alt);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius-lg);
}

.enrollment-progress__bar-wrap {
  flex: 1;
}

.enrollment-progress__bar {
  height: 6px;
  background: var(--color-gray-200);
  border-radius: var(--border-radius-full);
  overflow: hidden;
}

.enrollment-progress__bar-fill {
  height: 100%;
  width: var(--fill-pct, 0%);
  background: var(--color-success);
  border-radius: var(--border-radius-full);
  transition: width 0.3s ease;
}

.enrollment-progress__stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.enrollment-progress__stat {
  font-size: 0.8125rem;
  font-weight: 500;
}

.enrollment-progress__stat--attention {
  color: var(--color-warning);
}

.enrollment-progress__stat--complete {
  color: var(--color-text-light);
}

/* School submission progress rows (admin enrollment cycle detail) */
.school-progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
}

.school-progress-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.school-progress-row__name {
  flex: 1;
  font-weight: 600;
}

.school-progress-row__stat {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Yes/check indicator icon color (IEP, 504, ELL columns) */
.icon-yes {
  color: var(--color-success);
}

/* Negative/absent flag in IEP, 504, ELL columns */
.flag-cell__empty {
  color: color-mix(in srgb, var(--color-text-muted) 50%, transparent);
}

/* Per-program status icons */
.enrollment-status-icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  align-self: center;
}

.enrollment-status-icon--complete {
  color: var(--color-success);
}

.enrollment-status-icon--attention {
  color: var(--color-warning);
}

.enrollment-status-icon--empty {
  color: var(--color-gray-200);
}

/* Locked-alternate badge tooltip (CSS-only, shown on hover) */
.locked-alternate-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: default;
}

.locked-alternate-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-gray-800, #1f2937);
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 0.375rem 0.625rem;
  border-radius: var(--border-radius-sm);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  display: none;
  z-index: 10;
}

.locked-alternate-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-top-color: var(--color-gray-800, #1f2937);
  pointer-events: none;
  display: none;
  z-index: 11;
}

.locked-alternate-icon:hover::after,
.locked-alternate-icon:hover::before {
  display: block;
}

/* ── Nomination row animations ───────────────────────────────────────────── */

/* New row: slides in from slightly above with a green-tinted flash */
@keyframes nom-row-enter {
  0% {
    background-color: transparent;
  }

  20% {
    background-color: color-mix(in srgb, var(--color-primary) 14%, transparent);
  }

  80% {
    background-color: color-mix(in srgb, var(--color-primary) 14%, transparent);
  }

  100% {
    background-color: transparent;
  }
}

/* Changed row: pulses with a blue highlight (lock / unlock) */
@keyframes nom-row-highlight {
  0% {
    background-color: transparent;
  }

  25% {
    background-color: color-mix(in srgb, var(--color-primary) 14%, transparent);
  }

  75% {
    background-color: color-mix(in srgb, var(--color-primary) 14%, transparent);
  }

  100% {
    background-color: transparent;
  }
}

/* Flash row: blue pulse (successful reorder) */
@keyframes nom-row-flash {
  0% {
    background-color: transparent;
  }

  20% {
    background-color: color-mix(in srgb, var(--color-primary) 14%, transparent);
  }

  80% {
    background-color: color-mix(in srgb, var(--color-primary) 14%, transparent);
  }

  100% {
    background-color: transparent;
  }
}

tr.nom-row--enter td {
  animation: nom-row-enter 1.2s ease-out both;
}

tr.nom-row--highlight td {
  animation: nom-row-highlight 1.8s ease-in-out both;
}

tr.nom-row--flash td {
  animation: nom-row-flash 1.4s ease-in-out both;
}

/* Section loading shimmer while a reorder request is in-flight */
@keyframes nom-section-loading {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

tbody.drag-order--loading {
  pointer-events: none;
  animation: nom-section-loading 0.9s ease-in-out infinite;
}

/* ── Drag-and-drop reordering of nomination rows ─────────────────────────── */
.drag-handle {
  cursor: grab;
  color: var(--color-text-muted, #9ca3af);
  font-size: 1rem;
  user-select: none;
  text-align: center;
  padding: 0.5rem 1rem !important;
  transition: color 0.15s ease;
}

.drag-handle:hover {
  color: var(--color-text, #374151);
}

.drag-handle:active {
  cursor: grabbing;
}

/* The row being dragged is hidden — a placeholder takes its place */
tr.drag-order--dragging {
  display: none;
}

/* Placeholder row shown at the current drop position */
tr.drag-order__placeholder td {
  background-color: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border-top: 2px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
}