/* ===============================
   FORM GỬI BẤT ĐỘNG SẢN
=============================== */

#wpr-submit-property-form {
    max-width: 750px;
    margin: 30px auto;
    padding: 25px 30px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    font-family: "Inter", sans-serif;
}

/* Mỗi dòng input mặc định */
#wpr-submit-property-form p {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

/* --- Nhóm hai hoặc ba input trên cùng hàng --- */
.wpr-row-2,
.wpr-row-3 {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.wpr-row-2 > p,
.wpr-row-3 > p {
    flex: 1;
    margin-bottom: 0;
    min-width: 220px;
}

/* Label */
#wpr-submit-property-form label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

/* Input, Select, Textarea, File */
#wpr-submit-property-form input[type="text"],
#wpr-submit-property-form input[type="number"],
#wpr-submit-property-form input[type="url"],
#wpr-submit-property-form select,
#wpr-submit-property-form textarea,
#wpr-submit-property-form input[type="file"] {
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Focus style */
#wpr-submit-property-form input:focus,
#wpr-submit-property-form select:focus,
#wpr-submit-property-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.15);
}

/* Textarea */
#wpr-submit-property-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* --- Radio hàng ngang (tình trạng BĐS) --- */
.wpr-row-2 label input[type="radio"] {
    margin-right: 5px;
}
.wpr-row-2 label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 10px;
}

/* ===============================
   NÚT HÀNH ĐỘNG
=============================== */

.wpr-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.wpr-actions .button {
    flex: 1;
    padding: 10px 18px;
    font-size: 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    color: #fff;
    text-align: center;
}

.wpr-actions .wpr-preview {
    background-color: #6c757d;
}
.wpr-actions .wpr-preview:hover {
    background-color: #5a6268;
}

.wpr-actions .wpr-draft {
    background-color: #17a2b8;
}
.wpr-actions .wpr-draft:hover {
    background-color: #138496;
}

.wpr-actions .wpr-publish {
    background-color: #0073aa;
}
.wpr-actions .wpr-publish:hover {
    background-color: #005f8c;
}

.wpr-actions button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* ===============================
   THÔNG BÁO KẾT QUẢ
=============================== */
.wpr-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.wpr-message.success {
    background-color: #e6f9ed;
    border: 1px solid #b6e2c3;
    color: #256c38;
}

.wpr-message.error {
    background-color: #fdeaea;
    border: 1px solid #f5b2b2;
    color: #b91c1c;
}

/* ===============================
   ẢNH ĐẠI DIỆN PREVIEW
=============================== */
.wpr-thumbnail-preview {
    display: block;
    margin: 10px 0;
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ===============================
   POPUP CHỌN ĐỊA CHỈ
=============================== */
#wpr-address-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#wpr-address-modal .wpr-address-modal-inner {
    background: #fff;
    padding: 25px 30px;
    border-radius: 10px;
    width: 95%;
    max-width: 480px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

#wpr-address-modal h3 {
    margin-top: 0;
    font-size: 18px;
    color: #0073aa;
    margin-bottom: 15px;
}

#wpr-address-modal p {
    margin-bottom: 12px;
}

#wpr-address-modal input,
#wpr-address-modal select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

#wpr-address-modal .wpr-address-modal-inner .button {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.wpr-address-done {
    background: #0073aa;
    color: #fff;
}
.wpr-address-cancel {
    background: #ccc;
}

/* ===============================
   RESPONSIVE
=============================== */
@media (max-width: 600px) {
    #wpr-submit-property-form {
        padding: 15px;
    }

    .wpr-row-2,
    .wpr-row-3 {
        flex-direction: column;
        gap: 0;
    }

    .wpr-actions {
        flex-direction: column;
    }

    .wpr-actions button {
        width: 100%;
    }
}

/* === POPUP NHẬP ĐỊA CHỈ === */
.wpr-address-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.wpr-popup-inner {
  background: #fff;
  padding: 25px 30px;
  border-radius: 10px;
  width: 95%;
  max-width: 480px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.wpr-popup-inner h3 {
  margin-top: 0;
  font-size: 18px;
  color: #0073aa;
  margin-bottom: 15px;
  text-align: center;
}

.wpr-popup-inner p {
  margin-bottom: 12px;
}

.wpr-popup-inner input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.wpr-popup-inner .popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.wpr-popup-inner .btn-cancel,
.wpr-popup-inner .btn-save {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.wpr-popup-inner .btn-cancel {
  background: #ccc;
  color: #333;
}

.wpr-popup-inner .btn-save {
  background: #0073aa;
  color: #fff;
}


/* === POPUP XEM TRƯỚC BÀI ĐĂNG === */
.wpr-preview-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.wpr-preview-inner {
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  width: 95%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  position: relative;
  animation: fadeInScale 0.3s ease;
}

.wpr-preview-inner h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 20px;
  color: #0073aa;
}

.wpr-preview-content {
  line-height: 1.6;
  color: #333;
  font-size: 15px;
}

.wpr-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f1f1f1;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.wpr-preview-close:hover {
  background: #ddd;
}

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


/* ✅ Popup trạng thái */
#wpr-status-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
}

#wpr-status-popup .wpr-popup-inner {
  background: #fff;
  padding: 25px 30px;
  border-radius: 10px;
  text-align: center;
  width: 380px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  animation: fadeInScale 0.3s ease;
}

#wpr-status-popup h3 {
  margin: 0 0 10px;
  font-size: 20px;
  color: #333;
}

#wpr-status-popup p {
  font-size: 16px;
  color: #444;
  margin: 10px 0 20px;
}

#wpr-status-popup .btn-ok {
  background: #0073aa;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

#wpr-status-popup .btn-ok:hover {
  background: #005c87;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
