.listing-container {
  width: 100%;
  max-width: 55rem;
  margin: 40px auto;
  padding: 20px;
}

.listing-page {
  overflow-x: hidden;
}

.listing-card {
  border: 1px solid #ddd;
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
}

.listing-card .listing-card {
  margin-top: 1.25rem;
}

.listing-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
}

.listing-image {
  width: 100%;
  height: clamp(220px, 48vw, 480px);
  object-fit: cover;
  border-radius: 1rem;
  margin: 15px 0;
}

.listing-info {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.listing-info li {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.listing-description {
  grid-column: 1 / -1;
  font-size: 1rem;
  opacity: 0.9;
}

.listing-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #22c55e;
}

.listing-location,
.listing-country {
  text-transform: capitalize;
  opacity: 0.85;
}

.listing-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  flex-wrap: wrap;
}

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 40px;
  max-height: 50px;
  font-size: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.btn-edit {
  background: #000000;
  color: #ffffff;
}

.btn-edit:hover {
  background: #333333;
}

.delete-form {
  background: transparent;
  width: auto;
  max-width: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.listing-actions .delete-form {
  display: flex;
}

.delete-btn {
  background: #dc3545;
  color: #fff;
}

.delete-btn:hover {
  background: #c82333;
}

.review-form {
  background: rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 100%;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  margin-right: auto;
  margin-left: auto;
}

.form-control {
  width: 100%;
  resize: vertical;
}

.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.25rem;
}

.star-rating input {
  display: none;
}

.star-rating label {
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  color: #d1d5db;
}

.star-rating label::before {
  content: "★";
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: #f59e0b;
}

.submit-btn {
  background: #000000;
  color: #ffffff;
  margin-top: 20px;
}

.submit-btn:hover {
  background: #333333;
}

.reviews-section {
  margin-top: 1.25rem;
}

.reviews-heading {
  margin-bottom: 0.9rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.empty-reviews {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  color: #555;
  margin: 0;
}

.review-card {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.review-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.review-rating {
  margin: 0;
  font-size: 0.95rem;
}

.review-stars {
  color: #f59e0b;
  letter-spacing: 0.08em;
}

.review-time {
  margin: 0;
  font-size: 0.82rem;
  color: #666;
}

.review-comment {
  margin: 0.55rem 0 0;
  line-height: 1.45;
}

.open-maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1.1rem;
  background: #fff;
  color: #1a73e8;
  border: 1.5px solid #1a73e8;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.18s,
    color 0.18s;
}

.open-maps-btn:hover {
  background: #1a73e8;
  color: #fff;
}

#map {
  margin-top: 1.25rem;
  width: 100%;
  height: clamp(220px, 40vw, 320px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

#map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 700px) {
  .listing-container {
    margin: 20px auto;
    padding: 12px;
  }

  .listing-card {
    padding: 1rem;
  }

  .listing-info {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .listing-info li {
    padding: 0.85rem 0.95rem;
    font-size: 0.92rem;
  }

  .listing-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .btn {
    width: 100%;
    max-height: none;
  }

  .listing-actions .delete-form {
    width: 100%;
  }

  .review-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .review-form {
    padding: 16px;
    box-shadow: none;
  }

  .star-rating label {
    font-size: 1.65rem;
  }

  .open-maps-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .listing-title {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .listing-price {
    font-size: 1.2rem;
  }

  .review-card {
    padding: 0.75rem 0.8rem;
  }

  .review-comment {
    font-size: 0.92rem;
  }
}
