/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Visual Mapping Styles */

.visual-mapping-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mapping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.mapping-actions {
  display: flex;
  gap: 0.5rem;
}

.mapping-panels {
  display: flex;
  flex: 1;
  position: relative;
}

.source-panel, .target-panel {
  width: 33.333333%;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

.mapping-canvas {
  flex: 1;
  position: relative;
}

.connection-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.connection-svg .mapping-line {
  pointer-events: all;
}

.panel-header {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.panel-content {
  flex: 1;
  overflow: auto;
}

.search-input {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.mapping-field {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  margin: 0.25rem 0;
  border-radius: 0.25rem;
  cursor: grab;
  transition: background-color 0.2s;
  font-size: 0.875rem;
  gap: 0.5rem;
}

.mapping-field:hover {
  background-color: #f3f4f6;
}

.mapping-field.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.expand-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.expand-button:hover {
  color: #3b82f6;
}

.expand-spacer {
  width: 16px;
  flex-shrink: 0;
}

.field-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.field-name {
  font-weight: 500;
  color: #1f2937;
  flex-shrink: 0;
}

.field-type {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background-color: #e5e7eb;
  color: #6b7280;
  flex-shrink: 0;
}

.field-sample {
  font-size: 0.75rem;
  color: #9ca3af;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.field-children {
  margin-left: 0;
}

.target-field {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  margin: 0.5rem;
  padding: 0.75rem;
}

.target-field.drag-over {
  border-color: #3b82f6;
  background-color: #dbeafe;
}

.field-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.field-name-input {
  flex: 1;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.field-type-select {
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.remove-field-btn {
  width: 1.5rem;
  height: 1.5rem;
  color: #ef4444;
  background: none;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
}

.remove-field-btn:hover {
  background-color: #fee2e2;
}

.drop-zone {
  text-align: center;
  padding: 1rem;
  color: #6b7280;
  font-size: 0.875rem;
  border: 2px dashed #d1d5db;
  border-radius: 0.375rem;
}

.add-field-btn {
  width: calc(100% - 1rem);
  margin: 0.5rem;
  padding: 0.5rem;
  border: 2px dashed #d1d5db;
  background: none;
  color: #6b7280;
  border-radius: 0.375rem;
  cursor: pointer;
}

.add-field-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

@import "components/visual_mapping.css";
