/* ====================================================================
   wallet-ui.css — shared wallet-management UI styles
   Accent colors are set per-page via CSS custom properties:
     --wallet-accent      (Add Wallet button, focus rings)
     --wallet-accent-soft (lighter variant for hover/border)
     --import-accent      (Import button primary)
     --import-accent-soft (Import button lighter variant)
   ==================================================================== */

/* --- Sidebar --- */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

.sidebar-panel {
  position: fixed; top: 0; right: 0;
  width: 320px; height: 100vh;
  background: #090D14; border-left: 1px solid #1A1F2C;
  z-index: 50; transform: translateX(100%);
  transition: transform 0.3s; overflow-y: auto;
}
.sidebar-panel.open { transform: translateX(0); }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 60;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #090D14; border: 1px solid #1A1F2C;
  border-radius: 16px; width: 420px; max-width: 92vw;
  padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  max-height: 85vh; overflow-y: auto;
}

/* --- Color picker --- */
.color-picker-overlay {
  position: fixed; inset: 0; z-index: 70;
  display: none; background: rgba(0,0,0,0.5);
}
.color-picker-overlay.open { display: block; }
.color-picker-popup {
  position: absolute; background: #090D14;
  border: 1px solid #1A1F2C; border-radius: 12px;
  padding: 12px; box-shadow: 0 16px 40px rgba(0,0,0,0.7);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  z-index: 80; width: 210px;
}
.color-picker-swatch {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}
.color-picker-swatch:hover {
  transform: scale(1.2); border-color: rgba(255,255,255,0.3);
  box-shadow: 0 0 12px var(--swatch-color);
}
.color-picker-swatch.selected {
  border-color: #fff; box-shadow: 0 0 14px var(--swatch-color);
}

/* --- Toast --- */
.toast-box {
  background: #090D14; border: 1px solid #1A1F2C;
  border-radius: 10px; padding: 12px 18px; min-width: 280px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.7);
  display: flex; align-items: flex-start; gap: 10px;
  animation: toast-in 0.3s ease-out;
}
.toast-box.toast-exit { animation: toast-out 0.25s ease-in forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(0.95); }
}
.toast-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.toast-message { font-size: 12px; color: #9CA3AF; line-height: 1.4; }
.toast-progress { height: 3px; background: #1F2937; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.toast-progress-bar { height: 100%; border-radius: 2px; animation: toast-progress-shrink 4s linear forwards; }
@keyframes toast-progress-shrink { to { width: 0%; } }

/* --- Import spinner --- */
.import-btn-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,122,0,0.2);
  border-top-color: #FF7A00;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Debt (borrowable) token selector --- */
.debt-selector {
  max-height: 180px; overflow-y: auto;
  border: 1px solid #1A1F2C; border-radius: 8px;
  padding: 8px; display: flex; flex-wrap: wrap; gap: 6px;
  background: #05070B;
}
.debt-token {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid #1A1F2C; cursor: pointer;
  font-size: 11px; font-weight: 600; color: #9CA3AF;
  transition: all 0.15s; user-select: none;
}
.debt-token:hover { border-color: rgba(255,255,255,0.2); color: #E2E8F0; }
.debt-token.selected {
  border-color: var(--wallet-accent, #FF7A00);
  color: #fff;
  background: color-mix(in srgb, var(--wallet-accent, #FF7A00) 15%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--wallet-accent, #FF7A00) 25%, transparent);
}
.debt-token img {
  width: 16px; height: 16px; border-radius: 50%;
  background: #090D14; flex-shrink: 0;
}
.debt-token .ct-sym { font-family: 'SF Mono', 'Fira Code', monospace; }

/* --- Draggable pills (shared) --- */
#wallet-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#wallet-pills .pill-btn { user-select: none; position: relative; }
#wallet-pills .pill-btn.dragging { opacity: 0.3; transform: scale(0.95); }
#wallet-pills .pill-btn.pill-dragging { opacity: 0.3; transform: scale(0.95); }
.drag-insert-line {
  width: 3px; min-height: 32px; background: var(--wallet-accent, #FF7A00);
  border-radius: 2px; flex-shrink: 0;
  box-shadow: 0 0 6px var(--wallet-accent, #FF7A00);
  position: absolute; left: -3px; top: 0;
}

/* --- Wallet filter toggle (shared) --- */
.wallet-filter-toggle {
  appearance: none; width: 12px; height: 12px;
  border-radius: 2px; border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer; position: relative; transition: all 0.2s;
}
.wallet-filter-toggle:checked {
  background: var(--wallet-color); border-color: transparent;
  box-shadow: 0 0 8px color-mix(in srgb, var(--wallet-color) 40%, transparent);
}

/* --- Platform checkbox (shared) --- */
.platform-checkbox {
  appearance: none; width: 14px; height: 14px;
  border-radius: 3px; border: 1.5px solid rgba(255,255,255,0.15);
  cursor: pointer; position: relative; transition: all 0.2s; flex-shrink: 0;
}
.platform-checkbox:checked { border-color: transparent; }
.platform-checkbox.platform-aave:checked {
  background: #9896FF; box-shadow: 0 0 10px rgba(152, 150, 255, 0.5);
}
.platform-checkbox.platform-hyperlend:checked {
  background: #caeae5; box-shadow: 0 0 10px rgba(202, 234, 229, 0.5);
}

/* --- Wallet color dot (shared) --- */
.wallet-color-dot {
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  flex-shrink: 0; transition: transform 0.15s, box-shadow 0.15s;
}
.wallet-color-dot:hover {
  transform: scale(1.25); box-shadow: 0 0 10px var(--wallet-color);
}

/* --- Wallet settings icon (sidebar / hamburger menu) ---
   The sliders icon (same as the Amplification Ratio chart's config
   button) tinted with the wallet's chosen color — `currentColor` in
   the SVG picks up the inline `color` style. Opens the Wallet
   Settings panel (name, borrowable tokens, color). */
.wallet-color-btn {
  background: none; border: none; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; cursor: pointer; flex-shrink: 0;
  transition: transform 0.15s, filter 0.15s;
}
.wallet-color-btn:hover {
  transform: scale(1.25); filter: drop-shadow(0 0 6px currentColor);
}
