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

/* ================= PAGE ================= */
.page {
  @include dashPageComponent;
  background: $bg-soft;
  color: $text-dark;
  padding: 0;
  margin-top: 2rem;
  @media (max-width: 900px) {
    margin-top: 5rem;
  }
}

/* ================= HEADER ================= */
.header {
  position: relative;
  height: 170px;
  border-radius: 16px;
  overflow: visible;

  background: linear-gradient(135deg, $primary, $primary-2);
  box-shadow: 0 10px 30px rgba(122, 75, 32, 0.25);

  @media (max-width: 900px) {
    height: 140px;
  }

  &::before {
    content: "";
    position: absolute;
    width: 150%;
    height: 100%;
    top: -20%;
    left: -50%;
    transform: rotate(25deg);

    background: linear-gradient(
      120deg,
      rgba(255,255,255,0.25),
      transparent
    );
  }
}

/* ================= AVATAR ================= */
.avatar {
  position: absolute;
  left: 24px;
  bottom: -40px;

  width: 80px;
  height: 80px;
  border-radius: 50%;

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

  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;

  background: linear-gradient(135deg, $primary, $primary-2);

  border: 6px solid $bg-soft;

  box-shadow:
    0 14px 34px rgba(0,0,0,0.15),
    inset 0 2px 6px rgba(255,255,255,0.2);
}

/* ================= PROFILE ================= */
.profile {
  margin-top: 90px;
  padding: 1.5rem;

  background: #fff;
  border-radius: 16px;
  border: 1px solid $border;

  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  @media (max-width: 900px) {
    margin-top: 5rem;
  }
}

/* ================= NAME ================= */
.nameRow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;

  h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: $text-dark;
    margin: 0;
  }
}

/* ================= BADGE ================= */
.badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.success {
  background: $primary-soft;
  color: $primary;
}

.danger {
  background: rgba(220,38,38,0.1);
  color: #dc2626;
}

/* ================= META ================= */
.meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: $text-light;
}

.dot {
  width: 4px;
  height: 4px;
  background: $border;
  border-radius: 50%;
  margin: 0 8px;
}

/* ================= ACTIONS ================= */
.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 0.55rem 1rem;
  border-radius: 10px;

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

  cursor: pointer;
  border: none;

  white-space: nowrap;
}

