@use "../../../../styles/abstracts/variables" as *;
@use "../../../../styles/abstracts/mixins" as *;
$text-muted: #6b6b6b;
$text-dark: #1a1a1a;

/* ================= PAGE ================= */
.page {
  @include dashPageComponent;

  height: 100%;
  padding: 0;

  display: flex;
  flex-direction: column;
  background: $bg-soft;
  border: 1px solid $border;

  @media (max-width: 1000px) {
    margin-top: 5rem;
  }
}

/* ================= CONTENT ================= */
.content {
  padding: 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  @media (max-width: 1000px) {
    padding: 1.5rem;
  }
}

/* ================= SUMMARY ================= */
.summaryCard {
  background: #fff;
  border: 1px solid $border;
  border-radius: 16px;
  padding: 1.5rem;
}

.summaryTop {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.progressBar {
  height: 8px;
  background: #eee;
  border-radius: 20px;
  margin: 0.8rem 0;

  div {
    height: 100%;
    background: linear-gradient(135deg, #5e3817, #7a4b20);
    border-radius: 20px;
  }
}

// .summaryStats {
//   display: flex;
//   justify-content: space-between;

//   span {
//     font-size: 0.75rem;
//     color: #6b6b6b;
//   }

//   h4 {
//     font-size: 0.9rem;
//     color: #1a1a1a;
//   }

//   @media (max-width: 768px) {
//     flex-direction: column;
//     gap: 0.6rem;
//   }
// }

/* ================= SECTION ================= */
.section {
  background: #fff;
  border: 1px solid $border;
  border-radius: 16px;
  padding: 1.5rem;
}

/* ================= PREMIUM STATS ================= */
.statsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-top: 1rem;

  @media (max-width: 768px) {
    grid-template-columns: 1fr;
  }
}

/* ================= CARD ================= */
.statCard {
  padding: 0.9rem 1rem;
  border-radius: 14px;

  display: flex;
  flex-direction: column;
  gap: 4px;

  background: #fff;

  border: 1px solid rgba(122, 75, 32, 0.12);

  box-shadow: 0 10px 28px rgba(122, 75, 32, 0.08);

  position: relative;
  overflow: hidden;

  transition: all 0.25s ease;

  span {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 0.2px;
  }

  h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.2px;
  }

  &:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(122, 75, 32, 0.14);
  }
}

/* ================= VARIANTS ================= */

/* RAISED (SUCCESS / PLEDGES) */
.raised {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.12),
    rgba(16, 185, 129, 0.04)
  );

  border: 1px solid rgba(16, 185, 129, 0.35);

  box-shadow: 0 14px 35px rgba(16, 185, 129, 0.18);

  h4 {
    color: #059669; // strong green
  }

  span {
    color: #047857; // darker green label
  }

  /* subtle glow */
  &::after {
    content: "";
    position: absolute;
    inset: 0;

    background: radial-gradient(
      circle at top left,
      rgba(16, 185, 129, 0.25),
      transparent 60%
    );

    opacity: 0.7;
  }

  &:hover {
    box-shadow: 0 20px 45px rgba(16, 185, 129, 0.25);
  }
}

/* 🎯 TARGET */
.target {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0.01)
  );

  h4 {
    color: #374151;
  }
}

/* ⚠️ REMAINING */
.remaining {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.08),
    rgba(239, 68, 68, 0.02)
  );

  border: 1px solid rgba(239, 68, 68, 0.25);

  h4 {
    color: #b91c1c;
  }
}

/* ================= LEADERBOARD ================= */
.leaderboard {
  margin-top: 1rem;

  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ================= ITEM ================= */
.leaderItem {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 1rem 1.2rem;
  border-radius: 16px;

  background: #fff;

  border: 1px solid rgba(122, 75, 32, 0.08);

  box-shadow: 0 8px 24px rgba(122, 75, 32, 0.06);

  transition: all 0.25s ease;

  &:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(122, 75, 32, 0.12);
    border-color: rgba(122, 75, 32, 0.18);
  }

  /* 📱 MOBILE */
  @media (max-width: 600px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
  }
}

/* ================= LEFT ================= */
.left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* ================= RANK ================= */
.rank {
  min-width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;

  font-size: 0.75rem;
  font-weight: 700;

  color: #5e3817;

  background: rgba(122, 75, 32, 0.08);

  box-shadow: inset 0 0 0 1px rgba(122, 75, 32, 0.12);
}

/* ================= META ================= */
.meta {
  display: flex;
  flex-direction: column;
  gap: 3px;

  h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.2px;
  }
}


/* ================= RIGHT ================= */
.right {
  display: flex;
  align-items: center;
  gap: 0.9rem;

  @media (max-width: 600px) {
    width: 100%;
    justify-content: space-between;
  }
}

/* ================= AMOUNT ================= */
.amount {
  font-size: 0.95rem;
  font-weight: 700;

  color: #5e3817;

  letter-spacing: -0.2px;
}

/* ================= PERCENT ================= */
.percent {
  font-size: 0.7rem;
  font-weight: 600;

  padding: 5px 10px;
  border-radius: 999px;

  background: rgba(16, 185, 129, 0.08);
  color: #059669;
}

