/* =========================================================
   COSTWAY DESIGN SYSTEM - COMPONENTS
   Ready for ASP.NET Razor / C# Backend Integration
   ========================================================= */

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.btn-gold {
  background: var(--gold-gradient);
  color: #0b0e14;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.25);
}
.btn-gold:hover {
  background: var(--gold-gradient-hover);
  box-shadow: var(--gold-glow);
  transform: translateY(-1px);
}
.btn-gold:active {
  transform: translateY(0);
}

.btn-gold-outline {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid var(--gold-border-strong);
  color: var(--gold-300);
}
.btn-gold-outline:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-400);
  box-shadow: var(--gold-glow-sm);
}

.btn-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.btn-dark:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-medium);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}
.btn-success:hover {
  box-shadow: var(--emerald-glow);
  transform: translateY(-1px);
}

.btn-telegram {
  background: #0088cc;
  color: #fff;
  border: none;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}
.btn-telegram:hover {
  background: #0077b5;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.35);
}

.btn-whatsapp {
  background: #128c7e;
  color: #fff;
  border: none;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}
.btn-whatsapp:hover {
  background: #075e54;
  box-shadow: 0 4px 14px rgba(18, 140, 126, 0.35);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}
.btn-block {
  width: 100%;
}

/* BADGES & PILLS */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
  line-height: 1;
}

.badge-gold {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-border-strong);
  color: var(--gold-300);
}

.badge-success {
  background: var(--emerald-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--emerald-400);
}

.badge-amber {
  background: var(--amber-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-500);
}

.badge-cyan {
  background: var(--cyan-bg);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--cyan-500);
}

.badge-verified {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--emerald-500);
  color: var(--emerald-400);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 12px;
}

.badge-locked {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-400);
}

/* CARDS & CONTAINERS */
.card,
.glass-card {
  background: var(--bg-card);
  background: rgba(15, 21, 35, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.glass-card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.glass-card-sm {
  background: rgba(10, 14, 24, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: all 0.2s ease;
}

.card-glass {
  background: var(--bg-card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card-gold-border {
  border: 1px solid var(--gold-border);
}
.card-gold-border:hover {
  border-color: var(--gold-border-strong);
  box-shadow: var(--gold-glow-sm);
}

/* RESPONSIVE CSS GRIDS */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }
}

.grid-withdraw-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .grid-withdraw-layout {
    grid-template-columns: 1fr !important;
  }
}

/* STAT CARDS */
.stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.stat-card-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

/* PAGE HEADERS & ACTION ROWS */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #fff;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  max-width: 800px;
  line-height: 1.5;
}

.page-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* PROGRESS BARS */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold-400);
  fill: none;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* HERO PROMO BANNER */
.hero-promo-card {
  background: radial-gradient(circle at 100% 0%, rgba(212, 175, 55, 0.15) 0%, rgba(15, 21, 35, 0.95) 70%);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-glass);
}

.hero-promo-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 10px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.hero-title span.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 22px;
}

/* WALLET STAT CARDS (3-COLUMN GRID) */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.wallet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.wallet-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.wallet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.wallet-type-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-avatar-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.wallet-avatar-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--gold-400);
}

.wallet-label-group {
  display: flex;
  flex-direction: column;
}

.wallet-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.wallet-tagline {
  font-size: 11px;
  color: var(--text-muted);
}

.wallet-amount-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
}

.wallet-balance-amount {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.wallet-currency {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-300);
}

.wallet-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* FORMS READY FOR ASP.NET */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
  background: rgba(10, 14, 24, 0.95);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* Input group with addon */
.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-addon-left {
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold-300);
}

.input-group .form-control {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.quick-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip-btn:hover, .chip-btn.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold-border-strong);
  color: var(--gold-300);
}

/* ASP.NET Validation Placeholders */
.field-validation-error {
  color: var(--rose-500);
  font-size: 11.5px;
  margin-top: 5px;
  display: block;
}
.input-validation-error {
  border-color: var(--rose-500) !important;
}

/* DATA TABLES READY FOR ASP.NET */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.35);
  margin-top: 14px;
}

.data-table,
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th,
.custom-table th {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.data-table td,
.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover,
.custom-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr:last-child td,
.custom-table tbody tr:last-child td {
  border-bottom: none;
}

/* Amount color helpers */
.text-credit {
  color: var(--emerald-400);
  font-family: var(--font-mono);
  font-weight: 700;
}
.text-debit {
  color: var(--gold-300);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* TAB NAVIGATION (LUXURY SEGMENTED CONTROL) */
.tab-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 5px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 18px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--gold-gradient);
  color: #0b0e14;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

/* PROGRESS BAR */
.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill-gold {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill-emerald {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* PLAN CARDS (SUBSCRIPTIONS & INVESTMENTS) */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-border-strong);
  box-shadow: var(--gold-glow);
}

.plan-card.featured {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12) 0%, rgba(15, 21, 35, 0.9) 100%);
  border: 1px solid var(--gold-border-strong);
}

.plan-ribbon {
  position: absolute;
  top: 14px;
  right: -32px;
  background: var(--gold-gradient);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 36px;
  transform: rotate(45deg);
}

.plan-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.plan-price {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 14px;
}