/* ================= BUTTON VARIANTS ================= */
.suspendBtn {
  background: linear-gradient(135deg,#dc2626,#b91c1c);
  color: #fff;
}

.activateBtn {
  background: linear-gradient(135deg,$primary,$primary-2);
  color: #fff;
}

.transferBtn {
  border: 1px solid $primary;
  color: $primary;
  background: transparent;

  &:hover {
    background: $primary-soft;
  }
}

/* ================= MENU ================= */
.menu button {
  background: $primary-soft;
  border-radius: 8px;
  padding: 6px;
  color: $primary;
}

/* ================= DROPDOWN ================= */
.dropdown {
  position: absolute;
  right: 0;
  top: 44px;

  width: 180px;
  padding: 6px;

  background: #fff;
  border-radius: 12px;
  border: 1px solid $border;

  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.dropdown div {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;

  &:hover {
    background: $primary-soft;
  }
}

/* ================= WRAPPER ================= */
.wrapper {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;

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

/* ================= SIDEBAR ================= */
.sidebar {
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid $border;
}

.tabItem {
  padding: 0.8rem;
  border-radius: 10px;

  h4 {
    color: $text-dark;
  }

  p {
    color: $text-light;
  }

  &:hover {
    background: $primary-soft;
  }
}

.activeTab {
  background: $primary-soft;
  border-left: 3px solid $primary;
}

/* ================= CONTENT ================= */
.content {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid $border;
}

.contentHeader h2 {
  color: $text-dark;
}

.contentHeader p {
  color: $text-light;
}

/* ================= GRID ================= */
.grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1rem;

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

/* ================= ROW ================= */
.row {
  display:flex;
  gap:10px;
}

.icon {
  color:$primary;
}

.label {
  font-size:0.8rem;
  color:$text-light;
}

.value {
  font-size:0.95rem;
  font-weight:500;
  color:$text-dark;
}

/* =========================================================
   TIMELINE WRAPPER
========================================================= */

.timeline {
  position: relative;

  display: flex;
  flex-direction: column;

  gap: 1.4rem;

  width: 100%;

  margin-top: 1.2rem;

  padding: 0.5rem 0;

  @media (max-width: 768px) {
    padding-left: 0 !important;
  }
}

/* =========================================================
   EACH TIMELINE ITEM
========================================================= */

.timelineItem {
  position: relative;

  display: grid;

  grid-template-columns: 60px 1fr;

  gap: 1rem;

  opacity: 0;

  transform: translateY(24px);

  transition:
    opacity 0.45s ease,
    transform 0.45s ease;

  &.show {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   VERTICAL LINE
========================================================= */

.line {
  position: absolute;

  left: 28px;

  top: 4.2rem;

  width: 3px;

  height: calc(100% + 0.5rem);

  border-radius: 999px;

  background: linear-gradient(
    to bottom,
    rgba(94, 56, 23, 0.9),
    rgba(122, 75, 32, 0.35),
    rgba(229, 231, 235, 0.7)
  );

  z-index: 1;
}

/* REMOVE LAST LINE */

.timelineItem:last-child .line {
  display: none;
}

/* =========================================================
   NODE / CIRCLE
========================================================= */

.circle {
  position: relative;

  z-index: 3;

  width: 58px;
  height: 58px;

  min-width: 58px;

  border-radius: 50%;

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

  background: linear-gradient(
    135deg,
    $primary,
    $primary-2
  );

  color: #ffffff;

  font-size: 1.2rem;

  border: 4px solid #ffffff;

  margin-top: 0.25rem;

  box-shadow:
    0 0 0 5px rgba(94, 56, 23, 0.12),
    0 10px 24px rgba(94, 56, 23, 0.18);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* ACTIVE PULSE */

.activeNode {
  animation: pulseNode 2s infinite;
}

/* =========================================================
   CARD
========================================================= */

.timelineCard {
  position: relative;

  background: #ffffff;

  border: 1px solid $border;

  border-radius: 20px;

  padding: 1rem 1rem 1rem 1.1rem;

  overflow: hidden;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;

  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.04);

  &::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;

    width: 5px;
    height: 100%;

    background: linear-gradient(
      to bottom,
      $primary,
      $primary-2
    );
  }

  &:hover {
    transform: translateY(-3px);

    border-color: rgba(94, 56, 23, 0.18);

    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.06),
      0 18px 42px rgba(0, 0, 0, 0.07);
  }
}

/* =========================================================
   HEADER
========================================================= */

.timelineHeader {
  display: flex;

  align-items: flex-start;

  justify-content: space-between;

  gap: 1rem;

  margin-bottom: 0.9rem;

  flex-wrap: wrap;

  h3 {
    margin: 0;

    font-size: 1rem;

    font-weight: 700;

    color: $text-dark;

    line-height: 1.4;
  }
}

/* =========================================================
   STATUS BADGES
========================================================= */

.status {
  display: inline-flex;

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

  padding: 0.4rem 0.75rem;

  border-radius: 999px;

  font-size: 0.72rem;

  font-weight: 700;

  letter-spacing: 0.02em;

  white-space: nowrap;

  border: 1px solid transparent;
}

.current {
  background: rgba(34, 197, 94, 0.12);

  color: #15803d;

  border-color: rgba(34, 197, 94, 0.18);
}

.completed {
  background: rgba(59, 130, 246, 0.12);

  color: #1d4ed8;

  border-color: rgba(59, 130, 246, 0.18);
}

/* =========================================================
   POSITION / CAPACITY
========================================================= */

.timelineCard p {
  margin: 0;

  font-size: 0.92rem;

  font-weight: 600;

  color: $text-dark;

  line-height: 1.6;
}

/* =========================================================
   DATE
========================================================= */

.date {
  display: inline-flex;

  align-items: center;

  gap: 0.45rem;

  margin-top: 0.9rem;

  padding: 0.55rem 0.8rem;

  border-radius: 999px;

  background: $bg-soft;

  border: 1px solid $border;

  font-size: 0.8rem;

  font-weight: 600;

  color: $text-light;

  line-height: 1.4;
}

/* =========================================================
   EXPANDABLE DETAILS
========================================================= */

.expand {
  margin-top: 1rem;

  border-top: 1px dashed $border;

  padding-top: 0.85rem;

  summary {
    cursor: pointer;

    list-style: none;

    font-size: 0.83rem;

    font-weight: 700;

    color: $primary;

    transition: color 0.2s ease;

    &::-webkit-details-marker {
      display: none;
    }

    &:hover {
      color: $primary-2;
    }
  }

  p {
    margin-top: 0.8rem;

    font-size: 0.84rem;

    font-weight: 500;

    line-height: 1.75;

    color: $text-light;
  }
}

/* =========================================================
   HOVER EFFECTS
========================================================= */

.timelineItem:hover .circle {
  transform: scale(1.06);

  box-shadow:
    0 0 0 6px rgba(94, 56, 23, 0.14),
    0 14px 30px rgba(94, 56, 23, 0.24);
}

/* =========================================================
   PULSE ANIMATION
========================================================= */

@keyframes pulseNode {
  0% {
    box-shadow:
      0 0 0 0 rgba(94, 56, 23, 0.22),
      0 10px 24px rgba(94, 56, 23, 0.18);
  }

  70% {
    box-shadow:
      0 0 0 14px rgba(94, 56, 23, 0),
      0 10px 24px rgba(94, 56, 23, 0.18);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(94, 56, 23, 0),
      0 10px 24px rgba(94, 56, 23, 0.18);
  }
}

/* =========================================================
   RESPONSIVE
========================================================= */

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

    gap: 0.8rem;

    padding-right: 0.1rem;
  }

  .line {
    left: 22px;

    top: 3.7rem;
  }

  .circle {
    width: 46px;
    height: 46px;

    min-width: 46px;

    font-size: 1rem;

    border-width: 3px;
  }

  .timelineCard {
    padding: 0.95rem;
  }

  .timelineHeader {
    flex-direction: column;

    align-items: flex-start;

    gap: 0.55rem;
  }

  .timelineHeader h3 {
    font-size: 0.93rem;
  }

  .timelineCard p {
    font-size: 0.84rem;
  }

  .date {
    font-size: 0.74rem;

    width: fit-content;
  }

  .status {
    font-size: 0.68rem;
  }
}

.completed {
  background:$primary-soft;
  color:$primary;
}

/* ================= MODAL ================= */
.modalContent {
  border:1px solid $border;
}

.submitBtn {
  background:linear-gradient(135deg,$primary,$primary-2);
}

.cancelBtn {
  background:$bg-soft;
}

.dangerBtn {
  background:#dc2626;
}


/* ================= MODAL BACKDROP ================= */
.modalBackdrop {
  position: fixed;
  inset: 0;

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

  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);

  z-index: 9999;
  padding: 1rem;
}

