/* WellPlate Component Styles */

.mint-well-plate {
  user-select: none;
}

.mint-well-plate--inline {
  display: inline-block;
}

.mint-well-plate--fill {
  width: 100%;
}

.mint-well-plate__scroll {
  overflow-x: auto;
}

.mint-well-plate__content {
  display: inline-block;
}

.mint-well-plate--fill .mint-well-plate__content {
  display: block;
  width: 100%;
}

/* Table - reset consumer/framework styles (VitePress, Tailwind preflight, etc.) */
.mint-well-plate__table {
  display: table !important;
  overflow: visible !important;
  border-collapse: separate;
  border: none !important;
  margin: 0 !important;
  user-select: none;
  -webkit-user-select: none;
}

.mint-well-plate__table thead {
  display: table-header-group !important;
}

.mint-well-plate__table tbody {
  display: table-row-group !important;
}

.mint-well-plate__table tr {
  border: none !important;
  background: transparent !important;
}

.mint-well-plate__table th,
.mint-well-plate__table td {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

/* Header cells */
.mint-well-plate__col-header,
.mint-well-plate__row-header {
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
}

.mint-well-plate__row-header {
  vertical-align: middle;
}

/* Well cell */
.mint-well-plate__cell {
  padding: 0;
}

/* Well */
.mint-well-plate__well {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  background-color: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
}

.mint-well-plate__well--rounded {
  border-radius: var(--radius-md);
}

.mint-well-plate__well--circle {
  border-radius: 9999px;
}

.mint-well-plate__well--filled {
  border-style: solid;
}

.mint-well-plate__well--disabled {
  opacity: var(--mint-disabled-opacity);
  cursor: not-allowed;
}

/* Well states */
.mint-well-plate__well--selected {
  box-shadow: 0 0 0 2px var(--mint-success), 0 0 0 3px var(--bg-card);
}

.mint-well-plate__well--drag-over {
  box-shadow: 0 0 0 2px var(--color-primary);
  background-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.mint-well-plate__well--hovered {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint-success) 50%, transparent);
}

.mint-well-plate__well--drag-source {
  box-shadow: 0 0 0 2px var(--mint-warning);
  opacity: 0.5;
}

.mint-well-plate__well--drag-target {
  box-shadow: 0 0 0 2px var(--mint-success), 0 0 0 3px var(--bg-card);
  background-color: color-mix(in srgb, var(--mint-success) 20%, transparent);
}

/* Optional semantic classes for `wellClass` callbacks. */
.mint-well-plate__well--outlier {
  box-shadow: inset 0 0 0 1.6px var(--mint-warning);
}

.mint-well-plate__well--conflict {
  box-shadow: inset 0 0 0 1.6px var(--mint-error);
}

/* Draggable well — explicit -webkit-user-drag for Chrome inside <table> cells */
.mint-well-plate__well--draggable {
  cursor: grab;
  -webkit-user-drag: element;
}

.mint-well-plate__well--draggable:active {
  cursor: grabbing;
}

/* Well label */
.mint-well-plate__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  padding: 0 2px;
  pointer-events: none;
  color: var(--text-primary);
}

/* Sample type indicator */
.mint-well-plate__indicator {
  font-weight: 700;
  pointer-events: none;
  color: var(--text-primary);
}

/* Well ID text */
.mint-well-plate__well-id {
  font-weight: 500;
  pointer-events: none;
  color: var(--text-primary);
}

/* Condition header - drug label row */
.mint-well-plate__condition-label {
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  padding: 2px 4px !important;
}

/* Condition cell - inner span with gradient bg (avoids table !important reset) */
.mint-well-plate__condition-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

/* Row condition label cell (rotated text) */
.mint-well-plate__row-condition-label {
  text-align: center;
  vertical-align: middle;
  padding: 0 !important;
  position: relative;
  height: 1px; /* Trick: allows absolute child to use 100% height in rowspan cells */
}

.mint-well-plate__row-condition-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mint-well-plate__row-condition-text {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

/* Heatmap legend */
.mint-well-plate__legend {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.mint-well-plate__legend-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mint-well-plate__legend-bar {
  flex: 1;
  height: 0.75rem;
  border-radius: 0.125rem;
  overflow: hidden;
  display: flex;
  min-width: 0;
}

.mint-well-plate__legend-segment {
  flex: 1;
}

/* Badge (injection count / custom method indicator) */
.mint-well-plate__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  pointer-events: none;
  line-height: 1;
}

/* Sample type legend bar */
.mint-well-plate__sample-legend {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 0.25rem;
}

.mint-well-plate__sample-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.mint-well-plate__sample-legend-dot {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.mint-well-plate__sample-legend-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Empty / loading / error placeholder host (content comes from EmptyState) */
.mint-well-plate__state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
}
