/* ═══════════════════════════════════════════════════
   PLEDGE — Custom Styles
   Cash App-simple. DeFi-grade. Elysium Chain.
   ═══════════════════════════════════════════════════ */

/* ── Base overrides for pledge page ─────────────── */
.pledge-page {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* ── Card glow on hover ──────────────────────────── */
.pledge-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(30,30,46,0.5);
  transition: box-shadow 0.3s ease;
}

.pledge-card:hover {
  box-shadow: 0 4px 24px rgba(124,58,237,0.08), 0 0 0 1px rgba(30,30,46,0.5);
}

/* ── Collateral Button States ────────────────────── */
.collateral-btn {
  cursor: pointer;
}

.collateral-btn.active {
  border-color: rgba(139, 92, 246, 0.5) !important;
  background: rgba(124, 58, 237, 0.08) !important;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255,255,255,0.03);
}

.collateral-btn.active .collateral-check {
  opacity: 1 !important;
}

/* ── Borrow Asset Toggle ─────────────────────────── */
.borrow-asset-btn {
  color: #4a4a5a;
}

.borrow-asset-btn.active {
  background: rgba(124, 58, 237, 0.2);
  color: #8b5cf6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── Health Bar ──────────────────────────────────── */
.health-bar-fill {
  position: relative;
}

.health-bar-fill.safe {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.health-bar-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.health-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
  animation: dangerPulse 1s ease-in-out infinite;
}

@keyframes dangerPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.health-bar-shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.08) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmerMove 2s linear infinite;
}

@keyframes shimmerMove {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Health Badge ────────────────────────────────── */
#healthBadge.safe {
  border-color: rgba(16,185,129,0.4);
  background: rgba(16,185,129,0.08);
}
#healthBadge.safe #healthBadgeLabel { color: #10b981; }
#healthBadge.safe #healthDot        { background: #10b981; }

#healthBadge.warn {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.08);
}
#healthBadge.warn #healthBadgeLabel { color: #f59e0b; }
#healthBadge.warn #healthDot        { background: #f59e0b; animation: dangerPulse 1.5s ease-in-out infinite; }

#healthBadge.danger {
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.08);
}
#healthBadge.danger #healthBadgeLabel { color: #ef4444; }
#healthBadge.danger #healthDot        { background: #ef4444; animation: dangerPulse 0.8s ease-in-out infinite; }

/* ── Liq Price coloring ──────────────────────────── */
#statLiqPrice.safe   { color: #10b981; }
#statLiqPrice.warn   { color: #f59e0b; }
#statLiqPrice.danger { color: #ef4444; }

#modalLiqPrice.safe   { color: #10b981; }
#modalLiqPrice.warn   { color: #f59e0b; }
#modalLiqPrice.danger { color: #ef4444; }

/* ── CTA Button ──────────────────────────────────── */
.pledge-cta-btn:disabled {
  background: rgba(30,30,46,0.6);
  color: #4a4a5a;
  border: 1px solid rgba(30,30,46,0.8);
  cursor: not-allowed;
}

.pledge-cta-btn:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6, #7c3aed);
  background-size: 200% 100%;
  color: #ffffff;
  border: 1px solid rgba(139,92,246,0.5);
  box-shadow: 0 0 30px rgba(124,58,237,0.3), 0 4px 15px rgba(0,0,0,0.3);
  animation: btnGradient 3s ease infinite;
}

.pledge-cta-btn:not(:disabled):hover {
  box-shadow: 0 0 50px rgba(124,58,237,0.5), 0 4px 20px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}

.pledge-cta-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 0 20px rgba(124,58,237,0.3);
}

@keyframes btnGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.pledge-cta-shine {
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.08) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: shineMove 3s linear infinite;
}

@keyframes shineMove {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Rate Cards ──────────────────────────────────── */
.rate-card {
  transition: all 0.2s ease;
}

.rate-card:hover {
  border-color: rgba(139,92,246,0.3);
  background: rgba(124,58,237,0.05);
}

/* ── Position Cards ──────────────────────────────── */
.position-card {
  transition: all 0.2s ease;
}

.position-card:hover {
  border-color: rgba(139,92,246,0.3);
}

/* ── Modal Sheet ─────────────────────────────────── */
.modal-sheet {
  animation: sheetUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Toast ───────────────────────────────────────── */
#successToast:not(.hidden) {
  animation: toastIn 0.4s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes toastIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

/* ── Number flash ────────────────────────────────── */
@keyframes numFlash {
  0%   { color: #00ff9d; transform: scale(1.04); }
  100% { color: inherit; transform: scale(1); }
}

.num-flash {
  animation: numFlash 0.25s ease-out forwards;
}

/* ── Slide-up stagger ────────────────────────────── */
[style*="animation-delay"] {
  opacity: 0;
  animation-fill-mode: forwards;
}

/* ── Token icon pulse on selection ──────────────── */
.collateral-btn.active .token-icon {
  animation: iconPop 0.3s cubic-bezier(0.16,1,0.3,1);
}

@keyframes iconPop {
  0%   { transform: scale(0.9); }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ── Input number hiding arrows ─────────────────── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }
