/* modals.css — Export and re-encode progress modals */

#export-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: exportModalIn 0.2s ease both;
}

@keyframes exportModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#export-modal-card {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  min-width: 280px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#export-modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

#export-progress-track {
  height: 6px;
  background: var(--surface-hover);
  border-radius: 3px;
  overflow: hidden;
}

#export-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.15s ease;
}

#export-progress-pct {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

body.no-blur #export-modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(0, 0, 0, 0.7);
}

body.no-blur #export-modal-card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface);
}

/* Re-encode Modal */

#reencode-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: exportModalIn 0.2s ease both;
}

#reencode-modal-card {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  min-width: 280px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#reencode-modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

#reencode-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

#reencode-progress-track {
  height: 6px;
  background: var(--surface-hover);
  border-radius: 3px;
  overflow: hidden;
}

#reencode-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.15s ease;
}

#reencode-progress-pct {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

body.no-blur #reencode-modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(0, 0, 0, 0.7);
}

body.no-blur #reencode-modal-card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface);
}

/* Motion Analysis Modal */

#motion-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: exportModalIn 0.2s ease both;
}

#motion-modal-card {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  min-width: 280px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#motion-modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

#motion-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

#motion-progress-track {
  height: 6px;
  background: var(--surface-hover);
  border-radius: 3px;
  overflow: hidden;
}

#motion-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.15s ease;
}

#motion-progress-pct {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

body.no-blur #motion-modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(0, 0, 0, 0.7);
}

body.no-blur #motion-modal-card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface);
}

/* Overlay Adjust Modal */

#overlay-adjust-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: exportModalIn 0.2s ease both;
}

#overlay-adjust-card {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#overlay-adjust-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

#overlay-adjust-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

#overlay-adjust-canvas {
  display: block;
  max-width: 75vw;
  max-height: 65vh;
}

.overlay-drag-handle {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(74, 124, 255, 0.15);
  border-radius: 6px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  user-select: none;
  touch-action: none;
  z-index: 1;
}

.overlay-drag-handle.dragging {
  cursor: grabbing;
  border-color: var(--yellow);
  background: rgba(255, 214, 10, 0.2);
  color: var(--yellow);
}

#overlay-adjust-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Tab bar (visible only in sticky-scores mode) */
#overlay-adjust-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.oa-tab {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.oa-tab.active {
  background: rgba(74, 124, 255, 0.15);
  color: var(--accent);
}

.oa-tab:hover:not(.active) {
  color: rgba(255, 255, 255, 0.75);
}

/* Sticky scores panel */
#oa-panel-sticky {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.oa-widget-hint {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  text-align: center;
}

#sticky-label-offset-widget {
  position: relative;
  width: 200px;
  height: 250px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: visible;
}

#sticky-target-canvas {
  display: block;
  width: 200px;
  height: 250px;
  border-radius: 8px;
}

#sticky-label-handle {
  min-width: 52px;
  height: 24px;
  position: absolute;
}

#sticky-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 200px;
}

.oa-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  user-select: none;
}

.oa-toggle-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

body.no-blur #overlay-adjust-modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(0, 0, 0, 0.7);
}

body.no-blur #overlay-adjust-card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface);
}

/* Export Tails Modal */

#export-tails-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: exportModalIn 0.2s ease both;
}

#export-tails-card {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: min(560px, 90vw);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#export-tails-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

#export-tails-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

#export-tails-video-wrap {
  position: relative;
  border-radius: 6px;
  background: #000;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

#export-tails-video {
  display: block;
  width: 100%;
  height: 100%;
}

#export-tails-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#export-tails-canvas {
  cursor: crosshair;
}

#export-tails-waveform-wrap {
  position: relative;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#export-tails-canvas {
  display: block;
  width: 100%;
  height: 64px;
}

.export-tails-handle {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 10px;
  background: rgba(74, 124, 255, 0.65);
  border: 2px solid var(--accent);
  border-radius: 3px;
  cursor: ew-resize;
  z-index: 2;
  touch-action: none;
}

.export-tails-handle:hover,
.export-tails-handle.dragging {
  background: rgba(74, 124, 255, 0.85);
}

#export-tails-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  padding: 0 2px;
  font-variant-numeric: tabular-nums;
}

#export-tails-info strong {
  color: var(--text);
}

#export-tails-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
}

#export-tails-play {
  margin-right: auto;
}

body.no-blur #export-tails-modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(0, 0, 0, 0.7);
}

body.no-blur #export-tails-card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface);
}

/* Track Targets Modal */

#track-targets-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  animation: exportModalIn 0.2s ease both;
}

#track-targets-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.25rem;
  width: calc(100vw - 2rem);
  max-width: calc(100vw - 2rem);
  height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

#track-targets-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

#track-targets-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

#track-targets-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.track-ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.track-ctrl-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.track-type-btns {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.track-type-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.track-type-btn:last-child {
  border-right: none;
}

.track-type-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.track-type-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}


#track-targets-canvas-wrap {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  cursor: crosshair;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

#track-targets-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

#track-targets-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

#track-targets-back {
  margin-right: auto;
}

