@use "../../../styles/abstracts/variables" as *;
@use "../../../styles/abstracts/mixins" as *;

/* ================= PAGE ================= */
.page {
  @include dashPageComponent;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #f7f9fa;
  padding: 0;
  min-height: 100vh;
}

/* ================= HERO ================= */
.hero {
  padding: 2rem 2rem;
  background: rgba(0, 56, 69, 0.9); // deep brand green
  backdrop-filter: blur(12px); // frosted effect
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 56, 69, 0.25);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;

  @media (max-width: 1000px){
      flex-direction: column;
  }

  &::before {
    content: "";
    position: absolute;
    width: 150%;
    height: 100%;
    top: -20%;
    left: -50%;
    transform: rotate(25deg);
    background: linear-gradient(
      120deg,
      rgba(0, 193, 139, 0.3),
      rgba(0, 112, 88, 0.05)
    );
    pointer-events: none;
  }

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

.heroOverlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  z-index: 0;
}

.heroContent {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.heroText {
  h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
  }

  p {
    font-size: 0.95rem;
    margin-top: 0.25rem;
    color: #dcecf2;
    opacity: 0.85;
  }
}

/* ================= HERO BUTTONS ================= */
.heroButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;

  button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
      transform: translateY(-2px);
    }
  }

  .primary {
    background: #36a2eb;
    color: #fff;
    border: none;
  }

  .secondary {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
  }

  .ghost {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
  }

  .danger {
    background: #dc2626;
    color: #fff;
    border: none;
  }
}

/* ================= CONTENT ================= */
.content {
  padding: 1rem 2.5rem;

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

.statsTitle {
  @include sectionTitle
}

.statsDesc {
  @include sectionDescription
}

/* ================= TOP BAR ================= */
.topBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ---------- TABS ---------- */
.tabs {
  display: inline-flex;
  background: #e0f2f1;
  border-radius: 6px;
  padding: 6px;
  position: relative;

  button {
    padding: 0.2rem 1.2rem;
    border: none;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    color: #065f46;
    z-index: 2;
  }
}

.active {
  color: white !important;
}

.indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  border-radius: 6px;
  background: #047857;
  transition: transform 0.3s ease;
}

.move {
  transform: translateX(100%);
}

/* ---------- SEARCH ---------- */
.search {
  flex: 1;
  display: flex;
  justify-content: flex-end;

  @media (max-width: 768px) {
    justify-content: flex-start;
    margin-top: 0.8rem;
  }
}

/* ================= TABLE CARD ================= */
.tableCard {
  margin-top: 2rem;
}

/* ================= MODAL ================= */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease forwards;
}

.modal {
  background: white;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  padding: 2rem;
  animation: scaleIn 0.25s ease forwards;

  h3 {
    font-weight: 600;
    font-size: 1.25rem;
  }

  p {
    margin-top: 0.5rem;
    color: #475569;
  }
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.5rem;

  .cancel {
    background: transparent;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 1rem;
    border-radius: 8px;
  }

  .confirm {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
  }
}

/* ================= PIE CHART ================= */
.chartSection {
  margin-top: 1rem;
  margin-bottom: 5rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #dcecf2;
  box-shadow: 0 10px 26px rgba(0, 56, 69, 0.08);

  /* Chart Tabs */
  .chartTabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;

    button {
      padding: 0.3rem .7rem;
      border-radius: 999px;
      border: none;
      cursor: pointer;
      font-weight: 600;
      background: #e0f2f1;
      color: #065f46;
      transition: all 0.2s ease;
      font-size: .9rem;

      &:hover {
        background: #047857;
        color: #fff;
      }
    }

    .activeChart {
      background: #047857 !important;
      color: #fff !important;
    }
  }
}

/* ================= ANIMATIONS ================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
