/* ===== DESIGN TOKENS ===== */
:root {
  --text: #e6eef8;
  --muted: #a7b3c5;
  --accent: #4f9ff8;
  --accent-2: #7ee7b5;
  --card-bg: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.12);
  --radius: 12px;
  --bar-bg: rgba(255,255,255,0.08);
  --bar-fill: linear-gradient(90deg, #7dd3fc, #34d399);
  --provider-booking: #003580;
  --provider-airbnb: #ff385c;
}

/* ===== PAGE STRUCTURE ===== */
.page-title {
  text-align: center;
  margin: 5% 0 4%;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  background: linear-gradient(135deg, #fff, var(--text));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  margin: 6% 0 3%;
  color: #fff;
  text-align: center;
}

.section-title.in-container {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.4rem);
}

/* ===== PROVIDER ICONS ===== */
.review-author {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.provider-icon {
  display: inline-block;
  object-fit: contain;
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.provider-icon.booking { 
  max-height: 42px; 
  width: auto; 
}

.provider-icon.airbnb { 
  max-height: 35px; 
  width: auto; 
}

.provider-icon.google { 
  max-height: 42px !important; 
  height: 42px !important;
  width: auto !important; 
}

.provider-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
  font-size: clamp(12px, 2.5vw, 14px);
}

.provider-fallback.booking { 
  width: clamp(32px, 8vw, 42px); 
  height: clamp(32px, 8vw, 42px); 
}

.provider-fallback.airbnb { 
  width: clamp(28px, 7vw, 35px); 
  height: clamp(28px, 7vw, 35px); 
}

.provider-fallback.google { 
  width: clamp(32px, 8vw, 42px); 
  height: clamp(32px, 8vw, 42px); 
}

.provider-booking-bg { background: var(--provider-booking); }
.provider-airbnb-bg { background: var(--provider-airbnb); }
.provider-default-bg { background: #374151; }

/* ===== RATING SUMMARY ===== */
#ratingSummary {
  display: grid !important;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) !important;
  grid-template-rows: auto 1fr !important; /* row1: filter+avg, row2: bars */
  gap: clamp(16px, 3vw, 32px) !important;
  align-items: start !important;
  margin: 15px auto !important;
  order: -1 !important;
  max-width: min(1000px, 95%);
  width: 100% !important;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 16px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  box-sizing: border-box;
}

/* Filter on row 1 (left) */
.property-filter-top {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.property-filter-top label {
  font-size: clamp(12px, 2.5vw, 14px);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-filter-top select {
  width: 100%;
  max-width: 100%;
  padding: clamp(10px, 2vw, 12px) clamp(14px, 3vw, 16px);
  background: linear-gradient(135deg, rgba(30,58,138,0.4), rgba(17,24,39,0.6));
  border: 1px solid rgba(79,159,248,0.3);
  border-radius: 10px;
  color: #fff;
  font-size: clamp(12px, 2.5vw, 14px);
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%237dd3fc' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right clamp(10px, 2vw, 14px) center;
  background-size: clamp(12px, 2.5vw, 14px);
  padding-right: clamp(32px, 7vw, 38px);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.property-filter-top select:hover {
  outline: 0;
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(30,58,138,0.5), rgba(17,24,39,0.7));
  box-shadow: 0 0 0 4px rgba(79,159,248,0.15), 0 6px 20px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.property-filter-top select:focus {
  outline: 0;
  border-color: var(--accent-2);
  background: linear-gradient(135deg, rgba(30,58,138,0.5), rgba(17,24,39,0.7));
  box-shadow: 0 0 0 4px rgba(126,231,181,0.2), 0 6px 20px rgba(0,0,0,0.25);
}

.property-filter-top select:active {
  transform: translateY(0);
  box-shadow: 0 0 0 4px rgba(79,159,248,0.25), 0 2px 8px rgba(0,0,0,0.2);
}

.property-filter-top select option {
  background: #0f1825;
  color: #e6eef8;
  padding: 12px;
  font-weight: 500;
}

.property-filter-top select option:checked {
  background: linear-gradient(135deg, rgba(79,159,248,0.3), rgba(126,231,181,0.2));
  color: var(--accent-2);
  font-weight: 700;
}

/* Bars on row 2 (left) */
#ratingSummary > .rating-list {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  min-width: 0;
  width: 100%;
}

#ratingSummary > .rating-average {
  grid-column: 2 / 3;
  grid-row: 1 / 3; /* rows 1–2 */
  justify-self: stretch !important;
  align-self: stretch !important;
  padding: clamp(16px, 3vw, 24px) !important;
  min-width: 0 !important;
  width: 100% !important;
  position: static !important;
  box-sizing: border-box !important;
  overflow: hidden;
}

.rating-list {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 12px);
  min-width: 0;
  width: 100%;
}

.rating-row {
  display: grid;
  grid-template-columns: clamp(60px, 15%, 80px) 1fr clamp(32px, 8%, 40px);
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  width: 100%;
}

.rating-stars {
  color: #fbbf24;
  white-space: nowrap;
  font-size: clamp(14px, 3vw, 16px);
}

.rating-bar {
  height: clamp(6px, 1.5vw, 8px);
  background: var(--bar-bg);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}

