/* ============================================================
   Marty — add-transaction page (F3)
   Uses core tokens/components from app.css; page-only styles here.
   ============================================================ */

/* --------------------------------------------- quick add ---- */

.add-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  margin-bottom: 14px;
}
.add-quick input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  padding: 10px 0;
}
.add-quick input::placeholder { color: var(--muted); }
.add-quick-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: var(--green-soft);
  font-size: 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease, opacity .15s ease;
}
.add-quick-btn:active { transform: scale(.94); }
.add-quick-btn:disabled { opacity: .5; cursor: default; }

/* -------------------------------------------- draft hint ---- */

.add-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--amber-soft);
  color: #A96F1B;
  border: 1px solid rgba(232, 161, 60, .4);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
  animation: slide-up .2s ease;
}
.add-hint-text { flex: 1; }
.add-hint-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------- segmented control -- */

.add-seg {
  display: flex;
  background: var(--card);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.add-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, color .15s ease;
}
.add-seg-btn.active { background: var(--ink); color: #fff; }

/* ----------------------------------------- amount display --- */

.add-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 14px 12px 8px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
  min-height: 72px;
  /* font-size is set by JS and auto-shrinks as the number grows */
  transition: box-shadow .2s ease;
}
.add-amount-sym {
  font-size: .5em;
  font-weight: 700;
  color: var(--muted);
}
.add-amount-num {
  font-size: 1em;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  word-break: break-all;
}

/* ------------------------------------------------ keypad ---- */

.add-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 6px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.add-key {
  border: none;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 13px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease, background .15s ease;
}
.add-key:active { transform: scale(.96); background: var(--green-softer); }
.add-key-back { color: var(--muted); font-size: 19px; }

/* --------------------------------------- category picker ---- */

.add-cats {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scrollbar-width: none;
}
.add-cats::-webkit-scrollbar { display: none; }
.add-cat {
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 60px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.add-cat-ico {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--green-softer);
  transition: box-shadow .15s ease, transform .06s ease;
}
.add-cat:active .add-cat-ico { transform: scale(.94); }
.add-cat.active .add-cat-ico {
  box-shadow: 0 0 0 2.5px var(--card), 0 0 0 5.5px var(--cat-ring, var(--green));
}
.add-cat-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  max-width: 66px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.add-cat.active .add-cat-name { color: var(--ink); font-weight: 700; }

.add-cats-empty,
.add-accts-empty { font-size: 13.5px; padding: 4px 2px 8px; }

/* ---------------------------------------- account pickers --- */

.add-accts {
  flex-wrap: wrap;
  overflow: visible;
  padding: 4px 2px 8px;
}
.add-accts .chip {
  padding: 9px 14px;
  max-width: 100%;           /* long account names truncate instead of overflowing */
  overflow: hidden;
}
.add-accts .add-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.add-chip-cur {
  font-size: 11px;
  font-weight: 700;
  opacity: .65;
}

/* ----------------------------------------------- receipt ---- */

.add-receipt { margin: 2px 0 16px; }
.add-receipt-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
}
.add-receipt-preview img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.add-receipt-meta { flex: 1; min-width: 0; }
.add-receipt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}
.add-receipt-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------- save ---- */

.add-save {
  margin-top: 4px;
  padding: 15px 20px;
  font-size: 16px;
}

/* ------------------------------------- draft field glow -----
   Applied to fields the quick-add parser (or OCR) guessed.
   Declared last so it layers over .add-seg/.chip shadows. */

.draft-glow {
  box-shadow: 0 0 0 2.5px rgba(232, 161, 60, .65), var(--shadow);
  animation: draft-pulse .9s ease 1;
}
.add-cat.active .add-cat-ico.draft-glow {
  /* keep the colored selection ring visible under the glow */
  box-shadow:
    0 0 0 2.5px var(--card),
    0 0 0 5.5px var(--cat-ring, var(--green)),
    0 0 0 8.5px rgba(232, 161, 60, .5);
  animation: none;
}
@keyframes draft-pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 161, 60, 0), var(--shadow); }
  55% { box-shadow: 0 0 0 5px rgba(232, 161, 60, .8), var(--shadow); }
  100% { box-shadow: 0 0 0 2.5px rgba(232, 161, 60, .65), var(--shadow); }
}
