/* Table Container - Same pattern as ParticipantList */
.image-approval-table-container {
  background: #FFFBF4;
  padding: 0;
  padding-bottom: 60px; /* Extra padding to prevent overlap with clip-path */
  border-radius: 12px;
  border-collapse: collapse;
  width: 100%;
  min-height: 200px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    100% 95%,
    60% 95%,
    55% 100%,
    0 100%
  );
}

/* Header - Gold background matching design */
.image-approval-header {
  background: #D9A128;
  color: #ffffff;
  font-weight: bold;
  display: grid;
  grid-template-columns: 120px minmax(80px, 140px) minmax(80px, 140px) 150px 1fr 1fr 60px;
  border-bottom: 2px solid #ddd;
}

.image-approval-header > div {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 14px;
  margin: 0;
  padding: 9px 15px; /* Match ParticipantList padding */
}

/* Rows - White background */
.image-approval-row {
  display: grid;
  grid-template-columns: 120px minmax(80px, 140px) minmax(80px, 140px) 150px 1fr 1fr 60px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  align-items: center;
  justify-content: flex-start;
  /* background: white; */
  transition: background 0.2s ease-in-out;
}

.image-approval-row:hover {
  background: #f9f9f9;
}

.image-approval-row > div {
  font-size: 12px;
  margin-left: 19px; /* Match ParticipantList margin */
  padding: 0; /* Remove padding, use margin instead */
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Circular Profile Image: outer circle with inner padding so the photo appears smaller */
.profile-image-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  display: block;
}

/* Actions inner: flex row, centred, tight gap for black check + X pair */
.image-approval-actions-inner {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

/* Action Buttons: base circle (compact size) */
.action-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

/* Approved: green outline circle, green checkmark inside (outline style) */
.action-btn--approved {
  background: transparent;
  color: #28a745;
  border: 2px solid #28a745;
}

.action-btn--approved:hover {
  background: transparent;
  color: #28a745;
  border-color: #28a745;
}

/* Rejected: red circle outline, red X inside (outline style) */
.action-btn--rejected {
  background: transparent;
  color: #dc3545;
  border-color: #dc3545;
  border-width: 2px;
  cursor: default;
}

.action-btn--rejected:hover {
  background: transparent;
  color: #dc3545;
  transform: none;
}

/* Edit: outline circle, gray/black icon (right of approve/reject) */
.action-btn--edit {
  background: transparent;
  color: #555;
  border-color: #555;
}

.action-btn--edit:hover:not(:disabled) {
  border-color: #333;
  color: #333;
  background: #f5f5f5;
  transform: scale(1.05);
}

.action-btn--edit:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Revert: outline circle, blue/teal icon (restores to original) */
.action-btn--revert {
  background: transparent;
  color: #17a2b8;
  border-color: #17a2b8;
}

.action-btn--revert:hover:not(:disabled) {
  border-color: #138496;
  color: #138496;
  background: #e8f7fa;
  transform: scale(1.05);
}

.action-btn--revert:disabled,
.action-btn--revert.action-btn--disabled {
  cursor: not-allowed;
  opacity: 0.4;
  color: #999;
  border-color: #ccc;
}

.action-btn--revert.action-btn--disabled:hover {
  transform: none;
  background: transparent;
  color: #999;
  border-color: #ccc;
}

/* Pending: black outline circle, black icon (check + X pair) */
.action-btn--pending {
  background: transparent;
  color: #333;
  border-color: #333;
}

.action-btn--pending:hover:not(:disabled) {
  border-color: #000;
  color: #000;
  background: #f5f5f5;
  transform: scale(1.05);
}

.action-btn--pending:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Reason Dropdown */
.reason-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  background: white;
}

.reason-select:focus {
  outline: none;
  border-color: #D9A128;
}

.reason-select:disabled,
.notes-input:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Notes Input */
.notes-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
}

.notes-input:focus {
  outline: none;
  border-color: #D9A128;
}

.notes-input::placeholder {
  color: #999;
}

/* Notification Button */
.notify-btn {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  transition: color 0.2s;
}

.notify-btn:hover:not(:disabled) {
  color: #D9A128;
}

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

/* Sort Header - Same as ParticipantList */
.sort-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

.sort-header .sort-icon {
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  font-size: 12px;
}

.sort-header:hover .sort-icon {
  opacity: 1;
}

.sort-header.sorted .sort-icon {
  opacity: 1;
}

/* Column widths */
.col-image {
  justify-content: center;
  margin-left: 0; /* Override margin for centered image */
}

/* Actions: center header and row content under the Actions column */
.image-approval-header > div.col-actions,
.image-approval-row > div.col-actions {
  justify-content: center;
  margin-left: 0;
}

.col-notify {
  justify-content: center;
  margin-left: 0; /* Override margin for centered icon */
}

/* Ensure proper spacing for inputs and selects */
.col-reason,
.col-notes {
  padding-right: 10px; /* Add some right padding for form elements */
}

/* Clickable image trigger - row photo opens modal; fixed circle with centered smaller image (circular padding) */
.image-approval-photo-trigger {
  width: 50px;
  height: 50px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #FFFBF4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.image-approval-photo-trigger:hover .profile-image-circle {
  opacity: 0.85;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.image-approval-photo-trigger .profile-image-circle {
  transition: opacity 0.2s, box-shadow 0.2s;
}

/* Image preview modal */
.image-approval-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.image-approval-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-approval-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}