/* ================= MODAL CONTENT ================= */
.modalContent {
  width: 100%;
  max-width: 460px;

  background: #fff;
  border-radius: 16px;

  padding: 1.6rem;

  border: 1px solid $border;

  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.05);

  animation: modalIn 0.25s ease;
}

/* ================= HEADER ================= */
.modalHeader {
  margin-bottom: 1.2rem;
  position: relative;

  h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: $text-dark;
    margin: 0;
  }

  p {
    font-size: 0.85rem;
    color: $text-light;
    margin-top: 0.25rem;
    line-height: 1.4;
  }

  button {
    position: absolute;
    top: 0;
    right: 0;

    width: 32px;
    height: 32px;

    border-radius: 50%;
    border: 1px solid $border;
    background: #fff;

    font-size: 1rem;
    cursor: pointer;

    color: $text-light;

    transition: all 0.2s ease;

    &:hover {
      background: $primary-soft;
      color: $primary;
      transform: scale(1.05);
    }
  }
}

/* ================= FORM ================= */
.modalForm {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ================= FORM GROUP ================= */
.formGroup {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;

  label {
    font-size: 0.78rem;
    font-weight: 600;
    color: $text-dark;
  }

  /* INPUT + SELECT + TEXTAREA UNIFIED */
  input,
  select,
  textarea {
    width: 100%;

    padding: 0.65rem 0.75rem;

    border-radius: 10px;
    border: 1px solid $border;

    font-size: 0.85rem;

    background: #fff;
    color: $text-dark;

    transition: all 0.2s ease;

    &:focus {
      outline: none;
      border-color: $primary-border;
      box-shadow: 0 0 0 2px $primary-soft;
    }
  }

  textarea {
    min-height: 90px;
    resize: none;
  }

  /* SELECT ARROW FIX */
  select {
    appearance: none;
    cursor: pointer;

    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg fill='%235e3817' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7l4.5 4 4.5-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 14px;
  }
}

/* ================= BUTTON ================= */
.submitBtn {
  margin-top: 0.4rem;

  width: 100%;
  padding: 0.7rem;

  border-radius: 12px;
  border: none;

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

  background: linear-gradient(135deg, $primary, $primary-2);
  color: #fff;

  cursor: pointer;

  transition: all 0.25s ease;

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

  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(122, 75, 32, 0.25);
  }

  &:disabled {
    background: $primary-soft;
    color: $text-light;
    cursor: not-allowed;
  }
}