.rating-bar .fill {
  display: block;
  height: 100%;
  background: var(--bar-fill);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.rating-count {
  text-align: right;
  color: rgba(255,255,255,0.75);
  font-size: clamp(12px, 2.5vw, 14px);
}

.rating-average {
  background: linear-gradient(135deg, rgba(30,58,138,0.3), rgba(17,24,39,0.5));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: clamp(16px, 3vw, 24px);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.avg-label {
  font-size: clamp(12px, 2.5vw, 14px);
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.avg-value {
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 800;
  color: #7dd3fc;
  line-height: 1;
  margin-bottom: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avg-value .out-of {
  font-size: clamp(18px, 4vw, 24px);
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

.avg-sub {
  font-size: clamp(11px, 2.5vw, 13px);
  color: rgba(255,255,255,0.55);
  margin-bottom: 0;
}

/* ===== REVIEWS LIST ===== */
.reviews-list-container {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  max-width: min(1000px, 95%);
  margin: 15px auto 0;
  width: 100%;
  box-sizing: border-box;
}

.reviews-header {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.5vw, 16px);
  margin-bottom: clamp(12px, 2.5vw, 16px);
  padding-bottom: clamp(12px, 2.5vw, 16px);
  border-bottom: 1px solid var(--glass-border);
}

.reviews-header .section-title.in-container {
  text-align: left;
}

.review-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(12px, 2.5vw, 16px);
  flex-wrap: wrap;
  width: 100%;
}

.review-counters {
  display: flex;
  gap: clamp(10px, 2vw, 16px);
  flex-wrap: wrap;
}

.sort-controls {
  display: flex;
  gap: clamp(8px, 2vw, 12px);
  align-items: center;
  flex-wrap: wrap;
}

.sort-select {
  padding: clamp(8px, 2vw, 10px) clamp(28px, 6vw, 36px) clamp(8px, 2vw, 10px) clamp(12px, 2.5vw, 14px);
  background: linear-gradient(135deg, rgba(30,58,138,0.4), rgba(17,24,39,0.6));
  border: 1px solid rgba(79,159,248,0.3);
  border-radius: 10px;
  color: #fff;
  font-size: clamp(11px, 2.5vw, 13px);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237dd3fc' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right clamp(8px, 2vw, 12px) center;
  background-size: clamp(10px, 2vw, 12px);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  min-width: clamp(140px, 30vw, 160px);
}

.sort-select:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(30,58,138,0.5), rgba(17,24,39,0.7));
  box-shadow: 0 0 0 3px rgba(79,159,248,0.15), 0 4px 12px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.sort-select:focus {
  outline: 0;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(126,231,181,0.2), 0 4px 12px rgba(0,0,0,0.25);
}

.reviews-list {
  display: grid;
  gap: clamp(16px, 3vw, 20px);
  width: 100%;
}

.reviews-list .review-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  transition: border-color 0.2s, transform 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.reviews-list .review-card:hover {
  transform: translateX(2px);
  border-color: var(--accent);
}

.review-card.compact {
  padding: clamp(14px, 3vw, 20px);
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 12px);
  flex-wrap: wrap;
  width: 100%;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 10px);
  flex-wrap: wrap;
}

.review-date-inline {
  color: var(--muted);
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  white-space: nowrap;
}

.review-rating {
  background: var(--accent);
  color: #062037;
  padding: clamp(5px, 1vw, 6px) clamp(12px, 2.5vw, 14px);
  border-radius: 8px;
  font-weight: 700;
  font-size: clamp(0.85rem, 2vw, 1rem);
  white-space: nowrap;
}

.review-content {
  color: var(--text);
  line-height: 1.65;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  margin-top: clamp(10px, 2vw, 12px);
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.read-more-btn {
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: clamp(5px, 1vw, 6px) clamp(8px, 2vw, 10px);
  margin-top: clamp(6px, 1.5vw, 8px);
  cursor: pointer;
  transition: background 0.2s;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.read-more-btn:hover {
  background: rgba(255,255,255,0.06);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(6px, 2vw, 10px);
  margin-top: clamp(24px, 4vw, 32px);
  padding-top: clamp(16px, 3vw, 24px);
  border-top: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: clamp(34px, 7vw, 38px);
  min-width: clamp(38px, 8vw, 42px);
  padding: 0 clamp(12px, 2.5vw, 14px);
  background: rgba(79,159,248,0.12);
  border: 1px solid rgba(79,159,248,0.35);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-size: clamp(0.85rem, 2vw, 1rem);
}

.page-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #062037;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79,159,248,0.4);
}

.page-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #062037;
  font-weight: 800;
  border-color: var(--accent-2);
  box-shadow: 0 4px 12px rgba(79,159,248,0.35);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-dots {
  color: var(--muted);
  padding: 0 clamp(6px, 1.5vw, 8px);
  font-weight: 700;
  font-size: clamp(0.85rem, 2vw, 1rem);
}

/* ===== STATES ===== */
.reviews-state {
  text-align: center;
  padding: clamp(30px, 5vw, 40px);
  color: var(--muted);
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.reviews-state.error {
  color: #ff7e7e;
}

.reviews-empty-note {
  text-align: center;
  padding: clamp(30px, 5vw, 40px);
  color: var(--muted);
  font-size: clamp(0.9rem, 2vw, 1rem);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  #ratingSummary {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important; /* filter + bars + avg */
  }
  .property-filter-top { grid-column: 1 / 2; grid-row: 1 / 2; }
  #ratingSummary > .rating-list { grid-column: 1 / 2; grid-row: 2 / 3; }
  #ratingSummary > .rating-average { grid-column: 1 / 2; grid-row: 3 / 4; }
}

@media (max-width: 768px) {
  .review-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .review-counters {
    justify-content: center;
    width: 100%;
  }
  
  .sort-controls {
    flex-direction: column;
    width: 100%;
  }
  
  .sort-select {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .review-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .review-meta {
    width: 100%;
    justify-content: space-between;
  }
}
