@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: 4rem;
  padding: 1.5rem;

  background: #fff;
  border-radius: 16px;
  border: 1px solid $border;
  margin-bottom: 3rem;

  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: rgba(34, 197, 94, 0.12);
  color: #16a34a;

  border: 1px solid rgba(34, 197, 94, 0.25);

  box-shadow:
    0 6px 14px rgba(34, 197, 94, 0.18),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.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;
}

.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);
  }
}

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

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

/* SIDEBAR */

/* ================= SIDEBAR (DESKTOP DEFAULT) ================= */
.sidebar {
  background: #fff;
  border: 1px solid $border;
  border-radius: 14px;
  padding: 1rem;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 6px;

  /* ================= MOBILE TRANSFORM ================= */
  @media (max-width: 768px) {
    flex-direction: row;
    overflow-x: auto;
    padding: 6px;
    gap: 6px;

    border-radius: 12px;

    background: #f7f4ef;
    border: 1px solid rgba(0,0,0,0.05);

    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.6),
      0 4px 10px rgba(0,0,0,0.03);

    /* hide scrollbar (clean UI) */
    scrollbar-width: none;
    -ms-overflow-style: none;

    &::-webkit-scrollbar {
      display: none;
    }
  }
}

/* ================= STEP ITEM ================= */
.stepItem {
  padding: .4rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: .2rem;
  transition: all 0.2s ease;

  h4 {
    color: $text-dark;
    font-size: 1rem !important;
    margin: 0;
  }

  p {
    color: $text-light;
    font-size: .9rem !important;
    margin: 2px 0 0;
  }

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

  /* ================= MOBILE STYLE ================= */
  @media (max-width: 768px) {
    min-width: fit-content;
    flex-shrink: 0;

    padding: 0.5rem 1rem;

    display: flex;
    flex-direction: column;
    justify-content: center;

    background: transparent;

    h4 {
      font-size: 0.85rem;
      font-weight: 600;
    }

    p {
      display: none; /* 🔥 remove clutter on mobile */
    }

    &:hover {
      background: rgba(255,255,255,0.6);
    }
  }
}

/* ================= ACTIVE ================= */
.activeStep {
  background: $primary-soft-strong;
  border-left: 3px solid $primary;

  /* ================= MOBILE ACTIVE ================= */
  @media (max-width: 768px) {
    border-left: none !important;

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

    border: 1px solid $border;

    box-shadow:
      0 2px 6px rgba(0,0,0,0.06),
      inset 0 1px 0 rgba(255,255,255,0.7);

    transform: translateY(-1px);
  }
}

/* HEADER */
.formHeader {
  h2 {
    color: $text-dark;
    font-size: .95rem;
    @media (max-width: 768px) {
      font-size: 1.3rem !important;
    }
  }

  p {
    color: $text-light;
    padding-bottom: .5rem;
    font-size: .9rem;
    @media (max-width: 768px) {
      font-size: 1.1rem !important;
    }
  }

  span {
    color: $primary;
    font-size: 0.8rem;
    font-weight: 600;
    @media (max-width: 768px) {
      font-size: 1rem !important;
    }
  }
}

/* BODY */
.formBody {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* BIO GRID */
.bioGrid {
  grid-template-columns: repeat(3, 1fr);

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

/* FULL WIDTH */
.fullWidth {
  grid-column: 1 / -1;
}

/* INPUT */
.inputGroup {
  display: flex;
  flex-direction: column;

  label {
    color: $text-dark;
    font-size: 0.8rem;
    font-weight: 600;
    padding-bottom: .3rem;
    @media (max-width: 768px) {
      font-size: .9rem !important;
      padding-bottom: .1rem !important;
    }
  }
}

/* INPUT WRAPPER */
.inputWrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid $border;
  padding: 0.6rem;
  border-radius: 8px;
  background: #fff;
  transition: all 0.2s ease;
  @media (max-width: 768px) {
      height: 3rem !important;
    }

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

  svg {
    color: $primary;
  }

  input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.85rem;
    color: $text-dark;
    @media (max-width: 768px) {
      font-size: 1rem !important;
    }

    &::placeholder {
      color: $text-light;
    }
  }
}

/* SELECT + TEXTAREA */
select,
textarea {
  border: 1px solid $border;
  padding: 0.6rem;
  border-radius: 8px;
  background: #fff;
  color: $text-dark;
  @media (max-width: 768px) {
    font-size: 1rem !important;
  }

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

  &::placeholder {
    color: $text-light;
  }
}

/* FOOTER */
.footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;

  button {
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
  }
}

.footer button:first-child {
  border: 1px solid $border;
  background: #fff;
  color: $text-dark;

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

.footer button:not(.submit):not(:first-child) {
  border: 1px solid $primary;
  color: $primary;

  &:hover {
    background: $primary;
    color: #fff;
  }
}

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

/* MODAL */
.modalBackdrop {
  background: rgba(0,0,0,0.35);
}

.iconWrapper {
  background: rgba(220,38,38,0.1);
}

/* PLACES */
.placeHeader {
  background: $bg-soft;

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

  span {
    color: $primary;
  }
}

.placeActions button:hover {
  background: $primary-soft;
}

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

.searchOption:hover {
  background: $primary-soft;
}

/* ================= PLACES WRAPPER ================= */
.placeWrapper {
  margin-bottom: 1rem;
}

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

  gap: 0.6rem;

  background: $bg-soft;
  border: 1px solid $border;
  padding: 0.8rem 1rem;
  border-radius: 12px;

  transition: all 0.25s ease;
  cursor: pointer;

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

/* ================= TITLE ================= */
.placeTitle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;

  flex: 1;

  h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: $text-dark;
    margin: 0;
  }
}

