/* Modal progress overlay used by thumbnail regeneration / missing-thumbnail generation */

.tp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 18, 0.72);
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.2s ease;
}

.tp-overlay[hidden] {
  display: none;
}

.tp-panel {
  width: min(460px, calc(100vw - 48px));
  padding: 24px 26px 20px;
  border-radius: 16px;
  background: #23233a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: #fff;
  text-align: center;
}

.tp-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.tp-phase {
  margin: 0 0 16px;
  font-size: 13px;
  color: #b6b6c8;
  min-height: 18px;
}

.tp-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.tp-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #28a745 0%, #4fd675 100%);
  transition: width 0.25s ease;
}

/* Indeterminate phases (purging, loading model data) sweep instead of filling */
.tp-track.tp-indeterminate .tp-fill {
  width: 35%;
  transition: none;
  animation: tp-sweep 1.1s ease-in-out infinite;
}

@keyframes tp-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

.tp-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: #d5d5e4;
  font-variant-numeric: tabular-nums;
}

.tp-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

/* The global `button` rule is display:flex/width:90% with no auto margins, which
   pins the button to the left edge of the panel. Override for action buttons. */
.tp-cancel,
.tp-background {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 130px;
  margin: 0;
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tp-cancel {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff3b30 100%);
}

.tp-cancel:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #ff7b7b 0%, #ff4b40 100%);
  box-shadow: 0 6px 18px rgba(255, 59, 48, 0.35);
}

.tp-background {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.tp-background:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #5a6578 0%, #3d4758 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.tp-cancel:disabled,
.tp-background:disabled {
  opacity: 0.5;
  cursor: default;
}
