@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* ================================================= */
/* --- GLOBAL STYLES --- */
/* ================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden !important;
}

body {
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at 20% 20%, #101530, #02040a);
  color: #fff;
  margin: 0;
  padding: 0;
}

/* ================================================= */
/* --- BASE LAYOUT --- */
/* ================================================= */
.post-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1400px;
  margin: 20px auto;
  padding: 20px;
  gap: 30px;
}

.post-left {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
  background: rgba(20, 25, 40, 0.85);
  border: 1px solid rgba(0, 180, 255, 0.2);
  border-radius: 15px;
  padding: 20px;
}

.post-image {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 0 15px #00b4ff40, 0 0 30px #ff006640;
}

.post-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #00b4ff;
  text-shadow: 0 0 8px #00b4ff;
  margin-bottom: 15px;
  line-height: 1.3;
}

.post-meta {
  font-size: 0.95rem;
  color: #ccc;
  border-bottom: 1px solid rgba(0, 180, 255, 0.2);
  padding-bottom: 10px;
  display: block;
}
.post-meta span {
  display: block;
  margin-bottom: 8px;
}
.post-meta strong {
  color: #fff;
  font-weight: 600;
}

/* ================================================= */
/* --- NỘI DUNG CHÍNH --- */
/* ================================================= */
.post-content {
  flex: 2;
  min-width: 0;
  background: rgba(20, 25, 40, 0.85);
  border: 1px solid rgba(0, 180, 255, 0.2);
  border-radius: 15px;
  padding: 30px;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #f0f0f0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.post-content img,
.post-content iframe,
.post-content video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ================================================= */
/* --- COMMENT & REVIEW (GIỮ NGUYÊN GỐC CỦA BẠN) --- */
/* ================================================= */
.comments-section {
  flex-basis: 100%; 
  background: rgba(20, 25, 40, 0.8);
  border: 1px solid rgba(0, 180, 255, 0.2);
  border-radius: 15px;
  padding: 30px;
  margin-top: 20px; 
}

.comments-section h2 {
  color: #00b4ff;
  border-bottom: 2px solid rgba(0, 180, 255, 0.2);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.rating-summary {
  font-size: 1.5rem;
  color: #33ff99;
  margin-bottom: 15px;
}
.rating-summary .avg-score {
  font-weight: bold;
  font-size: 2.5rem;
}
.rating-summary .rating-count {
  font-size: 1rem;
  color: #ccc;
  margin-left: 10px;
}

.review-form textarea {
  width: 100%;
  background: rgba(30, 35, 60, 0.9);
  border: 1px solid #555;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  resize: vertical;
  min-height: 90px;
  margin-top: 10px;
}
.review-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #00b4ff;
  margin-bottom: 8px;
}
.review-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.stars {
  display: flex;
  justify-content: flex-start;
  font-size: 2rem;
  margin-bottom: 15px;
  gap: 5px;
  direction: rtl;
  text-align: left;
}
.stars input { display: none; }
.stars label {
  font-size: 25px;
  color: #777;
  cursor: pointer;
  transition: 0.3s;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}
.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
  color: #ffcc00;
}

.btn-comment {
  background: linear-gradient(90deg, #00b4ff, #ff0066);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: .3s;
}
.btn-comment:hover { opacity: 0.9; }

.delete-btn {
  background: #ff3366;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}
.delete-btn:hover {
  background: #ff0033;
  box-shadow: 0 0 10px #ff0066;
}

.comment-item {
  background: #1b2235;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  border-left: 3px solid #00b4ff;
}
.comment-item.your-review {
  border: 1px solid #ff0066;
  background-color: rgba(255, 0, 102, 0.1);
  padding: 15px;
  border-radius: 10px;
}
.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #99aacc;
  margin-bottom: 5px;
}
.comment-meta strong { color: #fff; }
.comment-stars { color: #ffcc00; margin-top: 4px; }
.comment-text { font-size: 1rem; color: #ccc; margin: 0; }
.no-comments { color: #ffc107; padding: 10px; text-align: center; }

/* ================================================= */
/* --- ACTIONS (TẢI, MUA, QUAY LẠI) --- */
/* ================================================= */
.actions {
  flex-basis: 100%;
  margin-top: 20px;
  padding: 20px;
  background: rgba(20, 25, 40, 0.85);
  border-radius: 15px;
  border: 1px solid rgba(0, 180, 255, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.download-area {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.btn-download,
.btn-buy,
.btn-back {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(90deg, #00b4ff, #ff0066);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.3s;
  box-shadow: 0 0 10px #00b4ff70, 0 0 20px #ff006670;
  text-align: center;
  white-space: nowrap;
}
.btn-download:hover,
.btn-buy:hover,
.btn-back:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px #00b4ff, 0 0 40px #ff0066;
}

/* ================================================= */
/* --- RESPONSIVE --- */
/* ================================================= */
@media (max-width: 768px) {
  .post-section {
    flex-direction: column;
    padding: 10px;
    gap: 15px;
  }

  .post-left,
  .post-content,
  .comments-section,
  .actions {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .download-area {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .btn-download,
  .btn-buy,
  .btn-back {
    width: 100%;
    font-size: 1rem;
    padding: 12px;
  }

  .post-content {
    padding: 15px;
    font-size: 1rem;
  }

  .review-form textarea {
    font-size: 1rem;
  }

  .comments-section h2 {
    font-size: 1.4rem;
    text-align: center;
  }
}

.post-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start; /* ← dòng fix quan trọng */
  max-width: 1400px;
  margin: 20px auto;
  padding: 20px;
  gap: 30px;
}