.plan-price span.currency {
  font-size: 22px;
  color: var(--gold-300);
}

.plan-divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}

.plan-features-list {
  list-style: none;
  width: 100%;
  text-align: left;
  margin-bottom: 22px;
}

.plan-features-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.plan-features-list li svg {
  width: 14px;
  height: 14px;
  stroke: var(--emerald-400);
  flex-shrink: 0;
}

/* MODAL SYSTEM */
.modal-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active,
.modal-backdrop.active {
  display: flex !important;
}

.modal-dialog,
.modal-card,
.modal-box {
  background: linear-gradient(150deg, #111728 0%, #080c14 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-lg, 16px);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 45px rgba(212, 175, 55, 0.15);
  overflow: hidden;
  position: relative;
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.modal-close-btn,
.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  font-size: 18px;
  line-height: 1;
}

.modal-close-btn:hover,
.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
}

/* TOAST NOTIFICATION */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--gold-border-strong);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-glass), var(--gold-glow-sm);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  z-index: 3000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* COPY ICON BUTTON */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--gold-border);
  color: var(--gold-300);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-copy:hover {
  background: rgba(212, 175, 55, 0.22);
}

/* =========================================================
   GENEALOGY & BINARY TREE COMPONENTS
   ========================================================= */
.tree-container {
  overflow-x: auto;
  padding: 30px 10px;
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.04) 0%, rgba(7, 9, 14, 0.8) 70%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  position: relative;
  text-align: center;
}

.tree-canvas {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  min-width: 820px;
  margin: 0 auto;
  position: relative;
}

.tree-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  position: relative;
  width: 100%;
}

.tree-row.level-0,
.tree-row:first-child {
  position: relative;
}

/* Connector dropping from Root down 20px */
.tree-row.level-0::after,
.tree-row:first-child::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: var(--gold-400);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
  z-index: 1;
}

.tree-row.level-1 { 
  gap: 140px; 
  position: relative;
}

/* Horizontal line spanning Level 1 */
.tree-row.level-1::before {
  content: '';
  position: absolute;
  top: -20px;
  left: calc(50% - 160px);
  right: calc(50% - 160px);
  height: 2px;
  background: var(--gold-400);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
  z-index: 1;
}

/* Vertical line into each Level 1 card */
.tree-row.level-1 .tree-node-card::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: var(--gold-400);
  z-index: 1;
}

/* Vertical line dropping out of each Level 1 card */
.tree-row.level-1 .tree-node-card::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: rgba(212, 175, 55, 0.6);
  z-index: 1;
}

.tree-row.level-2 { 
  gap: 24px; 
  position: relative;
}

/* Horizontal lines spanning Level 2 left and right pairs */
.tree-row.level-2::before {
  content: '';
  position: absolute;
  top: -20px;
  left: calc(50% - 310px);
  right: calc(50% - 310px);
  height: 2px;
  background: rgba(212, 175, 55, 0.5);
  z-index: 1;
}

/* Vertical drops into each Level 2 card */
.tree-row.level-2 .tree-node-card::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: rgba(212, 175, 55, 0.5);
  z-index: 1;
}

.tree-node-card {
  width: 180px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  text-align: left;
}

.tree-node-card:hover {
  border-color: var(--gold-400);
  box-shadow: var(--gold-glow-sm);
  transform: translateY(-3px);
}

.tree-node-card.root-node {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.18);
  width: 200px;
}

.tree-node-card.empty-node {
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  text-align: center;
  cursor: pointer;
}

.tree-node-card.empty-node:hover {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.05);
}

.node-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.node-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gold-gradient);
  color: #0b0e14;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

.node-info {
  line-height: 1.2;
}

.node-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.node-name {
  font-size: 11px;
  color: var(--text-muted);
}

.node-bv-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  margin-top: 8px;
}

.node-bv-col {
  text-align: center;
}

.node-bv-col span {
  display: block;
  color: var(--text-muted);
}

.node-bv-col strong {
  font-family: var(--font-mono);
  color: var(--gold-300);
}

/* =========================================================
   ACCORDION COMPONENT
   ========================================================= */
.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.accordion-item.active {
  border-color: var(--gold-border-strong);
}

.accordion-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.015);
  transition: background 0.2s ease;
  user-select: none;
}

.accordion-header:hover {
  background: rgba(212, 175, 55, 0.04);
}

.accordion-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-icon {
  width: 20px;
  height: 20px;
  color: var(--gold-400);
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 0 22px 20px 22px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.65;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.15);
}

.accordion-item.active .accordion-content {
  display: block;
}

/* =========================================================
   QR DISPLAY & CRYPTO TERMINAL COMPONENTS
   ========================================================= */
.crypto-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 220px;
  height: 220px;
  margin: 0 auto;
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.25);
  position: relative;
}

.crypto-address-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.crypto-address-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold-300);
  letter-spacing: 0.5px;
  word-break: break-all;
  max-width: 100%;
}

.progress-animated-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-animated-bar .progress-fill-active {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: var(--radius-full);
  animation: pulseListen 2s infinite ease-in-out;
}

@keyframes pulseListen {
  0% { width: 10%; opacity: 0.6; }
  50% { width: 70%; opacity: 1; }
  100% { width: 10%; opacity: 0.6; }
}
