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

.add__estate {
  background: rgba(0, 0, 0, 0.9);
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 2rem 1rem;

  &__content {
    background: #141414;
    padding: 2rem;
    width: 100%;
    max-width: 460px;
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    color: variables.$col-white;
    margin: 4rem auto;
    position: relative;
    overflow: hidden;
  }

  &__content--close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: variables.$col-danger-bg;
    color: variables.$col-danger-color;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1;
    transition: background 0.18s ease;
    &:hover {
      background: darken(variables.$col-danger-bg, 6%);
    }
  }

  &__content--details {
    &--header {
      margin-bottom: 1.25rem;

      &--helper {
        background: variables.$col-orange;
        display: inline-block;
        margin-bottom: 1rem;
        max-width: 40%;
        padding: 0.35rem 0.6rem;
        border-radius: 20px;
        color: variables.$col-dark;
        font-size: 0.72rem;
        font-weight: 600;
        text-align: center;
        text-transform: capitalize;
      }

      h2 {
        margin: 0 0 0.6rem 0;
        font-weight: 600;
        font-size: 1.05rem;
        color: variables.$col-white;
        border-bottom: 1px solid variables.$col-border-lining;
        padding-bottom: 0.5rem;
      }

      p {
        margin: 0 0 1.2rem 0;
        font-size: 0.85rem;
        color: variables.$col-white;
        opacity: 0.85;
        line-height: 1.6;
      }

      button {
        background: variables.$col-primary-btn;
        padding: 0.8rem 0.6rem;
        border-radius: 10px;
        color: variables.$col-white;
        font-size: 0.9rem;
        font-weight: 600;
        width: 100%;
        border: none;
        cursor: pointer;
      }
    }

    form {
      display: grid;
      gap: 0.85rem;

      label {
        font-size: 0.82rem;
        color: #cfcfcf;
        margin-bottom: 0.25rem;
        display: block;
        font-weight: 500;
      }

      input,
      select,
      textarea {
        @include mixins.formInput;
        width: 100%;
        background: #1e1e1e;
        border: 1px solid #2f2f2f;
        box-shadow: none !important;
        border-radius: 0.5rem;
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
        color: #eee;
        transition: border-color 0.18s ease, box-shadow 0.18s ease;
      }

      input:focus,
      select:focus,
      textarea:focus {
        outline: none;
        border-color: variables.$col-primary-btn;
        box-shadow: 0 0 0 6px rgba(34, 96, 255, 0.06);
      }

      input::placeholder,
      textarea::placeholder {
        color: #8a8a8a;
      }

      select {
        font-size: 0.9rem;
        appearance: none;
        background-image: linear-gradient(45deg, transparent 50%, #fff 50%),
          linear-gradient(135deg, #fff 50%, transparent 50%);
        background-position: calc(100% - 18px) calc(1em + 2px),
          calc(100% - 13px) calc(1em + 2px);
        background-size: 5px 5px, 5px 5px;
        background-repeat: no-repeat;
        padding-right: 2.2rem;
      }

      textarea {
        min-height: 6rem;
        padding: 0.75rem;
        resize: vertical;
        color: #eee;
      }

      /* field grouping if you want two-in-row later */
      .row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
      }

      button[type="submit"] {
        background: variables.$col-orange;
        padding: 0.75rem 0.6rem;
        border-radius: 10px;
        color: variables.$col-dark;
        font-size: 0.95rem;
        font-weight: 700;
        width: 100%;
        margin-top: 0.35rem;
        border: none;
        cursor: pointer;
        transition: background 0.18s ease, box-shadow 0.18s ease;
        &:hover {
          background-color: #e66a00;
          box-shadow: 0 6px 18px rgba(230, 106, 0, 0.12);
        }
      }
    }
  }
}

/* Hide scrollbar in WebKit browsers for the modal container */
.add__estate::-webkit-scrollbar {
  display: none !important;
}

/* Responsive adjustments */
@media only screen and (max-width: 600px) {
  .add__estate {
    padding: 1rem;
    &__content {
      width: 100%;
      max-width: 100%;
      margin: 1.5rem auto;
      border-radius: 0.5rem;
      padding: 1.25rem;
    }
  }

  .add__estate .row {
    grid-template-columns: 1fr;
  }

  .add__estate__content--close {
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.75rem;
  }
}
