/* =====================
   Affiliate Tree Page (MLM style)
===================== */

.affiliate-tree-main {
  padding-bottom: 100px;
}

.affiliate-tree-card {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(15, 25, 45, 0.65);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 20px 16px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.affiliate-tree-description {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 16px;
}

.affiliate-tree-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.affiliate-tree-summary-item {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.affiliate-tree-summary-item strong {
  display: block;
  font-size: 18px;
  color: #f0c14b;
  margin-bottom: 2px;
}

.affiliate-tree-root {
  min-height: 120px;
}

.affiliate-tree-error,
.affiliate-tree-loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  padding: 16px;
}

.affiliate-tree-error.hidden,
.affiliate-tree-loading.hidden {
  display: none !important;
}

/* --- Tree nodes (MLM style) --- */
.affiliate-tree-node {
  position: relative;
  display: inline-block;
  margin: 8px 4px;
  vertical-align: top;
}

.affiliate-tree-node-inner {
  background: linear-gradient(145deg, rgba(40, 60, 100, 0.9), rgba(20, 35, 60, 0.95));
  border: 1px solid rgba(240, 193, 75, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 140px;
  max-width: 200px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.affiliate-tree-node.self .affiliate-tree-node-inner {
  border-color: rgba(240, 193, 75, 0.7);
  box-shadow: 0 0 0 2px rgba(240, 193, 75, 0.25);
}

.affiliate-tree-node-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2px;
  word-break: break-all;
}

.affiliate-tree-node-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  margin-bottom: 4px;
}

.affiliate-tree-node-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.affiliate-tree-node-meta span {
  margin-right: 8px;
}

.affiliate-tree-children {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
}

.affiliate-tree-children::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%);
}

.affiliate-tree-node-children-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.affiliate-tree-node-children-wrap > .affiliate-tree-node {
  position: relative;
}

.affiliate-tree-node-children-wrap > .affiliate-tree-node::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-50%);
}

.affiliate-tree-node-children-wrap > .affiliate-tree-node:first-child:last-child::before {
  left: 50%;
}

.affiliate-tree-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  padding: 24px;
}
