/* ============================================
   REVIEWS SYSTEM - Complete CSS
   Modal popup + Reviews layout + All English
   ============================================ */

/* ============================================
   REVIEW MODAL - Popup style
   ============================================ */

.review-modal {
  display: none; /* HIDDEN by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  overflow-y: auto;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.review-modal.active {
  display: flex !important; /* Show when active */
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.review-modal-content {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.review-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f3f4f6;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-modal-close:hover {
  background: #e5e7eb;
  color: #1f2937;
  transform: rotate(90deg);
}

.review-modal-header {
  margin-bottom: 2rem;
  padding-right: 2rem;
}

.review-modal-header h2 {
  font-size: 1.75rem;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.review-modal-header p {
  color: #6b7280;
  margin: 0;
}

/* ============================================
   FORM STYLES
   ============================================ */

.review-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-section label {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.form-section input[type="text"],
.form-section textarea,
.form-section select {
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
}

.form-section input:focus,
.form-section textarea:focus,
.form-section select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-section textarea {
  min-height: 120px;
  resize: vertical;
}

/* Star Rating Input */
.star-rating-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.5rem;
}

.star-rating-input input[type="radio"] {
  display: none;
}

.star-rating-input label {
  font-size: 2rem;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.2s;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
  color: #fbbf24;
  transform: scale(1.1);
}

.star-rating-input input:checked ~ label {
  color: #fbbf24;
}

/* Category Ratings */
.category-ratings {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 12px;
}

.category-rating-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-rating-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #4b5563;
  font-weight: 500;
}

.category-rating-value {
  font-weight: 700;
  color: #667eea;
  font-size: 1rem;
  min-width: 30px;
  text-align: right;
}

.category-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #e5e7eb 0%, #e5e7eb 100%);
  outline: none;
  cursor: pointer;
}

.category-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
  transition: all 0.2s;
}

.category-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.category-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Alinhar cada linha: Label | Bar | Value */
.category-rating-mini{
  display: grid;
  grid-template-columns: 160px 1fr 44px;
  align-items: center;
  gap: 12px;
}

.category-label{
  white-space: nowrap;
}

.category-bar-mini{
  min-width: 0;
}

