/* ═══════════════════════════════════════════════════
   TVR Portfolio V2 Styles
   Last updated: February 8, 2026
   ═══════════════════════════════════════════════════ */

/* Layout */
.pv2-container { max-width: 1600px; margin: 0 auto; }
.pv2-header { text-align: center; margin-bottom: 28px; }
.pv2-header h1 { font-size: 26px; font-weight: 700; color: var(--text-primary); margin: 0; }
.pv2-header p { color: #94a3b8; font-size: 14px; margin-top: 4px; }

.pv2-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

/* Left panel */
.pv2-left {
  background: linear-gradient(145deg, #0c2d3f 0%, #0a1f2e 50%, #081a26 100%);
  border-radius: 10px;
  padding: 20px 12px 16px;
  text-align: center;
  border: 1px solid #1e3a4a;
  position: sticky;
  top: 80px;
}
.pv2-coin-wrap { display: flex; justify-content: center; margin: 0 auto 12px; }
.pv2-interp { font-size: 13px; font-weight: 500; opacity: 0.9; }
.pv2-legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; }
.pv2-legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #64748b; }
.pv2-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pv2-stat { background: #0a1a24; border-radius: 6px; padding: 10px 8px; text-align: center; }
.pv2-stat-val { font-size: 20px; font-weight: 700; }
.pv2-stat-lbl { font-size: 11px; color: #94a3b8; }

/* Right panel */
.pv2-right { display: flex; flex-direction: column; gap: 16px; }

/* Cards */
.pv2-card {
  background: #111c27;
  border-radius: 10px;
  border: 1px solid #1e3a4a;
  overflow: hidden;
}

/* Holdings */
.pv2-hold-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid #1e3a4a;
}
.pv2-hold-header h3 { margin: 0; color: var(--text-primary); font-size: 15px; }
.pv2-hold-meta { display: flex; align-items: center; gap: 12px; }
.pv2-hold-rem { font-size: 11px; }
.pv2-add-btn {
  padding: 5px 12px; border-radius: 6px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: opacity 0.3s; font-family: inherit;
}
.pv2-row {
  display: grid;
  grid-template-columns: 36px 1fr 70px 52px 28px;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid #1e3a4a;
  align-items: center;
}
.pv2-row:last-child { border-bottom: none; }
.pv2-icon {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: contain;
  transition: transform 0.2s, box-shadow 0.2s;
}
.pv2-icon-letter {
  width: 32px; height: 32px; border-radius: 50%;
  background: #1e3a4a;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #5eead4;
  transition: transform 0.2s, box-shadow 0.2s;
}
.pv2-clickable { display: contents; cursor: pointer; }
.pv2-clickable:hover .pv2-icon,
.pv2-clickable:hover .pv2-icon-letter { transform: scale(1.1); box-shadow: 0 0 0 3px #5eead4; }
.pv2-clickable:hover .pv2-hname { color: #5eead4; }
.pv2-hname { font-weight: 600; color: #e2e8f0; font-size: 13px; transition: color 0.2s; }
.pv2-hticker { font-size: 11px; color: #64748b; }
.pv2-halloc { text-align: right; font-weight: 600; color: #e2e8f0; font-size: 13px; }
.pv2-badge {
  text-align: center; padding: 3px 4px; border-radius: 4px;
  font-weight: 600; font-size: 12px;
}
.pv2-del {
  text-align: center; color: #991b1b; cursor: pointer;
  font-size: 15px; opacity: 0.4; transition: opacity 0.3s;
  background: none; border: none; font-family: inherit;
}
.pv2-del:hover { opacity: 1; }

/* Panel toggle (What-If / Lens headers) */
.pv2-toggle {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; background: #0d1620;
  cursor: pointer; border: none; width: 100%; text-align: left;
  font-family: inherit; transition: background 0.3s; color: inherit;
}
.pv2-toggle:hover { background: #101d28; }
.pv2-toggle h3 {
  margin: 0; color: var(--text-primary); font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.pv2-arrow {
  color: #64748b; font-size: 12px;
  transition: transform 0.3s; display: inline-block;
}
.pv2-arrow.open { transform: rotate(180deg); }
.pv2-body { padding: 16px 18px; }
.pv2-body p { color: #7a8fa0; font-size: 12px; margin: 0 0 16px 0; line-height: 1.5; }

/* What-If */
.pv2-wi-scores {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 12px; margin-bottom: 18px; align-items: center;
}
.pv2-wi-box {
  text-align: center; padding: 12px; border-radius: 8px;
  background: #0a1a24; border: 1px solid #1e3a4a;
}
.pv2-wi-lbl { font-size: 11px; color: #7a8fa0; margin-bottom: 4px; }
.pv2-wi-val { font-size: 28px; font-weight: 700; }
.pv2-wi-arrow { font-size: 20px; color: #3a5568; }
.pv2-wi-delta { font-size: 11px; margin-top: 2px; font-weight: 600; }
.pv2-wi-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv2-wi-scard {
  background: #0a1a24; padding: 10px 12px; border-radius: 6px;
  border: 1px solid transparent; transition: border-color 0.3s;
}
.pv2-wi-scard.changed { border-color: #164e63; }
.pv2-wi-stop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pv2-wi-sname { font-weight: 600; color: #e2e8f0; font-size: 12px; }
.pv2-wi-sval { font-weight: 700; font-size: 13px; min-width: 40px; text-align: right; }
.pv2-wi-was { font-size: 10px; color: #546778; margin-top: 4px; }
.pv2-wi-reset {
  margin-top: 12px; padding: 7px 14px;
  border: 1px solid #1e3a4a; background: transparent;
  border-radius: 6px; cursor: pointer; font-weight: 600;
  color: #94a3b8; font-size: 12px;
  font-family: inherit; transition: border-color 0.3s;
}
.pv2-wi-reset:hover { border-color: #64748b; }

/* What-If: slider card states */
.pv2-wi-scard { position: relative; }
.pv2-wi-scard.added { border-color: #166534; }
.pv2-wi-scard.removed { opacity: 0.5; padding: 8px 12px; }

/* What-If: tags */
.pv2-wi-tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px; margin-left: 4px;
  vertical-align: middle; text-transform: uppercase; letter-spacing: 0.5px;
}
.pv2-wi-tag-add { background: #166534; color: #dcfce7; }
.pv2-wi-tag-rem { background: #991b1b; color: #fee2e2; }

/* What-If: remove button on slider cards */
.pv2-wi-remove {
  position: absolute; top: 6px; right: 6px;
  background: none; border: none; color: #546778;
  font-size: 14px; cursor: pointer; padding: 2px 5px;
  border-radius: 3px; transition: all 0.2s; line-height: 1;
}
.pv2-wi-remove:hover { color: #f87171; background: rgba(248,113,113,0.1); }

/* What-If: restore button for removed coins */
.pv2-wi-restore {
  background: none; border: 1px solid #1e3a4a; color: #94a3b8;
  font-size: 10px; padding: 2px 8px; border-radius: 4px;
  cursor: pointer; font-family: inherit; font-weight: 600;
  transition: all 0.2s;
}
.pv2-wi-restore:hover { border-color: #5eead4; color: #5eead4; }

/* What-If: budget bar */
.pv2-wi-budget { margin-bottom: 14px; }
.pv2-wi-budget-lbl { font-size: 11px; color: #7a8fa0; margin-bottom: 5px; }
.pv2-wi-budget-lbl strong { color: #e2e8f0; }
.pv2-wi-budget-bar {
  height: 4px; background: #1e3a4a; border-radius: 2px; overflow: hidden;
}
.pv2-wi-budget-fill {
  height: 100%; border-radius: 2px; transition: width 0.2s, background 0.3s;
}

/* What-If: add coin dropdown row */
.pv2-wi-add-row {
  display: flex; gap: 8px; margin-top: 12px; align-items: center;
}
.pv2-wi-add-select {
  flex: 1; padding: 7px 10px; background: #0a1a24;
  color: #94a3b8; border: 1px solid #1e3a4a; border-radius: 6px;
  font-size: 11px; font-family: inherit; outline: none;
  cursor: pointer;
}
.pv2-wi-add-select:focus { border-color: #164e63; color: #e2e8f0; }
.pv2-wi-add-btn {
  padding: 7px 14px; background: #164e63; color: #5eead4;
  border: none; border-radius: 6px; cursor: pointer;
  font-weight: 600; font-family: inherit; font-size: 11px;
  transition: background 0.2s; white-space: nowrap;
}
.pv2-wi-add-btn:hover { background: #1a5e73; }

/* Weight Lens */
.pv2-lens-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv2-lens-btn {
  padding: 12px; border-radius: 8px; cursor: pointer;
  text-align: left; transition: all 0.3s; font-family: inherit;
  border: 1.5px solid #1e3a4a; background: #0a1a24;
}
.pv2-lens-btn:hover { border-color: #2a5060; }
.pv2-lens-btn.active { border-color: #5eead4; background: rgba(94, 234, 212, 0.06); }
.pv2-lens-name { font-weight: 600; font-size: 13px; color: #e2e8f0; margin-bottom: 3px; }
.pv2-lens-btn.active .pv2-lens-name { color: #5eead4; }
.pv2-lens-desc { font-size: 11px; color: #7a8fa0; line-height: 1.3; }

/* Range sliders */
.pv2-body input[type="range"] {
  width: 100%; height: 4px; border-radius: 2px;
  -webkit-appearance: none; appearance: none;
  background: #1e3a4a; outline: none; cursor: pointer;
}
.pv2-body input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #5eead4; cursor: pointer; border: 2px solid #0a1a24;
}
.pv2-body input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #5eead4; cursor: pointer; border: 2px solid #0a1a24;
}

/* Modals */
.pv2-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7); z-index: 1000;
  align-items: center; justify-content: center;
}
.pv2-modal-overlay.active { display: flex; }
.pv2-modal {
  background: #111c27; border: 1px solid #1e3a4a;
  border-radius: 10px; padding: 20px; width: 300px; max-width: 90vw;
}
.pv2-modal h3 { color: var(--text-primary); margin: 0 0 14px 0; font-size: 15px; font-weight: 600; }
.pv2-modal select {
  width: 100%; padding: 8px 10px; background: #0a1a24;
  color: #e2e8f0; border: 1px solid #1e3a4a; border-radius: 6px;
  font-size: 13px; font-family: inherit; margin-bottom: 10px; outline: none;
}
.pv2-modal-coin {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.pv2-modal-coin-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  object-fit: contain;
}
.pv2-modal-coin-letter {
  width: 34px; height: 34px; border-radius: 50%;
  background: #1e3a4a; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #5eead4;
}
.pv2-modal-coin-name { font-weight: 600; color: var(--text-primary); font-size: 14px; line-height: 1.2; }
.pv2-modal-coin-ticker { font-size: 11px; color: #64748b; }
.pv2-alloc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.pv2-alloc-input {
  flex: 1; padding: 8px 12px; background: #0a1a24;
  color: #e2e8f0; border: 1px solid #1e3a4a; border-radius: 6px;
  font-size: 15px; font-family: 'JetBrains Mono', monospace;
  font-weight: 600; text-align: right; outline: none;
  transition: border-color 0.2s;
}
.pv2-alloc-input:focus { border-color: #164e63; }
.pv2-alloc-pct { color: #64748b; font-size: 14px; font-weight: 600; }
.pv2-modal-btns { display: flex; gap: 8px; }
.pv2-btn-cancel {
  flex: 1; padding: 8px; border: 1px solid #1e3a4a; background: transparent;
  color: #94a3b8; border-radius: 6px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 500;
  transition: border-color 0.2s;
}
.pv2-btn-cancel:hover { border-color: #64748b; }
.pv2-btn-confirm {
  flex: 1; padding: 8px; border: none; background: #164e63;
  color: #5eead4; border-radius: 6px; cursor: pointer;
  font-weight: 600; font-family: inherit; font-size: 12px;
  transition: background 0.2s;
}
.pv2-btn-confirm:hover { background: #1a5e73; }

/* Number input: hide spinners */
.pv2-alloc-input::-webkit-outer-spin-button,
.pv2-alloc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pv2-alloc-input { -moz-appearance: textfield; }

/* Empty state */
.pv2-empty {
  text-align: center; padding: 3rem 2rem;
}
.pv2-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.pv2-empty h2 { color: #e2e8f0; margin-bottom: 0.5rem; font-size: 1.2rem; }
.pv2-empty p { color: #64748b; margin-bottom: 1.5rem; max-width: 400px; margin-left: auto; margin-right: auto; font-size: 0.95rem; }
.pv2-empty-btn {
  background: #164e63; color: #5eead4; padding: 0.75rem 1.5rem;
  border: none; border-radius: 6px; font-weight: 600;
  cursor: pointer; font-size: 1rem; font-family: inherit;
  transition: background 0.3s;
}
.pv2-empty-btn:hover { background: #1a5e73; }

/* Locked state */
.pv2-locked {
  text-align: center; padding: 3rem 2rem;
}
.pv2-locked-icon { font-size: 3rem; margin-bottom: 1rem; }
.pv2-locked h4 { color: #e2e8f0; margin-bottom: 0.5rem; font-size: 1.1rem; }
.pv2-locked p { color: #64748b; margin-bottom: 1.5rem; font-size: 0.95rem; }
.pv2-locked-btn {
  background: linear-gradient(135deg, #164e63, #0d3a4a);
  color: #5eead4; padding: 0.75rem 1.5rem;
  border: none; border-radius: 6px; font-weight: 600;
  cursor: pointer; font-size: 1rem; font-family: inherit;
}

/* Responsive */
@media (max-width: 800px) {
  .pv2-grid { grid-template-columns: 1fr; }
  .pv2-left { position: static; }
  .pv2-wi-sliders { grid-template-columns: 1fr; }
  .pv2-lens-grid { grid-template-columns: 1fr; }
  .pv2-header h1 { font-size: 1.5rem; }
}
