/* Modal */
.modal {
  display: none;
}
.modal.open {
  display: block;
}
.modal .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
}
.modal .modal-content {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 35%;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #433f39b7;
  color: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  z-index: 99999;
}
.modal-close {
  color: #ffffff;
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;

  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

/* Two-column form row */
.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr; /* equal width */
  gap: 15px; /* spacing between columns */
}

.form-row.two-cols div {
  display: flex;
  flex-direction: column;
}

.form-row.two-cols label {
  font-size: 14px;
  margin-bottom: 5px;
  color: #fff;
}

.form-row.two-cols input,
.form-row.two-cols select {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* Form */
.form-row {
  display: flex;
  flex-direction: column;
  margin: 10px 0;
}
.form-row label {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 6px;
}
.form-row input,
.form-row select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

/* Two-column layout inside form */
.form-columns {
  display: flex;
  gap: 20px;
}

.form-column {
  flex: 1;
}

/* Keep rows tidy */
.form-row {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.form-row label {
  font-size: 14px;
  margin-bottom: 5px;
  color: #ffffff;
}

.form-row input,
.form-row select {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s ease;
}

.form-row input:focus,
.form-row select:focus {
  border-color: #a64b2a;
}

/* Grid for directions */
.direction-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns */
  gap: 15px 25px; /* row gap / column gap */
}

.direction-grid .form-row {
  display: flex;
  flex-direction: column;
}

.direction-grid label {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
  color: #ffffff;
}

.direction-grid p {
  margin: 0;
  font-size: 14px;
  color: #ffffff;
}

.phone-field {
  display: flex;
  flex: 1;
}

.phone-field select {
  width: 80px;
}

.phone-input {
  margin-left: 10px; /* Adjust the spacing as needed */
}

.scrollable-select {
  max-height: 200px;
  overflow-y: auto;
}

/* Responsive: stack columns on small screens */
@media (max-width: 768px) {
  .form-columns {
    flex-direction: column;
  }
}

/* Form fields */
.form-row {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.form-row label {
  font-size: 14px;
  margin-bottom: 5px;
  color: #333;
}

.form-row input,
.form-row select {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s ease;
}

.form-row input:focus,
.form-row select:focus {
  border-color: #a64b2a; /* brown highlight */
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 25px;
}

.btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

#query-title {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 20px;
}

/* Submit Button */
.btn-apply {
  background: linear-gradient(135deg, #43d274, #43d274);
  color: #fff;
  box-shadow: 0 4px 10px rgba(166, 75, 42, 0.3);
}

.btn-apply:hover {
  background: linear-gradient(135deg, #43d274, #43d274);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(166, 75, 42, 0.4);
}

/* Cancel Button */
.btn-reset {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}

.btn-reset:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Default (desktop ~ 1024px+) */
.modal .modal-content {
  width: 35%;
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 1024px) and (orientation: landscape) {
  .modal .modal-content {
    width: 70%; /* medium width */
    max-height: 70%;
    overflow-y: auto;
    padding: 10px 12px;
  }
}

/* Tablet portrait & small landscape (≤1024px) */
@media (max-width: 1024px) {
  .modal .modal-content {
    width: 70%; /* medium width */
    max-height: 85vh;
    overflow-y: auto;
    padding: 15px 18px;
  }

  .form-row.two-cols input,
  .form-row.two-cols select {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
  }

  .form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-direction: row; /* force side by side */
  }

  .btn {
    width: 100%; /* full-width buttons */
    text-align: center;
    padding: 5px 8px;
    font-size: 12px;
  }

  #query-title {
    font-size: 16px;
    margin-top: -10px;
    margin-bottom: 15px;
  }

  .form-row.two-cols label {
    font-size: 12px;
    margin-bottom: 5px;
    color: #fff;
  }
  .form-columns {
    flex-direction: column; /* stack left + right columns */
  }

  .form-row.two-cols {
    grid-template-columns: 1fr; /* stack paired fields */
  }
}

/* Mobile landscape (≤768px) */
@media (max-width: 768px) and (orientation: portrait) {
  .modal .modal-content {
    width: 85%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-height: 85vh;
    overflow-y: auto;
  }

  .btn {
    width: 100%;
  }

  .form-actions .btn {
    flex: 1; /* equal width */
    width: auto;
  }
}

/* Mobile landscape (≤768px) */
@media (max-width: 768px) and (orientation: landscape) {
  .modal .modal-content {
    width: 70%;
    top: 50%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .form-row.two-cols input,
  .form-row.two-cols select {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
  }

  .btn {
    width: 100%; /* full-width buttons */
    text-align: center;
    padding: 5px 8px;
    font-size: 12px;
  }

  #query-title {
    font-size: 16px;
    margin-top: -10px;
    margin-bottom: 15px;
  }

  .form-row.two-cols label {
    font-size: 12px;
    margin-bottom: 5px;
    color: #fff;
  }
}

/* Mobile portrait (≤480px) */
@media (max-width: 480px) {
  .form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .form-actions .btn {
    flex: 2; /* equal width */
    width: auto; /* reset 100% */
  }

  .modal .modal-content {
    top: 50%;
  }
  .form-row.two-cols input,
  .form-row.two-cols select {
    padding: 5px 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
  }

  .modal .modal-content {
    position: fixed;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 16px 18px;
    transform: translate(-50%, -50%);
  }

  #query-title {
    font-size: 18px;
    margin-bottom: 15px;
  }

  .btn {
    width: 100%; /* full-width buttons */
    text-align: center;
    padding: 6px 10px;
    font-size: 14px;
  }

  .form-actions {
    gap: 10px;
  }
}

/* Plot Details Section */
.plot-details-section {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.plot-details-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
}

.plot-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.plot-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plot-detail-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.plot-detail-value {
  font-size: 14px;
  color: #ffffff;
  font-weight: 600;
}

/* Responsive adjustments for plot details */
@media (max-width: 768px) {
  .plot-details-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .plot-details-title {
    font-size: 14px;
  }
  
  .plot-detail-label {
    font-size: 11px;
  }
  
  .plot-detail-value {
    font-size: 13px;
  }
}
