:root {
  --topbar-height: 60px;
  --bottombar-height: 60px;
}

/* TEAM WRAPPER */
#teamPageWrapper {
  min-height: calc(100vh - var(--topbar-height) - var(--bottombar-height));
  padding: 0;
  box-sizing: border-box;
  background-color: #eee;
}

/* SECTION 1 STYLES */
#section-pie {
  min-height: 250px;
  padding: 0;
  box-sizing: border-box;
  background-color: rgb(217, 160, 250) !important;
}

#piechart {
  padding-top: var(--topbar-height);
  width: 100%;
  height: 240px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Section 2 🟦 LEVEL-UP SECTION STYLES */
#section-level {
  height: 120px; /* ⬅️ Lock height */
  padding: 0;
  box-sizing: border-box;
  background-color: #051b41!important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 🟦 LEVEL-UP CONTAINER */
.level-progress-container {
  width: 100%;
  max-width: 420px;
  height: 100%;
  font-family: 'Kanit', sans-serif;
  color: #1C3664;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  padding: 10px;
  gap: 10px; /* ⬅️ master gap between all 3 sections */
}

/* 📢 PROMOTION LINE */
.level-goal {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  line-height: 1.3;
  margin: 2px auto 0px auto;
}

.level-goal .highlight {
  color: #2bff01;
  margin-left: 4px;
  font-weight: 700;
  font-size: 17px;
}

/* 📊 PROGRESS BAR */
.progress-bar {
  width: 75%;
  height: 18px;
  background-color: #d6e1f5;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  margin: 5px auto 2px auto; 
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0077cc, #005fa3);
  border-radius: 9px 0 0 9px;
  transition: width 0.5s ease;
}

/* 📣 REMAINING COUNT */
.level-next {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  line-height: 1.4;
  margin: 5px auto 0px auto; 
}

.level-next .highlight {
  color: #2bff01;
  font-size: 17px;
  font-weight: 700;
  margin: 0 4px;
}

/* SECTION 3: New Direct Downline Info */
#section-downline {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background-color: rgb(205, 235, 247) !important;
  font-family: 'Kanit', sans-serif;
  text-align: center;
  border-radius: 12px;
  margin: 12px auto;
  width: 65%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  color: #1C3664;
}

.new-dl-title {
  font-size: 16px;
  font-weight: 550;
  margin-bottom: 4px;
}

.new-dl-divider {
  width: 65%;               /* adjust length of the underline */
  border: none;             /* remove default border */
  border-top: 2px solid #1C3664;  /* solid line, color from your palette */
  margin: 6px auto 10px;    /* vertical spacing: top 6px, bottom 10px, centered */
  border-radius: 2px;       /* slight rounding for polish */
  box-shadow: 0 1px 2px rgba(28,54,100,0.2); /* subtle shadow for depth */
}

.new-dl-name,
.new-dl-code,
.new-dl-date {
  font-size: 16px;
  margin: 2px 0;
}

/* Section 4 ADD BUTTON */

/* ACTION BUTTONS WRAPPER */
#teamActionsWrapper {
  position: fixed;
  bottom: 67px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  z-index: 99;
}

/* Each button */
.team-action-btn {
  width: 120px;
  height: 40px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}
.team-action-btn:hover {
  transform: scale(1.05);
}

/* Section member list card */

#memberListWrapper {
  width: 80%;            /* reduce width from 90% */
  max-width: 360px;      /* reduce max-width from 420px */
  margin: 12px auto;
}

.member-list-card {
  width: 100%;           /* ensure card fits the wrapper */
  max-height: 190px;         /* keep same */
  background: #ffffff;
  border-radius: 12px;
  font-family: 'Kanit', sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;          /* prevent header scrolling */
}

.member-list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #1C3664;
  padding: 8px 12px;         /* keep header padding */
  flex-shrink: 0;             /* lock header */
  border-bottom: 1px solid #eee;
  background: #fff;           /* header background */
}

.member-list-card-body {
  overflow-y: auto;           /* scrollable area */
  padding: 6px 12px;          /* same padding as before */
  flex-grow: 1;
}

.member-item .level {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  margin-left: 16px;  /* indent under name */
}


/* member items remain the same */
.member-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
}
.member-item:last-child { border-bottom: none; }
.member-item .name { font-weight: 600; color: #1C3664; }
.member-item .level { font-size: 13px; color: #666; margin-top: 2px; }

/* close button stays same */
.close-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #EC1C24;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.close-btn:hover { transform: scale(1.1); }

/* Temp hide */
.hidden { display: none; }

.hidden-extra {
  display: none;
}

