/* Photo Crew Assignment Modal — shared across gallery and referee pages */

.modal-overlay { display: none; position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.6); justify-content: center; align-items: center; padding: 16px; }
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-box h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.modal-box .modal-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.modal-box img { width: 100%; border-radius: 8px; margin-bottom: 16px; }

/* Cropper area */
.pe-img-wrapper { margin-bottom: 8px; }
.pe-img-wrapper img { width: 100%; border-radius: 8px; display: block; }
.pe-crop-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.pe-crop-toggle {
  font-size: 12px; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); cursor: pointer; color: var(--text-muted);
}
.pe-crop-toggle:hover { border-color: #aaa; color: var(--text); }
.pe-crop-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pe-crop-clear {
  font-size: 12px; padding: 4px 12px;
  border: 1px solid #fca5a5; border-radius: 6px;
  background: var(--card-bg); cursor: pointer; color: #dc2626;
}
.pe-crop-clear:hover { background: #fef2f2; }

/* Referee name links in photo crew lists */
.crew-ref-link:hover, .crew-ref-link:hover * { color: var(--owner-color, #E0218A) !important; }

/* Match linking */
.pe-matches-section { margin-bottom: 16px; }
.pe-matches-list { display: flex; flex-direction: column; gap: 4px; }
.pe-match-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; font-size: 12px; border-bottom: 1px solid var(--bg);
}
.pe-match-item:last-child { border-bottom: none; }
.pe-match-remove {
  background: none; border: none;
  color: #999; font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1;
  flex-shrink: 0;
}
.pe-match-remove:hover { color: #dc2626; }
.pe-add-match-btn {
  padding: 5px 10px; background: var(--accent); color: #fff;
  border: none; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.pe-add-match-btn:hover { opacity: 0.85; }

.pe-caption-field { margin-bottom: 16px; }
.modal-crew-list { list-style: none; margin-bottom: 16px; }
.modal-crew-list li { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--bg); font-size: 13px; border-radius: 6px; background: var(--card-bg); cursor: grab; }
.modal-crew-list li:active { cursor: grabbing; }
.modal-crew-list li:last-child { border-bottom: none; }
.modal-crew-list input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.modal-crew-list label { flex: 1; }
/* SortableJS ghost and chosen styles */
.modal-crew-list .sortable-ghost { opacity: 0.25; }
.modal-crew-list .sortable-chosen { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-actions button { padding: 7px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid var(--border); background: var(--card-bg); }
.modal-actions button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.modal-actions button.primary:hover { opacity: 0.85; }
.modal-actions button.danger { color: #dc2626; border-color: #fca5a5; }
.modal-actions button.danger:hover { background: #fef2f2; }
#pe-delete-btn { margin-left: auto; }
.modal-save-status { font-size: 12px; margin-top: 8px; }
.modal-save-status.ok { color: #16a34a; }
.modal-save-status.err { color: #dc2626; }
