/* --- Toàn bộ wrapper chính --- */
.post-detail-wrapper {
  background-color: #f5f6fa;
  color: #222;
  line-height: 1.6;
  padding-bottom: 30px;
}

/* Container max-width, căn giữa */
.post-detail-container {
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
  padding: 25px 20px;
}

/* --- Header --- */
.post-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-back {
  font-size: 18px;
  color: #333;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.btn-back:hover {
  background-color: #fefefe;
  text-decoration: none;
}

/* --- Main content container --- */
/* Layout chính: media bên trái, info bên phải */

.post-main-content-wrapper {
  display: flex;
  gap: 20px;
  max-width: 1000px;
  margin: auto;
}


.post-main-wrapper {
  align-items: flex-start;
  margin-bottom: 40px;
}

/* Phần media */
.post-media {
  flex: 1;
  max-width: 50%;
}

/* Phần slider ảnh lớn */
.post-main-content .main-slider {
  width: 100%; 
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgb(0 0 0 / 0.1);
}

.post-main-content .main-slider img,
.post-main-content .main-slider video {
  width: 100%;
  height: 450px;
  object-fit: contain;
  border-radius: 8px;
}

/* Thumbnail slider */
.post-main-content .thumbnail-slider {
  margin-top: 15px;
  width: 100%;
  max-width: 800px;
  overflow-x: auto; /* Cho phép cuộn ngang nếu thumbnails nhiều */
  padding-bottom: 5px;
}

.thumbnail-slider .swiper-wrapper {
  display: flex;
}

.thumbnail-slider .swiper-slide {
  flex: 0 0 auto; /* giữ kích thước cố định, không co giãn */
  width: 100px !important;
  height: 80px;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #666;
  user-select: none;
}

.thumbnail-slider .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* Highlight khi chọn thumbnail */
.thumbnail-slider .swiper-slide-thumb-active {
  border-color: #7BAE4C;
  box-shadow: 0 0 6px #7BAE4C;
}

/* Video thumbnail đặc biệt */
.thumbnail-slider .video-thumb {
  background: #000;
  font-weight: 700;
  font-size: 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.thumbnail-slider .video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
}
.video-thumb {
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
}

.video-thumb video {
  display: block;
}


.thumbnail-slider .swiper-wrapper {
  display: flex;
  margin-top: 10px;
}

/* Nút prev/next */
.thumbnail-slider .swiper-button-next,
.thumbnail-slider .swiper-button-prev {
  position: absolute;
  top: 75%;
  transform: translateY(-50%);
  width: 25px;
  height: 50px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.2); 
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s;
}

/* ✅ Ghi đè font-size cho icon Swiper dùng */
.thumbnail-slider .swiper-button-next::after,
.thumbnail-slider .swiper-button-prev::after {
  font-size: 12px; /* bạn muốn nhỏ thì chỉnh ở đây */
  color: #fff;
}

.thumbnail-slider .swiper-button-next:hover,
.thumbnail-slider .swiper-button-prev:hover {
  background: #A2D56F; /* xanh trong suốt */
  color: #fff;
}

/* Vị trí trái/phải */
.thumbnail-slider .swiper-button-prev {
  left: 0;
}

.thumbnail-slider .swiper-button-next {
  right: 0;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  pointer-events: none;
}

.play-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent white;
}



/* Phần thông tin bài viết bên phải */
.post-info-container {
  border-radius: 12px;
  padding: 0 15px;
}

.post-title {
  font-size: 28px;
  border-radius: 8px;
  font-weight: bold;
  color: #333;
  line-height: 1.3;
}

/* Phần lưu bài và báo cáo */
.post-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin: 20px 0;
}

.post-actions button,
.post-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-actions button:hover,
.post-actions a:hover {
    background-color: #e2e6ea;
    color: #000;
    border-color: #999;
}

.post-actions i {
    font-size: 16px;
}

.btn-bookmark.saved {
    background-color: #A2D56F;
    color: white;
    border-color: #A2D56F;
}


/* Form trong modal */
#reportForm {
  display: flex;
  flex-direction: column;
}

/* Label radio đẹp hơn */
#reportForm label {
  display: flex;
  align-items: center;
  font-size: 1rem;
  color: #555;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

#reportForm label:hover {
  color: #007bff;
}

