/**
 * Mask Refinement Styles
 *
 * Styles for the mask refinement UI with positive/negative points
 * DEV FEATURE: Not yet ready for production
 */

/* ============================================
 * REFINEMENT TOOLBAR
 * ============================================ */
.refinement-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e6e1d8);
  border-radius: var(--radius-md, 20px);
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.refinement-toolbar.visible {
  opacity: 1;
  transform: translateY(0);
}

.refinement-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #1f2a2e);
}

.refinement-icon {
  font-size: 16px;
}

.refinement-modes {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft, #f1f1ea);
  border-radius: var(--radius-sm, 14px);
}

.refinement-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #5c6b72);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refinement-mode-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.refinement-mode-btn.active {
  background: var(--surface, #ffffff);
  color: var(--text, #1f2a2e);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.refinement-mode-btn.active[data-label="1"] {
  color: #16a34a; /* Green */
}

.refinement-mode-btn.active[data-label="0"] {
  color: #dc2626; /* Red */
}

.refinement-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.refinement-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm, 14px);
  background: var(--surface-soft, #f1f1ea);
  color: var(--text, #1f2a2e);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refinement-action-btn:hover {
  background: var(--accent, #2f7c72);
  color: white;
}

.refinement-action-btn[data-action="apply"] {
  background: var(--accent, #2f7c72);
  color: white;
}

.refinement-action-btn[data-action="apply"]:hover {
  background: var(--accent-strong, #3dd1b5);
}

.refinement-status {
  font-size: 12px;
  color: var(--muted, #5c6b72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

/* ============================================
 * REFINEMENT POINTS LIST
 * ============================================ */
.refinement-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e6e1d8);
  border-radius: var(--radius-md, 20px);
}

.refinement-empty {
  text-align: center;
  padding: 20px;
  color: var(--muted, #5c6b72);
  font-size: 13px;
}

.refinement-point-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-soft, #f1f1ea);
  border-radius: 8px;
  font-size: 13px;
}

.point-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.point-indicator.add {
  background: #16a34a; /* Green */
}

.point-indicator.remove {
  background: #dc2626; /* Red */
}

.point-coords {
  flex: 1;
  font-family: monospace;
  color: var(--muted, #5c6b72);
}

.point-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted, #5c6b72);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.point-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ============================================
 * CANVAS OVERLAY
 * ============================================ */
#overlay-canvas.refinement-active {
  cursor: crosshair;
}

#overlay-canvas.refinement-active[data-label="0"] {
  cursor: not-allowed;
}

/* ============================================
 * RESPONSIVE
 * ============================================ */
@media (max-width: 768px) {
  .refinement-toolbar {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .refinement-modes {
    order: 3;
    width: 100%;
    margin-top: 8px;
  }

  .refinement-actions {
    margin-left: auto;
  }

  .refinement-status {
    display: none;
  }

  .refinement-mode-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
  }

  .refinement-mode-btn .mode-text {
    display: none;
  }

  .refinement-action-btn .action-text {
    display: none;
  }
}

/* ============================================
 * ANIMATIONS
 * ============================================ */
@keyframes pulse-green {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}

@keyframes pulse-red {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

.refinement-point-item {
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
