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

/* PAGE */
.page {
  @include dashPageComponent;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: $bg-soft;
  border: 1px solid $border;

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

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

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

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

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

  h4 {
    color: $text-dark !important;
    font-size: .95rem;
  }

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

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

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

/* FORM */
.formArea {
  background: #fff;
  border: 1px solid $border;
  border-radius: 12px;
  padding: 1.5rem;
}

/* HEADER */
.formHeader {
  h2 {
    color: $text-dark;
    font-size: .95rem;
  }

  p {
    color: $text-light;
    padding-bottom: .5rem;
    font-size: .9rem;
  }

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

/* 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;
  }
}

/* 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;

  &: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;

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

/* SELECT + TEXTAREA */
select,
textarea {
  border: 1px solid $border;
  padding: 0.6rem;
  border-radius: 8px;
  background: #fff;
  color: $text-dark;

  &: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;
}

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

  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: 900px) {
    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;
}