/* =========================================
  1. BASE STYLES
========================================= */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f9f9f9;
}


/* =========================================
  2. LAYOUT CONTAINERS
========================================= */
.review-main,
.review-display-section {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.review-display-section {
  max-width: 1100px;
}

.title,
.review-display-title {
  text-align: center;
  color: #c40000;
  font-size: 32px;
  margin-bottom: 40px;
}

.review-display-title {
  font-size: 28px;
  margin-bottom: 30px;
}

.review-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
}


/* =========================================
  3. REVIEW FORM
========================================= */
.review-form {
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  flex: 1 1 400px;
  max-width: 600px;
  padding: 30px;
  order: 1;
}

.review-form label {
  color: #333;
  display: block;
  font-weight: bold;
  margin-top: 15px;
}

.review-form input,
.review-form select,
.review-form textarea {
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  margin-top: 5px;
  padding: 12px;
  width: 100%;
}

.review-form button {
  background: #c40000;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 16px;
  margin-top: 20px;
  padding: 12px 20px;
}

.review-form button:hover {
  background: #a00000;
}


/* =========================================
  4. STAR INPUT (FORM)
========================================= */
.star-input {
  direction: rtl;
  display: inline-flex;
  font-size: 22px;
  gap: 5px;
}

.star-input input {
  display: none;
}

.star-input label {
  color: #ccc;
  cursor: pointer;
  font-size: 24px;
  margin: 0 3px;
  transition: color 0.3s ease;
}

.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
  color: #f1c40f;
}


/* =========================================
  5. RATING SUMMARY BOX
========================================= */
.rating-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  flex: 1 1 400px;
  max-width: 480px;
  padding: 30px;
  text-align: center;
  order: 2;
}

.average-score {
  color: #c40000;
  font-size: 48px;
  font-weight: bold;
}

.star-icons i {
  color: #f1c40f;
  font-size: 20px;
}

.review-count {
  color: #555;
  font-size: 14px;
  margin: 10px 0 20px;
}

.bar-chart {
  margin-top: 10px;
}

.bar-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bar-track {
  background: #ddd;
  border-radius: 4px;
  flex: 1;
  height: 8px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  background: #27ae60;
  border-radius: 4px;
  height: 100%;
}


/* =========================================
  6. REVIEW DISPLAY SECTION
========================================= */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-card {
  align-items: flex-start;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 20px;
  padding: 20px;
}

.review-card img {
  border-radius: 50%;
  flex-shrink: 0;
  height: 60px;
  object-fit: cover;
  width: 60px;
}

.review-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.review-content .top-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

.review-content .stars {
  color: #ffc107;
  display: flex;
  font-size: 16px;
  gap: 2px;
}

.review-content .caption {
  color: #c40000;
  font-size: 15px;
  font-weight: bold;
  margin: 2px 0;
}

.review-content .message {
  color: #333;
  font-size: 14px;
  font-style: italic;
  margin-top: 2px;
}


/* =========================================
  7. FILTER & SORT CONTROLS
========================================= */
.review-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
  margin-bottom: 30px;
}

.control-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 150px;
  max-width: 200px;
  min-width: 140px;
}

.control-group label {
  color: #333;
  font-weight: bold;
  margin-bottom: 5px;
}

.control-group select {
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 15px;
  padding: 10px;
  width: 100%;
}


/* =========================================
  8. BUTTONS
========================================= */
.view-all-wrapper {
  margin-top: 30px;
  text-align: center;
}

.view-all-btn {
  background-color: #c40000;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  padding: 10px 20px;
}

.view-all-btn:hover {
  background-color: #a00000;
}


/* =========================================
  9. RESPONSIVE STYLES
========================================= */

/* Reverse Form and Rating Box Order on Mobile */
@media (max-width: 768px) {
  .review-flex {
    flex-direction: column-reverse;
  }

  .review-form,
  .rating-box {
    max-width: 100%;
    width: 100%;
  }

  .review-form {
    order: 2;
  }

  .rating-box {
    order: 1;
  }
}

/* Review Card Adjustments for Small Devices */
@media (max-width: 600px) {
  .review-card {
    align-items: flex-start;
    flex-direction: row;
  }

  .review-card img {
    height: 50px;
    margin-top: 4px;
    width: 50px;
  }

  .review-content .caption {
    font-size: 14px;
  }

  .review-content .stars i {
    font-size: 14px;
  }

  .review-content .message {
    font-size: 13px;
  }
}
