/**
 * Past Reviews Modal Styles
 * See CLAUDE.md for AI usage discipline
 * Centered popup modal for displaying agency reviews
 * Date: 2025-11-01
 */

/* Modal Overlay - Full Screen Dark Background */
.past-reviews-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.past-reviews-modal.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Content Box - Centered */
.past-reviews-box {
  background: #000000;
  border: 3px solid #ffee00;
  border-radius: 15px;
  padding: 2em;
  margin: 5% auto;
  max-width: 900px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 8px 24px rgba(255, 238, 0, 0.4);
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word; /* ENHANCEMENT: Added missing property */
  position: relative;
}

/* Header Container - Agency Name and Close Button */
.past-reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid #ffee00;
  gap: 1em;
}

/* Agency Name in Modal */
.past-reviews-agency-name {
  color: #ffee00;
  font-size: 1.5em;
  font-weight: bold;
  flex: 1;
  text-align: left;
  margin: 0;
}

/* Section Heading (Community Reviews) */
.past-reviews-box h3 {
  color: #ffffff;
  text-align: center;
  margin-bottom: 1.5em;
  margin-top: 1em;
  font-size: 1.3em;
}

/* Hide Reviews Button */
.hide-reviews-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75em 1.5em;
  background: #28a745;
  color: #ffffff;
  border: 2px solid #28a745;
  border-radius: 25px;
  font-size: 1em;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.hide-reviews-btn:hover {
  background: #218838;
  border-color: #218838;
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.8);
  transform: translateY(-2px);
}

.hide-reviews-btn i {
  margin-right: 0.5em;
}

/* Scrollbar Styling */
.past-reviews-box::-webkit-scrollbar {
  width: 8px;
}

.past-reviews-box::-webkit-scrollbar-track {
  background: rgba(255, 238, 0, 0.1);
  border-radius: 4px;
}

.past-reviews-box::-webkit-scrollbar-thumb {
  background: #28a745;
  border-radius: 4px;
}

.past-reviews-box::-webkit-scrollbar-thumb:hover {
  background: #ffee00;
}

