/* static/css/calculators/linear-algebra/matrix_power_calculator.css */

/* ─── dimension controls ─── */
.dim-inputs {
  text-align: center;
  margin-bottom: 16px;
}
.dim-inputs label {
  margin: 0 10px;
  font-weight: 500;
}
.dim-inputs input {
  width: 60px;
  padding: 4px;
  font-size: 1rem;
  text-align: center;
}
.dim-inputs button {
  padding: 2px 6px;
  font-size: .8rem;
  cursor: pointer;
  border-radius: 4px;
}

/* ─── matrix + exponent ─── */
.matrix-power-container {
  position: relative;
  display: inline-block;
}
.power-sup {
  position: absolute;
  top: -10px;
  right: -50px;
  width: 40px;
  padding: 2px;
  font-size: 0.8rem;
  text-align: center;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
}

/* ─── matrix styling ─── */
.matrices-area {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.matrix-block {
  text-align: center;
  margin: 0 10px;
}
.matrix-title {
  margin-bottom: 8px;
  font-weight: 600;
}
.matrix-wrapper {
  --cell-size: 40px;
  display: inline-block;
  position: relative;
  padding: 8px;
  vertical-align: middle;
}
.matrix-wrapper table {
  border-collapse: separate;
  border-spacing: 1px;
}
.matrix-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border: 1px solid #999;
  box-sizing: border-box;
  /* ensure content doesn’t wrap inside default cells */
  white-space: nowrap;
}
.cell-input {
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  text-align: center;
  font-size: 1rem;
  outline: none;
  background: transparent;
  box-sizing: border-box;
}
.matrix-wrapper::before,
.matrix-wrapper::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 4px;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
}
.matrix-wrapper::before {
  left: 0;
  border-left: 2px solid #333;
  border-radius: 4px 0 0 4px;
}
.matrix-wrapper::after {
  right: 0;
  border-right: 2px solid #333;
  border-radius: 0 4px 4px 0;
}

/* ─── answer box & buttons ─── */
.answer-box {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}
.answer-box strong {
  font-weight: 700;
}
.solve-button:hover {
  background-color: #2980b9;
}

/* ─── flex-wrapper for expand steps ─── */
.expand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ─── enlarge only wide-cells matrices ─── */
.matrix-wrapper.wide-cells {
  /* height remains controlled by --cell-size, but width is auto */
  --cell-size: 80px;
}
.matrix-wrapper.wide-cells .matrix-cell {
  /* ensure no wrapping and let content dictate width */
  white-space: nowrap;
  width: auto;
  min-width: max-content;
  padding: 8px;
}