/* ================= BADGES ================= */
.currentBadge {
  background: $primary-soft;
  color: $primary;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.errorBadge {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* ================= ACTIONS ================= */
.placeActions {
  display: flex;
  align-items: center;
  gap: 0.35rem;

  flex-shrink: 0;

  button {
    all: unset;
    width: 30px;
    height: 30px;
    border-radius: 8px;

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

    background: #fff;
    border: 1px solid $border;

    cursor: pointer;
    transition: all 0.2s ease;

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

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

      svg {
        color: $primary;
      }
    }

    &:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
  }

  span {
    width: 30px;
    height: 30px;

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

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

    font-size: 0.9rem;
    font-weight: 600;
    color: $primary;

    background: #fff;
    cursor: pointer;

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

/* ================= CARD ================= */
.placeCard {
  margin-top: 0.7rem;

  padding: 1rem;
  border-radius: 12px;

  border: 1px solid $border;
  background: #fff;

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

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

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

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

/* ================= DIVIDER ================= */
.placeDivider {
  border: none;
  border-top: 1px dashed $border;
  margin-top: 1rem;
}

/* ================= HEADER BUTTON ================= */
.placesHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;

  h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: $text-dark;
  }

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

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

    border: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;

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

    cursor: pointer;
    transition: all 0.25s ease;

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

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



.stepItem {
  padding: 0.8rem;
  border-radius: 10px;
  cursor: pointer;

  h4 {
    font-size: 0.9rem;
    color: $text-dark;
  }

  p {
    font-size: 0.75rem;
    color: $text-light;
  }

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

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

/* ================= FORM ================= */
.formArea {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid $border;
  margin-bottom: 10rem !important;
}

/* ================= HEADER ================= */
.formHeader {
  margin-bottom: 2rem;

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

  p {
    font-size: 0.85rem;
    color: $text-light;
  }

  span {
    font-size: 0.75rem;
    color: $primary;
    font-weight: 600;
  }
}

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

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

/* BIO GRID */
.bioGrid {
  grid-template-columns: repeat(3, 1fr);

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

/* FULL WIDTH */
.fullWidth {
  grid-column: 1 / -1;
}

/* ================= INPUT ================= */
.inputGroup {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;

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

/* ================= INPUT WRAPPER ================= */
.inputWrapper {
  display: flex;
  align-items: center;
  gap: 8px;

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

  padding: 0.65rem 0.8rem;
  background: #fff;

  transition: 0.2s;

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

  svg {
    color: $primary;
  }

  input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.85rem;
  }
}

/* ================= SELECT ================= */
select {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid $border;
  background: #fff;

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

/* ================= SEARCHABLE SELECT ================= */
.searchSelectWrapper {
  position: relative;
}

.searchInput {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid $border;
  font-size: 0.85rem;

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

.searchDropdown {
  position: absolute;
  width: 100%;
  background: #fff;
  border: 1px solid $border;
  border-radius: 10px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}

.searchOption {
  padding: 0.6rem 0.8rem;
  cursor: pointer;

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

.noResult {
  padding: 0.6rem;
  font-size: 0.8rem;
  color: $text-light;
}

/* ================= ERROR ================= */
.error {
  font-size: 0.75rem;
  color: #dc2626;
}

/* ================= PLACES ================= */
.placeWrapper {
  margin-bottom: 1rem;
}

.placeHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: $bg-soft;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid $border;
}

.placeTitle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.placeActions {
  display: flex;
  gap: 0.3rem;

  button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid $border;
    background: #fff;

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

.placeCard {
  margin-top: 0.6rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid $border;
}

.placeRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;

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

/* ================= FOOTER ================= */
.footer {
  margin-top: 1.8rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: nowrap; /* 🔥 prevents breaking */

  @media (max-width: 600px) {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ================= BASE BUTTON ================= */
.primaryBtn,
.primaryOutline,
.secondaryBtn {
  display: inline-flex; /* 🔥 FIX */
  align-items: center;
  justify-content: center;
  gap: 6px;

  white-space: nowrap; /* 🔥 PREVENT TEXT BREAK */
  flex-shrink: 0; /* 🔥 prevents squishing */

  padding: 0.65rem 1.2rem;
  border-radius: 10px;

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

  cursor: pointer;
  transition: all 0.25s ease;
}

/* ================= PRIMARY ================= */
.primaryBtn {
  background: linear-gradient(135deg, $primary, $primary-2);
  color: #fff !important; 
  border: none;

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

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

/* ================= OUTLINE ================= */
.primaryOutline {
  border: 1px solid $primary;
  color: $primary;
  background: transparent;

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

/* ================= SECONDARY ================= */
.secondaryBtn {
  border: 1px solid $border;
  background: #fff;
  color: $text-dark;

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

/* ================= ICON FIX ================= */
.primaryBtn svg,
.primaryOutline svg,
.secondaryBtn svg {
  font-size: 0.95rem;
  display: inline-flex;
}

/* ================= MOBILE ================= */
@media (max-width: 600px) {
  .primaryBtn,
  .primaryOutline,
  .secondaryBtn {
    width: 100%;
  }
}

/* ================= TEXTAREA ================= */
textarea {
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid $border;
}