/* static/css/common/matrix.css */

/* --- Matrix Picker Overlay --- */
.matrix-picker {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(10, 24px);
  grid-template-rows: repeat(10, 24px);
  gap: 2px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #ccc;
  padding: 8px;
  z-index: 1000;
}

.matrix-picker .cell {
  width: 24px;
  height: 24px;
  border: 1px solid #ddd;
  cursor: pointer;
}

.matrix-picker .cell.hovered {
  background: #eef;
}


/* --- Inserted Matrix Styling with stretchable brackets --- */
.matrix {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  margin: 0 8px;               /* breathing room */
}

/* Bracket pseudo-elements */
.matrix::before,
.matrix::after {
  content: "";
  position: absolute;
  width: 8px;                  /* bracket thickness */
  height: calc(100% + 8px);    /* stretch beyond table height */
  top: -4px;                   /* center the overshoot vertically */
  border: 2px solid currentColor;
}

/* Left bracket: no right border */
.matrix::before {
  left: -10px;                 /* position just outside table */
  border-right: none;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

/* Right bracket: no left border */
.matrix::after {
  right: -10px;
  border-left: none;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* The matrix table itself */
.matrix table {
  border-collapse: collapse;
}

.matrix td {
  padding: 2px;
}

/* Individual editable cells */
.matrix-cell {
  width: 40px;
  height: 30px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  text-align: center;
  font-size: 14px;
}