.image-approval-modal-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.image-approval-modal-img {
  max-width: 85vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.image-approval-modal-caption {
  margin: 10px 0 0;
  font-size: 14px;
  color: #555;
}

/* ========================================
   Image Cropper Modal Styles
   ======================================== */

.image-cropper-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 90vw;
  max-width: 700px;
  max-height: 90vh;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Revert confirmation modal: same as cropper content but compact width */
.image-approval-revert-modal-content {
  max-width: 420px;
}

/* Approve/Reject confirmation modal: slightly larger than revert */
.image-approval-approve-reject-modal-content {
  max-width: 520px;
}

.image-approval-revert-modal-body {
  padding: 16px 20px;
  font-size: 14px;
  color: #555;
}

.image-cropper-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.image-cropper-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

/* Cropper container - light neutral to match project */
.image-cropper-container {
  flex: 1;
  min-height: 400px;
  max-height: 60vh;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-cropper {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* Error message */
.image-cropper-error {
  padding: 10px 20px;
  background: #fff3f3;
  color: #dc3545;
  font-size: 14px;
  border-top: 1px solid #ffcdd2;
}

/* Modal footer */
.image-cropper-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
}

.image-cropper-footer-actions {
  display: flex;
  gap: 12px;
}

/* Cropper buttons */
.image-cropper-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-cropper-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-cropper-btn--reset {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
}

.image-cropper-btn--reset:hover:not(:disabled) {
  background: #f5f5f5;
  color: #333;
  border-color: #ccc;
}

.image-cropper-btn--cancel {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.image-cropper-btn--cancel:hover:not(:disabled) {
  background: #eee;
  color: #333;
}

.image-cropper-btn--save {
  background: #D9A128;
  color: #fff;
  border: none;
}

.image-cropper-btn--save:hover:not(:disabled) {
  background: #c89020;
}

.image-cropper-btn--save:disabled {
  background: #e0c278;
}

/* Override cropper library styles to match project theme */
.image-cropper .advanced-cropper {
  background: #e8e8e8;
}

.image-cropper .advanced-cropper__background {
  background: #e8e8e8;
}

.image-cropper .advanced-cropper__cropper {
  background: transparent;
}

/* ========================================
   Cropper Toolbar Styles
   ======================================== */

.image-cropper-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 20px;
  background: #f8f8f8;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-label {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  margin-right: 4px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.toolbar-btn:hover:not(:disabled) {
  background: #f0f0f0;
  border-color: #D9A128;
  color: #D9A128;
}

.toolbar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toolbar-slider {
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.toolbar-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #D9A128;
  cursor: pointer;
  border: none;
}

.toolbar-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #D9A128;
  cursor: pointer;
  border: none;
}

.toolbar-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toolbar-slider:disabled::-webkit-slider-thumb {
  cursor: not-allowed;
}

.toolbar-slider:disabled::-moz-range-thumb {
  cursor: not-allowed;
}

.toolbar-value {
  font-size: 13px;
  color: #666;
  min-width: 45px;
  text-align: left;
}

/* ========================================
   Advanced Cropper - Sidebar Layout
   ======================================== */

.image-cropper-main {
  display: flex;
  flex: 1;
  min-height: 400px;
  max-height: 60vh;
  overflow: hidden;
}

.image-cropper-sidebar {
  width: 60px;
  background: #f5f5f5;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 8px;
  flex-shrink: 0;
}

.sidebar-tool {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}

.sidebar-tool:hover:not(:disabled) {
  background: #eee;
  color: #333;
}

.sidebar-tool.active {
  background: #D9A128;
  color: #fff;
}

.sidebar-tool:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Update cropper container for sidebar layout */
.image-cropper-main .image-cropper-container {
  flex: 1;
  position: relative;
  min-height: 400px;
  max-height: 60vh;
}

/* ========================================
   Tool Panels (Flip & Aspect Ratio)
   ======================================== */

.tool-panel {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tool-panel button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  min-width: 100px;
}

.tool-panel button:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #D9A128;
  color: #333;
}

.tool-panel button.active {
  background: #D9A128;
  border-color: #D9A128;
  color: #fff;
}

.tool-panel button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ratio-panel button {
  justify-content: center;
}

/* ========================================
   Fine Rotation Slider
   ======================================== */

.fine-rotation-group {
  flex: 1;
  max-width: 200px;
}

.fine-rotation-slider {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.fine-rotation-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #D9A128;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.fine-rotation-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #D9A128;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.fine-rotation-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   Toolbar – aligned with project theme
   ======================================== */

.image-cropper-toolbar {
  background: #f8f8f8;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  gap: 12px;
  flex-wrap: wrap;
}

.image-cropper-toolbar .toolbar-btn {
  background: #fff;
  border-color: #ddd;
  color: #333;
}

.image-cropper-toolbar .toolbar-btn:hover:not(:disabled) {
  background: #f0f0f0;
  border-color: #D9A128;
  color: #D9A128;
}

.image-cropper-toolbar .toolbar-slider {
  background: #ddd;
}

.image-cropper-toolbar .toolbar-value {
  color: #666;
  min-width: 50px;
}

.image-cropper-toolbar .toolbar-group {
  gap: 6px;
}

/* ========================================
   Modal header/footer – project theme
   ======================================== */

.image-cropper-modal-footer {
  background: #fafafa;
  border-top: 1px solid #eee;
  justify-content: flex-end;
}

.image-cropper-modal-header {
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.image-cropper-modal-title {
  color: #333;
}

.image-cropper-modal-content {
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Cancel button – neutral, consistent with table actions */
.image-cropper-btn--cancel {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.image-cropper-btn--cancel:hover:not(:disabled) {
  background: #eee;
  color: #333;
}