/* Radio input ẩn, dùng custom */
#reportForm input[type="radio"] {
  width: 20px;
  margin-right: 12px;
  accent-color: #007bff; 
  cursor: pointer;
}

/* Textarea */
#reportForm textarea {
  resize: vertical;
  min-height: 80px;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

#reportForm textarea:focus {
  border-color: #007bff;
  outline: none;
}

/* Button gửi báo cáo */
#reportForm button[type="submit"] {
  background-color: #007bff;
  border: none;
  color: white;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.25s ease;
  margin-bottom: 12px;
}

#reportForm button[type="submit"]:hover {
  background-color: #0056b3;
}


/* Hiển thị người đăng bài */
/* Hiển thị người đăng bài */
.post-author {
  margin-top: 20px;
  margin-bottom: 20px;
}

.author-label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
    font-size: 15px;
}

.author-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background-color: #f9f9f9;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    position: relative;
}

.author-avatar {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ddd;
}

.author-details {
    flex: 1;
}

.author-details p {
    margin: 4px 0;
    color: #555;
    font-size: 14px;
}

.rating-stars {
    color: #f4c150;
    font-size: 16px;
    display: inline-block;
    vertical-align: middle;
}

.star {
    margin-right: 2px;
}

.author-name {
    font-weight: 600;
    color: #222;
    font-size: 16px;
    margin-bottom: 5px;
    display: block;
}

.view-user-link {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #7BAE4C;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.view-user-link:hover {
    color: #03b300;
    text-decoration: underline;
}



/* Hiển thị giá */
.badge-free {
  display: inline-block;
  padding: 2px 6px;
  background-color: #2ecc71;
  color: white;
  font-size: 24px;
  border-radius: 4px;
}

.badge-price {
  font-size: 24px;
  font-weight: bold;
  color: #e74c3c;
}

.post-location{
  margin-top: 20px;
}
.post-location p {
  margin: 6px 0;
  font-size: 16px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-location i {
  color: #333; /* màu xanh dịu */
  font-size: 18px;
}

.address-link {
  color: #333;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

.address-link:hover {
  color: #A2D56F;
  text-decoration: underline;
}

.post-metadata {
  margin-top: 12px;
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 25px;
}

.post-metadata i {
  color: #95a5a6;
}

/* Gọi điện và nhắn tin */

.contact-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.call-btn,
.message-btn {
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s ease;
}

.call-btn {
  background-color: #2ecc71;
  color: #fff;
}

.call-btn:hover {
  background-color: #27ae60;
}

.no-phone-warning {
  background-color: #fff3cd; /* Vàng nhạt */
  color: #856404; /* Màu chữ cảnh báo */
  border: 1px solid #ffeeba;
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 500;
}
.no-phone-warning i {
  font-size: 16px;
}



.message-btn {
  background-color: #3498db;
  color: #fff;
}

.message-btn:hover {
  background-color: #2980b9;
}


/* --- Mô tả sản phẩm --- */

.post-info-container {
    flex-wrap: 1;
    max-width: 50%;
}
.post-description {
margin: 40px 0;
background: #f9f9f9;
padding: 25px 30px;
border-radius: 12px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
max-width: 1000px;
}

.post-description h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #222;
}

.content-html {
  font-size: 16px;
  line-height: 1.8;
  color: #444;
  background: #fff;
  padding: 25px 30px;
  border-radius: 12px;
  border: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}


/* --- Thông tin chi tiết (bảng) --- */
.post-attributes {
  margin: 40px auto;
  background: #f9f9f9;
  padding: 25px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  max-width: 1000px;
}

.post-attributes h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #222;
}

.post-attributes table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  color: #444;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.post-attributes th,
.post-attributes td {
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
  vertical-align: middle;
}

.post-attributes th {
  width: 35%;
  font-weight: 600;
  background-color: #f6f8fa;
  color: #333;
}

.post-attributes tr:nth-child(even) td {
  background-color: #fafafa;
}

.post-attributes tr:hover td {
  background-color: #f0f4f8;
  transition: background-color 0.3s ease;
}

.post-attributes tr:last-child td {
  border-bottom: none;
}


