/* =====================================================================
 * cashout.css — animated cashout button
 * Drop-in: <link rel="stylesheet" href="assets/css/cashout.css">
 * ====================================================================*/

.cashout-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 160px;
}

.co-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: linear-gradient(180deg, #1f2937 0%, #0f172a 100%);
  color: #f3f4f6;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease, box-shadow .25s ease,
              border-color .25s ease, filter .2s ease;
  overflow: hidden;
}

.co-btn .co-label  { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.co-btn .co-amount { font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.co-btn .co-meta   { font-size: 10px; opacity: .65; }

/* ------------------ STATES ----------------- */

/* Disabled / unavailable */
.co-btn.co-disabled,
.co-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(.6);
  opacity: .55;
  box-shadow: none;
}

/* PROFIT — green glow + slow breathing pulse */
.co-btn.co-profit {
  border-color: rgba(16, 185, 129, .55);
  background: linear-gradient(180deg, #064e3b 0%, #022c22 100%);
  color: #d1fae5;
  box-shadow:
    0 0 0  1px rgba(16,185,129,.30) inset,
    0 0 18px rgba(16,185,129,.45),
    0 0 36px rgba(16,185,129,.25);
  animation: coBreatheGreen 2.4s ease-in-out infinite;
}
.co-btn.co-profit::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(120% 60% at 50% 0%, rgba(16,185,129,.25), transparent 70%);
  pointer-events: none;
}

/* LOSS-MITIGATION — yellow urgent pulse */
.co-btn.co-loss {
  border-color: rgba(234, 179, 8, .55);
  background: linear-gradient(180deg, #78350f 0%, #451a03 100%);
  color: #fef3c7;
  box-shadow:
    0 0 0 1px rgba(234,179,8,.35) inset,
    0 0 14px rgba(234,179,8,.55);
  animation: coPulseYellow 1.05s ease-in-out infinite;
}

/* BREAKEVEN — neutral hover */
.co-btn.co-breakeven {
  border-color: rgba(148,163,184,.35);
  background: linear-gradient(180deg, #1e293b 0%, #0b1220 100%);
  color: #e2e8f0;
}
.co-btn.co-breakeven:hover { border-color: rgba(191,0,255,.55); }

/* BUSY — confirming */
.co-btn.co-busy {
  pointer-events: none;
  animation: coBusySpin 1.2s linear infinite;
  color: #fff;
  background: linear-gradient(90deg, #4c1d95, #6d28d9, #4c1d95);
  background-size: 200% 100%;
}

/* DONE — locked-in green */
.co-btn.co-done {
  cursor: default;
  border-color: rgba(34,197,94,.6);
  background: linear-gradient(180deg, #14532d, #052e16);
  color: #bbf7d0;
  animation: none;
  box-shadow: 0 0 0 1px rgba(34,197,94,.4) inset;
}

/* hover lift */
.co-btn:not(:disabled):not(.co-done):hover { transform: translateY(-1px); }
.co-btn:not(:disabled):active { transform: translateY(0); }

/* Reason text under the button */
.co-reason {
  font-size: 11px;
  color: #fca5a5;
  text-align: center;
  line-height: 1.3;
  padding: 2px 4px;
}

/* ------------------ KEYFRAMES ----------------- */
@keyframes coBreatheGreen {
  0%, 100% { box-shadow:
      0 0 0  1px rgba(16,185,129,.30) inset,
      0 0 18px rgba(16,185,129,.45),
      0 0 36px rgba(16,185,129,.25); }
  50%      { box-shadow:
      0 0 0  1px rgba(16,185,129,.50) inset,
      0 0 26px rgba(16,185,129,.75),
      0 0 56px rgba(16,185,129,.45); }
}
@keyframes coPulseYellow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(234,179,8,.35) inset,
                          0 0 12px rgba(234,179,8,.55); }
  50%      { box-shadow: 0 0 0 1px rgba(234,179,8,.65) inset,
                          0 0 28px rgba(234,179,8,.95); }
}
@keyframes coBusySpin {
  from { background-position: 0%   0%; }
  to   { background-position: 200% 0%; }
}
