/* ==========================================================
   AURUM private v2 — Phase 4.5 Full
   Premium drag, inline editing, row statuses and smart cells
   ========================================================== */

/* Premium drag */
.aurum-table-card .account-row {
  position: relative;
  transition:
    filter 150ms ease,
    opacity 150ms ease,
    box-shadow 150ms ease;
}

.aurum-table-card .account-row td {
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.aurum-table-card .account-row.dragging {
  z-index: 12;
  opacity: .9 !important;
  filter: brightness(1.13);
  transform: scale(1.006);
  transform-origin: center;
  box-shadow:
    0 15px 36px rgba(0, 0, 0, .3),
    inset 3px 0 0 var(--aurum-gold-bright);
}

.aurum-table-card .account-row.dragging td {
  background:
    linear-gradient(
      90deg,
      rgba(215, 177, 91, .18),
      rgba(215, 177, 91, .06)
    ) !important;
}

.aurum-table-card .account-row.drag-insert-before td {
  border-top: 2px solid var(--aurum-gold-bright) !important;
  box-shadow: inset 0 5px 10px rgba(215, 177, 91, .045);
}

.aurum-table-card .account-row.drag-insert-after td {
  border-bottom: 2px solid var(--aurum-gold-bright) !important;
  box-shadow: inset 0 -5px 10px rgba(215, 177, 91, .045);
}

/* Row-local status */
.aurum-table-card .account-row td:last-child {
  position: relative;
  padding-right: 82px !important;
}

.aurum-table-card .account-row td:last-child::after {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 8px;

  min-width: 58px;
  padding: 4px 7px;

  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;

  border: 1px solid transparent;
  border-radius: 999px;

  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;

  transform: translateY(-50%);
  pointer-events: none;
}

.aurum-table-card
.account-row.row-status-saving
td:last-child::after {
  display: inline-flex;
  color: var(--aurum-gold-bright);
  background: rgba(215, 177, 91, .1);
  border-color: rgba(215, 177, 91, .22);
  content: "• Сохраняется";
  animation: aurum-row-status-pulse 850ms ease-in-out infinite;
}

.aurum-table-card
.account-row.row-status-saved
td:last-child::after {
  display: inline-flex;
  color: #91e1ae;
  background: rgba(94, 201, 138, .09);
  border-color: rgba(94, 201, 138, .22);
  content: "✓ Сохранено";
}

.aurum-table-card
.account-row.row-status-error
td:last-child::after {
  display: inline-flex;
  color: #ff9da3;
  background: rgba(239, 111, 118, .1);
  border-color: rgba(239, 111, 118, .24);
  content: "× Ошибка";
}

@keyframes aurum-row-status-pulse {
  0%,
  100% {
    opacity: .55;
  }

  50% {
    opacity: 1;
  }
}

/* Smart empty values */
.aurum-table-card
.editable-cell.is-empty-value:not(.editing)::before {
  color: var(--aurum-muted);
  opacity: .52;
  content: "—";
}

.aurum-table-card
.editable-cell.is-empty-value:not(.editing) {
  font-size: 0 !important;
}

.aurum-table-card
.editable-cell.is-empty-value:not(.editing)::before {
  font-size: 13px;
}

/* Long cell values */
.aurum-table-card .editable-cell {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aurum-table-card .editable-cell.editing,
.aurum-table-card .editable-cell:focus {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

/* Premium focus */
.aurum-table-card .editable-cell.editing {
  transform: scale(1.012);
  transform-origin: center;
  box-shadow:
    inset 0 0 0 1px rgba(240, 204, 114, .52),
    0 0 0 3px rgba(215, 177, 91, .075),
    0 8px 20px rgba(0, 0, 0, .12) !important;
}

/* Softer row appearance after operations */
.aurum-table-card .account-row.is-row-entering td {
  animation: aurum-row-enter 240ms ease both;
}

.aurum-table-card .account-row.is-row-removing td {
  animation: aurum-row-remove 180ms ease both;
}

@keyframes aurum-row-enter {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes aurum-row-remove {
  to {
    opacity: 0;
    transform: translateX(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurum-table-card .account-row,
  .aurum-table-card .account-row td,
  .aurum-table-card .editable-cell {
    transition: none !important;
    animation: none !important;
  }
}