.category-value{
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Em ecrãs pequenos, dá mais espaço à barra */
@media (max-width: 700px){
  .category-rating-mini{
    grid-template-columns: 130px 1fr 40px;
  }
}


/* Pros & Cons */
.pros-cons-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-list label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.input-list input {
  padding: 0.65rem 0.85rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.input-list input:focus {
  outline: none;
  border-color: #667eea;
}

/* Submit Button */
.submit-review-btn {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-review-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.submit-review-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-error {
  color: #ef4444;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: block;
}

/* ============================================
   REVIEWS SECTION
   ============================================ */

.reviews-section {
  margin-top: 3rem;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.reviews-header h2 {
  font-size: 2rem;
  color: #1f2937;
  margin: 0;
}

.add-review-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.add-review-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Reviews Grid */
.reviews-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.review-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.review-column-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.review-column-icon {
  font-size: 1.75rem;
}

.review-column-header h3 {
  font-size: 1.5rem;
  margin: 0;
}

/* Average Ratings */
.average-ratings {
  background: #f9fafb;
  border-radius: 12px;
  padding: 1.5rem;
}

.average-ratings h4 {
  margin: 0 0 1rem 0;
  color: #1f2937;
  font-size: 1.1rem;
}

.rating-bar-item {
  margin-bottom: 1rem;
}

.rating-bar-item:last-child {
  margin-bottom: 0;
}

.rating-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #4b5563;
  font-weight: 500;
}

.rating-value {
  font-weight: 700;
  color: #667eea;
  font-size: 1rem;
}

.rating-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 5px;
  transition: width 0.6s ease;
}

/* Reviews List */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reviews-empty {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
  background: #f9fafb;
  border-radius: 12px;
}

/* Review Card */
.review-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.review-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
}

.review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-author-info h5 {
  margin: 0 0 0.25rem 0;
  color: #1f2937;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.expert-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.review-date {
  font-size: 0.85rem;
  color: #9ca3af;
}

.review-overall-rating {
  display: flex;
  align-items: center;
}

.review-stars {
  font-size: 1.25rem;
  color: #fbbf24;
}

.review-content {
  margin-bottom: 1rem;
}

.review-title {
  font-size: 1.1rem;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.review-text {
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

/* Pros & Cons in Review Card */
.review-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
}

.pros h6,
.cons h6 {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.pros h6 {
  color: #10b981;
}

.cons h6 {
  color: #ef4444;
}

.pros ul,
.cons ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pros li {
  color: #059669;
  font-size: 0.9rem;
  padding-left: 1.25rem;
  position: relative;
}

.pros li::before {
  content: '✓';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: #10b981;
}

.cons li {
  color: #dc2626;
  font-size: 0.9rem;
  padding-left: 1.25rem;
  position: relative;
}

.cons li::before {
  content: '✗';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: #ef4444;
}

/* Review Actions */
.review-actions {
  display: flex;
  gap: 0.75rem;
}

.review-action-btn {
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.review-action-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.review-action-btn.liked {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 968px) {
  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .review-modal-content {
    margin: 1rem;
  }
}

@media (max-width: 640px) {
  .pros-cons-inputs {
    grid-template-columns: 1fr;
  }

  .review-pros-cons {
    grid-template-columns: 1fr;
  }

  .review-modal {
    padding: 1rem;
  }

  .review-modal-content {
    padding: 1.5rem;
  }
}
/* === Ratings grid: Users & Experts alinhados === */

.category-ratings-compact{
  background: #f9fafb;
  border-radius: 12px;
  padding: 1.5rem;
}

/* Uma linha: Label | Barra | Valor */
.category-rating-mini{
  display: grid;
  grid-template-columns: 140px 1fr 44px; /* label | bar | value */
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.category-label{
  font-size: 0.9rem;
  color: #4b5563;
  white-space: nowrap;
}

.category-bar-mini{
  position: relative;
  height: 8px;
  border-radius: 9999px;
  background: #e5e7eb;
  overflow: hidden;
  min-width: 0;
}

.category-bar-fill-mini{
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.category-value{
  text-align: right;
  font-size: 0.9rem;
  color: #4b5563;
  font-weight: 700;
}

/* Garantir que as duas colunas têm exatamente o mesmo comportamento */
.review-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Garantir que os blocos internos ocupam largura total */
.review-column > * {
  width: 100%;
}

/* Responsivo: em mobile faz 1 coluna */
@media (max-width: 768px){
  .reviews-grid{
    grid-template-columns: 1fr;
  }
  .category-rating-mini{
    grid-template-columns: 120px 1fr 40px;
  }
}
/* 1) Grid: impedir overflow por min-content */
.reviews-grid{
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

/* 2) Grid items: permitir encolher dentro da coluna */
.review-column{
  min-width: 0;
}

/* 3) Cards/textos: partir palavras/strings longas (evita “empurrar” a coluna) */
.review-card,
.review-title,
.review-text,
.review-author-info h5{
  min-width: 0;
}

.review-text,
.review-title{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* (Opcional) corta qualquer resto de overflow visual */
.reviews-section{
  overflow-x: hidden;
}
/* =============================================
   INFO-I TOOLTIP — categories (reviews)
   ============================================= */

.rating-label-name {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* o "i" pequeno azul com circunferência */
.info-i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #2b7fff;
  color: #2b7fff;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
  cursor: help;
  flex-shrink: 0;
}

.info-i:focus { outline: none; }
.info-i:focus-visible {
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.25);
}

/* tooltip bubble */
.tip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 9999;
  width: max-content;
  max-width: 270px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(10, 15, 28, 0.95);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