/* ================= ANIMATION ================= */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 500px) {
  .modalContent {
    padding: 1.2rem;
    border-radius: 14px;
  }

  .modalHeader h2 {
    font-size: 1.05rem;
  }

  .modalHeader p {
    font-size: 0.8rem;
  }

  .formGroup input,
  .formGroup select,
  .formGroup textarea {
    font-size: 0.82rem;
  }
}


/* ================= ACTION WRAPPER ================= */
.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ================= TRANSFER BUTTON ================= */
.transferBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 0.55rem 1rem;
  border-radius: 10px;

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

  cursor: pointer;

  border: 1px solid $primary;
  background: linear-gradient(135deg, $primary, $primary-2) !important;

  color: #FFF;

  white-space: nowrap;
  transition: all 0.25s ease;

  /* subtle premium feel */
  box-shadow: 0 4px 12px rgba(122, 75, 32, 0.08);

  svg {
    font-size: 0.95rem;
    transition: transform 0.25s ease;
  }

  /* HOVER */
  &:hover {
    background: linear-gradient(135deg, $primary, $primary-2);
    color: #ffffff;
    border-color: transparent;

    transform: translateY(-1px);

    box-shadow: 0 10px 22px rgba(122, 75, 32, 0.25);

    svg {
      transform: translateX(2px);
    }
  }

  /* ACTIVE */
  &:active {
    transform: scale(0.97);
    box-shadow: 0 4px 10px rgba(122, 75, 32, 0.18);
  }

  /* DISABLED */
  &:disabled {
    background: $primary-soft;
    color: $text-light;
    border-color: $border;
    cursor: not-allowed;
    box-shadow: none;
  }
}

/* ================= MENU ================= */
.menu {
  position: relative;

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

    width: 36px;
    height: 36px;

    border-radius: 10px;
    border: 1px solid $border;
    background: #fff;

    cursor: pointer;

    transition: all 0.2s ease;

    svg {
      color: $text-dark;
      font-size: 1rem;
    }

    &:hover {
      background: $primary-soft;
      border-color: $primary-border;
    }
  }
}

/* ================= DROPDOWN ================= */
.dropdown {
  position: absolute;
  top: 45px;
  right: 0;

  min-width: 180px;
  padding: 0.5rem;

  background: #fff;
  border-radius: 12px;
  border: 1px solid $border;

  box-shadow:
    0 14px 35px rgba(0, 0, 0, 0.08);

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

  z-index: 100;
  animation: dropdownIn 0.2s ease;
}

/* ================= DROPDOWN ITEM ================= */
.dropdown div {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 0.55rem 0.65rem;
  border-radius: 8px;

  font-size: 0.85rem;
  font-weight: 500;

  color: $text-dark;

  cursor: pointer;
  transition: all 0.2s ease;

  svg {
    font-size: 0.9rem;
    opacity: 0.8;
  }

  &:hover {
    background: $primary-soft;
    color: $primary;
  }
}

/* ================= DELETE ================= */
.delete {
  color: #dc2626;

  &:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
  }
}

/* ================= ANIMATION ================= */
@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}



.dataHeadText {
  position: absolute;
  top: 16px;
  right: 18px;

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

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

  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;

  color: #ffffff;

  /* 🔥 glass badge effect */
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);

  border: 1px solid rgba(255, 255, 255, 0.25);

  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.25);

  z-index: 2;

  transition: all 0.25s ease;

  /* subtle hover (optional but nice) */
  &:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
  }
}