/* No Reviews Message */
.no-reviews-message {
  color: #888;
  text-align: center;
  padding: 2em;
  font-size: 1.1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

.no-reviews-message i {
  font-size: 3em;
  color: #888;
  margin-bottom: 0.5em;
}

.no-reviews-message p:last-child {
  font-size: 0.9em;
  color: #aaa;
}

/* Error Message */
.error-message {
  color: #ff0000;
  text-align: center;
  padding: 2em;
  font-size: 1.1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

.error-message i {
  font-size: 2em;
  color: #ff0000;
  margin-bottom: 0.5em;
}

.error-message p:first-of-type {
  color: #ff0000;
}

.error-message p:last-child {
  font-size: 0.9em;
  color: #aaa;
}

/* Loading State */
.loading-reviews {
  text-align: center;
  padding: 3em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
}

.loading-reviews i {
  font-size: 2em;
  color: #ffee00;
}

.loading-reviews p {
  color: #fff;
  margin-top: 1em;
}

/* Individual Review Item - Premium Card Style */
.review-item {
  background: #000;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 1.5em;
  margin-bottom: 1.5em;
  transition: all 0.3s ease;
}

.review-item:hover {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Review User Header - Avatar + Name + Meta */
.review-user-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1em;
  gap: 1em;
}

.review-user-info {
  display: flex;
  align-items: center;
  gap: 0.75em;
}

.review-user-details {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

/* Avatar container - ISSUE-014 fix: match agencies page styling */
.review-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Avatar image styling - matches agencies-inline.css */
.review-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffee00;
  box-shadow:
    0 0 0 3px rgba(255, 238, 0, 0.2),
    0 2px 8px rgba(255, 238, 0, 0.3);
  transition: all 0.3s ease;
}

.review-item:hover .review-avatar-img {
  box-shadow:
    0 0 0 3px rgba(255, 238, 0, 0.4),
    0 4px 12px rgba(255, 238, 0, 0.5);
  transform: scale(1.05);
}

/* Icon fallback styling - circular design matching agencies page */
.review-avatar i {
  width: 44px;
  height: 44px;
  font-size: 44px;
  color: #ffee00;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Initial letter fallback - matching agencies-inline.css */
.review-avatar-initial {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffee00 0%, #ffd700 100%);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  border: 2px solid #ffee00;
  box-shadow:
    0 0 0 3px rgba(255, 238, 0, 0.2),
    0 2px 8px rgba(255, 238, 0, 0.3);
  transition: all 0.3s ease;
}

.review-item:hover .review-avatar-initial {
  box-shadow:
    0 0 0 3px rgba(255, 238, 0, 0.4),
    0 4px 12px rgba(255, 238, 0, 0.5);
  transform: scale(1.05);
}

.review-user-details {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.review-username {
  font-size: 1.1em;
  font-weight: 700;
  color: #fff;
}

/* J1 Participation Badge */
.j1-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.7em;
  padding: 0.25em 0.6em;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.j1-badge.j1-current {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.4);
}

.j1-badge.j1-past {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.75em;
  padding: 0.2em 0.6em;
  border-radius: 50px;
  width: fit-content;
}

.verified-badge {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.review-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5em;
}

.review-date {
  color: #888;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.review-returnee-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.75em;
  padding: 0.3em 0.7em;
  border-radius: 50px;
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
  font-weight: 600;
}

/* Review Rating Banner */
.review-rating-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em 1.25em;
  border-radius: 12px;
  margin-bottom: 1em;
  background: #111;
}

.review-rating-banner.rating-excellent {
  border-left: 4px solid #28a745;
}

.review-rating-banner.rating-good {
  border-left: 4px solid #7cb342;
}

.review-rating-banner.rating-average {
  border-left: 4px solid #ffc107;
}

.review-rating-banner.rating-poor {
  border-left: 4px solid #ff9800;
}

.review-rating-banner.rating-bad {
  border-left: 4px solid #f44336;
}

.review-score-display {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}

.review-overall-rating {
  font-size: 2.5em;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.review-score-label {
  font-size: 0.85em;
  color: #888;
}

.review-stars-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35em;
}

.review-stars {
  font-size: 1.1em;
  color: #ffd700;
}

.review-verdict {
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-verdict.positive {
  color: #28a745;
}

.review-verdict.neutral {
  color: #ffc107;
}

.review-verdict.negative {
  color: #f44336;
}

/* Review Metrics Grid - Progress Bar Style */
.review-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75em;
  margin-bottom: 1em;
  padding: 1em;
  background: #0a0a0a;
  border-radius: 10px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.metric-label {
  color: #888;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-bar-container {
  height: 6px;
  background: #222;
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar {
  height: 100%;
  background: linear-gradient(90deg, #009b3a, #28a745);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.metric-value {
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
}

/* Review Comments */
.review-comments {
  margin-bottom: 0;
}

.review-comment-text {
  color: #ddd;
  line-height: 1.7;
  margin: 0;
  padding: 1em 1.25em;
  background: #0a0a0a;
  border-left: 3px solid #28a745;
  border-radius: 8px;
  font-size: 0.95em;
}

/* Star Rating Colors */
.review-stars i,
.metric-stars i {
  color: #ffee00;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .past-reviews-box {
    margin: 2% auto;
    max-width: 95%;
    padding: 1.5em;
  }

  .past-reviews-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75em;
  }

  .past-reviews-agency-name {
    text-align: center;
    font-size: 1.3em;
  }

  .hide-reviews-btn {
    width: 100%;
  }

  .review-user-header {
    flex-direction: column;
    gap: 0.75em;
  }

  .review-meta-right {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }

  .review-rating-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75em;
  }

  .review-stars-display {
    align-items: flex-start;
  }

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

@media screen and (max-width: 480px) {
  .past-reviews-box {
    max-height: 90vh;
    padding: 1em;
  }

  .review-item {
    padding: 1em;
  }

  .review-overall-rating {
    font-size: 2em;
  }

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

  /* ISSUE-014: Mobile avatar sizing - consistent with agencies page */
  .review-avatar {
    width: 36px;
    height: 36px;
  }

  .review-avatar-img,
  .review-avatar-initial {
    width: 36px;
    height: 36px;
  }

  .review-avatar i {
    width: 36px;
    height: 36px;
    font-size: 36px;
  }

  .review-avatar-initial {
    font-size: 14px;
  }
}

/* ===== TEXT OVERFLOW FIX - Domain Zero Standard ===== */
/* Protect review items from overflow */
.review-item,
.review-username,
.review-comment-text {
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}