/* model đăng nhập */
.modal {
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* mờ nền */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hộp nội dung */
.modal-post {
    background-color: #fff;
    padding: 30px 20px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease-in-out;
    text-align: center;
}

/* Tiêu đề */
.modal-post h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

/* Nút đăng nhập */
.modal-post .btn {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    margin-right: 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.modal-post .btn:hover {
    background-color: #0056b3;
}

/* Nút hủy */
.modal-post button {
    padding: 10px 20px;
    background-color: #ccc;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-post button:hover {
    background-color: #aaa;
}

/* Hiệu ứng hiện modal */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Nút chia sẻ trong bài viết */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.share-content {
  background: white;
  padding: 20px 25px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  text-align: center;
}

.share-content h3 {
  margin-bottom: 15px;
  font-size: 20px;
}

.share-content a, .share-content button {
  display: block;
  margin: 10px auto;
  width: 100%;
  text-align: center;
  padding: 10px;
  border: none;
  background: #f1f1f1;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  color: #333;
}

.share-contentnt a:hover, .share-content button:hover {
  background: #ddd;
}

/* --- Responsive --- */
/* --- Tablet (màn hình dưới 992px) --- */
@media (max-width: 991px) {
  .post-detail-wrapper {
    padding: 0px 5px;
  }

  .post-detail-container {
    padding: 20px;
  }

  .post-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-main-content-wrapper {
    flex-direction: column;
    gap: 25px;
  }

  /* Làm cho phần media chiếm rõ ràng, nổi bật */
  .post-media {
    width: 100%;
    max-width: 100%;
    order: -1; /* đẩy media lên đầu nếu cần */
    }

  .post-main-content {
    width: 100%;
  }

  .post-main-content .main-slider img,
  .post-main-content .main-slider video {
    width: 100%;
    height: 500px; /* hoặc 100vw nếu muốn full chiều rộng màn */
  }

  /* Thumbnails chỉnh lại nhỏ gọn hơn */
  .thumbnail-slider .swiper-slide {
    width: 90px !important;
    height: 70px;
  }

  .thumbnail-slider .swiper-button-next,
  .thumbnail-slider .swiper-button-prev {
    display: none;
  }

  .post-info-container {
    padding: 5px;
    max-width: 100%;
  }

  .post-info {
    width: 100%;
    max-width: 100%;
  }
  .post-description ,
  .post-attributes  {
    padding: 0;
}
.post-actions button, .post-actions a {
    padding: 8px 8px;
    font-size: 12px;
}
}


/* --- Mobile (màn hình dưới 576px) --- */
@media (max-width: 575px) {
  .post-detail-wrapper {
    padding: 10px 5px;
  }

  .post-detail-container {
    padding: 10px;
  }
  .btn-back {
    font-size: 12px;
  }

  .post-main-content .main-slider img,
  .post-main-content .main-slider video {
    height: 250px;
  }

  .thumbnail-slider .swiper-slide {
    width: 70px !important;
    height: 60px;
  }

  .thumbnail-slider .swiper-button-next,
  .thumbnail-slider .swiper-button-prev {
    width: 20px;
    height: 40px;
  }

  .thumbnail-slider .swiper-button-next::after,
  .thumbnail-slider .swiper-button-prev::after {
    font-size: 10px;
  }

  .play-icon {
    width: 30px;
    height: 30px;
  }

  .play-icon::before {
    border-width: 8px 0 8px 12px;
  }
  .thumbnail-slider .swiper-button-next,
  .thumbnail-slider .swiper-button-prev {
    display: none;
  }
  .post-location p {
    font-size: 14px;
    gap: 6px;
  }
  
  .post-location i {
    font-size: 16px;
  }
  
  .address-link {
    font-size: 14px;
  }
  
  .post-metadata {
    font-size: 12px;
    gap: 20px;
  }
  
  .post-metadata i {
    font-size: 14px;
  }
  .contact-actions {
    flex-direction: column;
    gap: 8px;
  }

  .call-btn,
  .message-btn {
    justify-content: center;
    width: 100%;
    font-size: 16px;
  }
  .btn-bookmark.saved {
    background-color: #A2D56F;
    color: white;
    border-color: #A2D56F;
  }

  /* Model đăng nhập */
  .modal-post {
      width: 95%;
      padding: 20px 15px;
      border-radius: 10px;
    }

    .modal-post h3 {
      font-size: 18px;
      line-height: 1.4;
    }

    .modal-post .btn,
    .modal-post button {
      display: block;
      width: 100%;
      margin: 10px 0;
      font-size: 16px;
      padding: 10px;
    }
}