/* ================= GOLD ================= */
.gold {
  background: linear-gradient(
    135deg,
    rgba(122, 75, 32, 0.08),
    rgba(122, 75, 32, 0.02)
  );

  border: 1px solid rgba(122, 75, 32, 0.2);

  box-shadow: 0 12px 35px rgba(122, 75, 32, 0.12);

  .rank {
    background: linear-gradient(135deg, #7a4b20, #b08968);
    color: #fff;
  }
}

/* ================= SILVER ================= */
.silver {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0.01)
  );

  .rank {
    background: #9ca3af;
    color: #fff;
  }
}

/* ================= BRONZE ================= */
.bronze {
  background: linear-gradient(
    135deg,
    rgba(180, 110, 50, 0.08),
    rgba(180, 110, 50, 0.02)
  );

  .rank {
    background: #b45309;
    color: #fff;
  }
}

/* ================= EMPTY ================= */
.empty {
  font-size: 0.85rem;
  color: #6b6b6b;
  margin-top: 0.6rem;
}

/* ================= TABLE ================= */
.tableWrapper {
  margin-top: 1rem;
}

/* ================= EMPTY ================= */
.empty {
  font-size: 0.85rem;
  color: #6b6b6b;
  text-align: center;
  padding: 1rem;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  .leaderItem {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .amount {
    align-self: flex-end;
  }
}


/* ================= HERO (FUND INTRO) ================= */
.hero {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: .8rem;
  background: #fff;
  border: 1px solid $border;
  border-radius: 16px;

  padding: 1.3rem 1.4rem;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);

  transition: all 0.25s ease;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
  }

  h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: $text-dark;
    line-height: 1.3;
    padding-top: 1rem;
    padding-bottom: .2rem;
  }

  p {
    font-size: 0.85rem;
    color: $text-muted;
    line-height: 1.5;

    margin-top: 0.4rem;

    max-width: 650px;
  }
}

/* ================= META ================= */
.meta {
  display: flex;
  align-items: left;
  gap: 0.5rem;

  font-size: 0.75rem;
  color: $text-muted;

  span {
    display: flex;
    align-items: left;
    gap: 0.3rem;
  }
}

/* ================= BADGE OVERRIDE (OPTIONAL TWEAK) ================= */
.hero :global(.badge) {
  width: fit-content;

  margin-bottom: 0.2rem;

  font-size: 0.7rem;

  padding: 0.3rem 0.7rem;
  border-radius: 999px;

  background: rgba(122, 75, 32, 0.1);
  color: $primary;

  border: 1px solid rgba(122, 75, 32, 0.2);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .hero {
    padding: 1.1rem;

    h2 {
      font-size: 1rem;
    }

    p {
      font-size: 0.8rem;
    }
  }

  .meta {
    font-size: 0.7rem;
  }
}


/* ================= ACTIONS ================= */
.heroActions {
  display: flex;
  gap: 0.6rem;
  padding-top: 1.2rem;

  @media (max-width: 768px) {
    width: 100%;
    justify-content: flex-start;
    flex-direction: column;
  }
}


//Edit and Delete Buttons 
/* ================= BUTTON BASE ================= */
.editBtn,
.deleteBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 0.5rem 0.85rem;

  font-size: 0.75rem;
  font-weight: 600;

  border-radius: 10px;

  cursor: pointer;

  transition: all 0.25s ease;

  backdrop-filter: blur(6px);
}

/* ================= EDIT ================= */
.editBtn {
  color: #5e3817;

  background: linear-gradient(
    135deg,
    rgba(122, 75, 32, 0.12),
    rgba(122, 75, 32, 0.06)
  );

  border: 1px solid rgba(122, 75, 32, 0.25);

  box-shadow: 0 6px 16px rgba(122, 75, 32, 0.12);

  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(122, 75, 32, 0.2);
    background: rgba(122, 75, 32, 0.18);
  }
}

/* ================= DELETE ================= */
.deleteBtn {
  color: #b91c1c;

  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.12),
    rgba(239, 68, 68, 0.06)
  );

  border: 1px solid rgba(239, 68, 68, 0.3);

  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.12);

  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.18);
  }
}

/* ================= MOBILE ================= */
@media (max-width: 480px) {
  .addBtn,
  .editBtn,
  .deleteBtn {
    font-size: 0.7rem;
    padding: 0.6rem 0.7rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}





/* ================= TOP CONTRIBUTOR BADGE ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 10px;
  border-radius: 999px;

  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2px;

  color: #7a4b20;

  background: linear-gradient(
    135deg,
    rgba(122, 75, 32, 0.12),
    rgba(122, 75, 32, 0.05)
  );

  border: 1px solid rgba(122, 75, 32, 0.25);

  box-shadow: 0 4px 12px rgba(122, 75, 32, 0.08);

  backdrop-filter: blur(6px);

  transition: all 0.25s ease;

  svg {
    font-size: 12px;
    color: #b08968; // subtle gold tone
  }

  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(122, 75, 32, 0.15);
    background: rgba(122, 75, 32, 0.18);
  }
}


/* ================= ADD BUTTON ================= */
.addBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 0.6rem 0.9rem;

  font-size: 0.75rem;
  font-weight: 600;

  border-radius: 10px;

  color: #fff;

  background: linear-gradient(135deg, #5e3817, #7a4b20);

  border: 1px solid rgba(122, 75, 32, 0.4);

  box-shadow: 0 8px 20px rgba(122, 75, 32, 0.25);

  cursor: pointer;

  transition: all 0.25s ease;

  svg {
    font-size: 14px;
  }

  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(122, 75, 32, 0.35);
    background: linear-gradient(135deg, #7a4b20, #5e3817);
  }

  &:active {
    transform: scale(0.96);
  }
}