/* Bundle: bundle-read-review.css - Consolidated from: read-review.css */

/* === Source: read-review.css === */
/* Read Review - Superior Styles */

/* Review Analysis Section */
.review-analysis-section {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  margin-bottom: var(--space-4);
  border: 2px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Analysis section reuses .section-header and .section-toggle classes */

.analysis-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease;
}

.analysis-content.expanded {
  max-height: 500px;
  padding: var(--space-6);
  background: var(--bg-primary);
}

.analysis-loading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.analysis-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-primary);
  border-top: 2px solid var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analysis-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.analysis-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.analysis-point {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.analysis-bullet {
  color: var(--brand-accent);
  font-size: var(--font-size-sm);
  margin-top: 2px;
  flex-shrink: 0;
}

.analysis-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-primary);
}

.confidence-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.confidence-high {
  background: var(--success);
  color: var(--white);
}

.confidence-medium {
  background: var(--warning);
  color: var(--gray-900);
}

.analysis-refresh {
  background: none;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--transition-fast);
}

.analysis-refresh:hover {
  background: var(--hover-bg);
  border-color: var(--brand-primary);
}

/* Light Mode Support for Analysis */
.light-mode .review-analysis-section {
  background: var(--white);
  border-color: var(--gray-200);
}

/* Analysis Mobile Responsive — now uses .section-header and .section-toggle */

/* ============================================
   Property Header
   ============================================ */
.property-header {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: var(--white);
  padding: var(--space-5);
  border-radius: var(--radius-2xl);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-lg);
}

.dark-mode .property-header {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.property-address {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-4);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dark-mode .property-address {
  color: #ffffff;
}

.property-stats {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  align-items: center;
  position: relative;
  z-index: 10;

/* FIX 1.27: Override notify button styles inside property header for visibility */
}

.property-header .notify-btn {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

.property-header .notify-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: #ffffff;
}

.property-header .notify-unsubscribe {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.5);
}

.property-header .notify-unsubscribe:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: rgba(239, 68, 68, 0.8);
  color: #ffffff;
}
}

.stat-badge {
  background: rgba(255,255,255,0.25);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--white);
}

.dark-mode .stat-badge {
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.location-btn, .add-review-btn {
  background: var(--white);
  color: var(--brand-primary);
  border: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-medium);
  min-height: 44px;
}

.dark-mode .location-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #1e40af;
  transition: all var(--transition-fast);
  position: relative;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark-mode .location-btn span {
  color: #1e40af;
}

.dark-mode .location-btn i {
  color: #1e40af;
}

.add-review-btn {
  background: var(--brand-accent);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 190, 6, 0.3);
}

.dark-mode .add-review-btn {
  background: #10b981;
  color: var(--white);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.location-btn:hover, .add-review-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.location-btn:hover {
  background: var(--gray-100);
}

.dark-mode .location-btn:hover {
  background: var(--white);
  color: #1e3a8a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.add-review-btn:hover {
  background: var(--success-dark);
  box-shadow: 0 4px 12px rgba(0, 190, 6, 0.4);
}

.dark-mode .add-review-btn:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.6);
  transform: translateY(-2px);
}

/* ============================================
   Property Comments Section
   ============================================ */
.property-comments-section {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.dark-mode .property-comments-section {
  background: var(--bg-secondary);
}

.property-comments-heading {
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
}

.dark-mode .property-comments-heading {
  color: var(--brand-primary);
}

/* ============================================
   Property Type Section
   ============================================ */
#property-type {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  padding: 0;
  margin-bottom: var(--space-4);
  border: 2px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

#property-type h3 {
  color: var(--brand-primary);
  margin-bottom: 0;
  font-size: var(--font-size-lg);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-tertiary);
}

#property-type-comments {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-4);
  background: var(--bg-primary);
}

/* ============================================
   Collapsible Section Wrappers
   ============================================ */
.review-section-wrapper {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  margin-bottom: var(--space-4);
  border: 2px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* When collapsed, hide the content completely */
.review-section-wrapper.collapsed .section-content {
  display: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-6);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
  min-height: 56px;
  /* Override inherited rules from bundle-core.css and bundle-write-review.css */
  text-align: left;
  margin-bottom: 0;
  padding-bottom: var(--space-4);
  border-bottom: none;
}

.section-header:hover {
  background: var(--hover-bg);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
  line-height: var(--line-height-tight);
}

.section-badge {
  background: var(--brand-accent);
  color: var(--white);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-base);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-left: var(--space-2);
}

.section-toggle {
  font-size: var(--font-size-xl);
  color: var(--brand-primary);
  transition: transform var(--transition-normal);
  line-height: 1;
  flex-shrink: 0;
}

.section-toggle.expanded {
  transform: rotate(180deg);
}

.section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease;
  padding: 0;
}

.section-content.expanded {
  max-height: 10000px;
  padding: var(--space-4);
  background: var(--bg-primary);
}

/* ============================================
   Amenity Toggles Grid — Read-only toggles
   ============================================ */
#amenities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Individual amenity toggle item */
.amenity-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  min-height: 44px;
}

.amenity-toggle-item .amenity-toggle-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

/* Compact toggle inside amenity grid */
.amenity-toggle-item .toggle-label {
  width: 48px;
  height: 24px;
}

.amenity-toggle-item .toggle-label::before {
  width: 20px;
  height: 20px;
}

.amenity-toggle-item .toggle-input:checked + .toggle-label::before {
  transform: translateX(24px);
}

.amenity-toggle-item .switch-text-yes,
.amenity-toggle-item .switch-text-no {
  font-size: 9px;
}

/* Wide variant for owner section */
.amenity-toggle-wide {
  grid-column: 1 / -1;
}

/* ============================================
   Amenity Star Ratings (separate container)
   ============================================ */
#amenity-star-ratings {
  margin-top: var(--space-2);
}

#basic-star-ratings,
#owner-star-rating,
#other-star-ratings,
#amenity-star-ratings {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* ============================================
   Rating Grid
   ============================================ */
.ratings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.rating-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.rating-item:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.rating-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   Comments Container & Sort/Filter
   ============================================ */
.comments-container {
  margin-top: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
}

.comments-table {
  max-height: 600px;
  overflow-y: auto;
}

.scrollable-comments::-webkit-scrollbar {
  width: 8px;
}

.scrollable-comments::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--radius-base);
}

.scrollable-comments::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-base);
}

.scrollable-comments::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

.sort-filter {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
}

.filter-section,
.sort-section {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.filter-section label,
.sort-section label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.filter-select,
.sort-select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 120px;
  min-height: 44px;
}

.filter-select:hover,
.sort-select:hover {
  background: var(--hover-bg);
  border-color: var(--brand-primary);
}

.filter-select:focus,
.sort-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ============================================
   Comment Cards
   ============================================ */
.comment-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px var(--shadow-color, rgba(0, 0, 0, 0.05));
}

.comment-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.comment-rating-badge {
  color: var(--white);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  min-width: 44px;
  text-align: center;
}

.comment-rating-badge.two {
  background: var(--error);
  color: var(--white);
}

.comment-rating-badge.four {
  background: var(--warning);
  color: var(--gray-900);
  font-weight: 700;
}

.comment-rating-badge.six {
  background: #cddc39;
  color: var(--gray-900);
  font-weight: 700;
}

.comment-rating-badge.ten {
  background: var(--success);
  color: var(--white);
}

.comment-text {
  color: var(--text-secondary);
  line-height: var(--line-height-normal);
  font-size: var(--font-size-sm);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.dark-mode .empty-state {
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.empty-state-heading {
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-2xl);
}

.dark-mode .empty-state-heading {
  color: var(--brand-primary);
}

.empty-state-text {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-6);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-tertiary);
}

.dark-mode .empty-state-text {
  color: var(--text-tertiary);
}

.empty-state-btn {
  padding: 12px 24px;
  font-size: 16px;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

.empty-state p {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-3);
}

/* ============================================
   Loading Skeleton
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-header {
  height: 150px;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-2xl);
}

.skeleton-section {
  height: 60px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-2xl);
}

/* ============================================
   Disclaimer Section
   ============================================ */
.disclaimer-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
  margin: var(--space-6) 0;
  border: 1px solid var(--border-primary);
  width: 100%;
  color: var(--text-secondary);
}

.disclaimer-section h2 {
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
  text-align: center;
}

.disclaimer-section ul {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.disclaimer-section li {
  margin-bottom: var(--space-3);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.disclaimer-section a {
  color: var(--brand-primary);
  text-decoration: underline;
}

.disclaimer-section a:hover {
  color: var(--brand-primary-dark);
}

/* Override the global p, li { max-width: 70ch } from bundle-responsive.css */
.disclaimer-section p,
.disclaimer-section li {
  max-width: 100%;
}

/* ============================================
   Map Popup
   ============================================ */
.map-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-popup {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 800px;
  height: 80vh;
  position: relative;
  overflow: hidden;
}

.close-btn {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: var(--font-size-xl);
  cursor: pointer;
  z-index: 1;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.close-btn:hover {
  background: var(--error);
  color: var(--white);
}

#mapContainer {
  width: 100%;
  height: 100%;
}

.info-container {
  padding: 8px;
  min-width: 200px;
  max-width: 300px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.info-address {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #202124;
  line-height: 1.4;
  font-weight: 500;
}

#directionsButton {
  background: #1a73e8;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#directionsButton:hover {
  background: #1765cc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

#directionsButton:active {
  background: #1557b0;
}

#directionsButton img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

#directionsButton span {
  font-weight: 500;
}

/* ============================================
   Star Ratings
   ============================================ */
.star-rating {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-primary);
}

.star-rating:last-child {
  border-bottom: none;
}

.star-rating label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  min-width: 180px;
  flex-shrink: 0;
}

.rating-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  justify-content: flex-end;
}

.star-rating .rating-container {
  justify-content: flex-end;
}

/* Inner star-rating within rating-container (generated by createStars) */
.rating-container .star-rating {
  border-bottom: none;
  padding: 0;
  margin-bottom: 0;
  gap: 1px;
  min-width: 0;
  flex-shrink: 1;
}

.star-rating-output {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
  min-width: 40px;
  text-align: right;
  margin-left: var(--space-2);
  flex-shrink: 0;
}

.star {
  color: var(--border-secondary);
  font-size: 22px;
  margin-right: 2px;
}

/* Star rating colors - saturated for visibility */
.star.one { color: #d50000; }
.star.two { color: #e53935; }
.star.three { color: #f4511e; }
.star.four { color: #fb8c00; }
.star.five { color: #fdd835; }
.star.six { color: #c0ca33; }
.star.seven { color: #7cb342; }
.star.eight { color: #43a047; }
.star.nine { color: #2e7d32; }
.star.ten { color: #1b5e20; }
.star.nine { color: #388e3c; }
.star.ten { color: #1b5e20; }

/* ============================================
   Category Rating Blocks
   ============================================ */
.category-rating-block {
  margin-bottom: var(--space-3);
}

.category-summary-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-semibold);
  flex-wrap: nowrap;
  overflow: hidden;
}

.category-summary-header i {
  color: var(--brand-primary);
  font-size: var(--font-size-base);
  flex-shrink: 0;
}

.category-summary-label {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
  min-width: 0;
}

/* Stars inside category summary headers */
.category-summary-header .rating-container .star-rating .star {
  font-size: 18px;
}

.category-summary-rating {
  margin-bottom: var(--space-3);
}

.category-individual-ratings {
  padding-left: var(--space-3);
  border-left: 2px solid var(--border-primary);
  margin-left: var(--space-3);
}

.category-individual-ratings .star-rating {
  padding: var(--space-1) 0;
  gap: var(--space-2);
}

/* ============================================
   Switch Container
   ============================================ */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  min-height: 44px;
}

.switch-container label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  flex: 1;
  line-height: 1.3;
}

.switch-container .slider-switch {
  flex-shrink: 0;
}

/* ============================================
   Theme Support - Light Mode
   ============================================ */
.light-mode #property-type,
.light-mode .review-section-wrapper {
  border-color: var(--gray-200);
}

.light-mode .section-header {
  background: var(--gray-100);
}

.light-mode .section-header:hover {
  background: var(--gray-200);
}

.light-mode .section-content.expanded {
  background: var(--white);
}

.light-mode .comments-container {
  background: var(--gray-50);
}

.light-mode .sort-filter {
  background: var(--white);
  border-color: var(--gray-200);
}

.light-mode .filter-section label,
.light-mode .sort-section label {
  color: var(--gray-700);
}

.light-mode .filter-select,
.light-mode .sort-select {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.light-mode .comment-card {
  background: var(--white);
  border-color: var(--gray-200);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.light-mode .comment-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.light-mode .comment-text {
  color: var(--gray-700);
}

.light-mode .star-rating label {
  color: var(--gray-700);
}

.light-mode .star-rating-output {
  color: var(--gray-700);
}

.light-mode .switch-container label {
  color: var(--gray-700);
}

.light-mode #property-type h3 {
  background: var(--gray-100);
}

.light-mode #property-type-comments {
  background: var(--white);
}

.light-mode .disclaimer-section {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}

.light-mode .disclaimer-section h2 {
  color: var(--brand-primary);
}

.light-mode .disclaimer-section a {
  color: var(--brand-primary);
}

.light-mode .disclaimer-section a:hover {
  color: var(--brand-primary-dark);
}

/* ============================================
   Theme Support - Dark Mode
   ============================================ */
.dark-mode .disclaimer-section {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* ============================================
   Tablet Responsive (768px)
   ============================================ */
@media (max-width: 768px) {
  .property-header {
    padding: var(--space-4);
  }
  
  .property-address {
    font-size: var(--font-size-base);
    word-break: break-word;
  }
  
  .property-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  
  .location-btn, .add-review-btn {
    width: 100%;
    justify-content: center;
  }
  
  .ratings-grid {
    grid-template-columns: 1fr;
  }
  
  .section-header {
    padding: var(--space-3) var(--space-4);
    min-height: 52px;
    margin-bottom: 0;
    padding-bottom: var(--space-3);
  }
  
  .section-title {
    font-size: var(--font-size-base);
  }
  
  .section-content.expanded {
    padding: var(--space-4);
  }
  
  #property-type h3 {
    font-size: var(--font-size-base);
    padding: var(--space-3) var(--space-4);
  }
  
  .star-rating {
    flex-wrap: nowrap;
    gap: var(--space-2);
  }
  
  .star-rating label {
    min-width: 130px;
    font-size: var(--font-size-xs);
  }
  
  .star {
    font-size: 20px;
    margin-right: 1px;
  }
  
  .star-rating-output {
    font-size: var(--font-size-xs);
    min-width: 36px;
  }
  
  .switch-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .switch-container label {
    font-size: var(--font-size-xs);
  }
  
  .slider-switch {
    flex-shrink: 0;
  }
  
  #amenities {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .sort-filter {
    flex-direction: row;
    gap: var(--space-2);
    padding: var(--space-2);
  }
  
  .filter-section,
  .sort-section {
    flex: 1;
    min-width: 0;
  }
  
  .filter-section label,
  .sort-section label {
    font-size: 11px;
    display: none;
  }
  
  /* FIX: Sort/filter touch targets - 44px minimum for WCAG */
  .filter-select,
  .sort-select {
    width: 100%;
    min-width: 0;
    font-size: var(--font-size-xs);
    padding: var(--space-2) var(--space-2);
    min-height: 44px;
  }
  
  .comment-card {
    padding: var(--space-3);
    margin-bottom: var(--space-2);
  }
  
  .comment-text {
    font-size: var(--font-size-xs);
  }
  
  .disclaimer-section {
    padding: var(--space-4);
  }
  
  .disclaimer-section li {
    font-size: var(--font-size-xs);
  }
  
  .map-popup {
    width: 95%;
    height: 90vh;
  }
  
  .info-container {
    min-width: 180px;
    max-width: 250px;
  }
  
  .info-address {
    font-size: 12px;
  }
  
  #directionsButton {
    padding: 7px 10px;
    font-size: 12px;
  }
  
  #directionsButton img {
    width: 14px;
    height: 14px;
  }
  
  .category-summary-header {
    padding: var(--space-2);
    gap: var(--space-2);
  }
}

/* ============================================
   Mobile Responsive (480px)
   FIX: Hide individual stars on mobile, show only label + numeric score
   FIX: Sort/filter touch targets 44px
   ============================================ */
@media (max-width: 480px) {
  .property-header {
    padding: var(--space-3);
  }
  
  .property-address {
    font-size: var(--font-size-sm);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
  
  .property-address i {
    font-size: var(--font-size-base);
  }
  
  .stat-badge {
    font-size: 10px;
    padding: 4px 6px;
  }
  
  .section-header {
    padding: var(--space-3);
    min-height: 48px;
    margin-bottom: 0;
    padding-bottom: var(--space-3);
  }
  
  .section-title {
    font-size: var(--font-size-sm);
    gap: var(--space-2);
  }
  
  .section-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  #property-type h3 {
    font-size: var(--font-size-sm);
    padding: var(--space-2) var(--space-3);
  }
  
  /* FIX: Sort/filter touch targets - 44px minimum for WCAG */
  .sort-filter {
    flex-direction: row;
    gap: var(--space-1);
    padding: var(--space-2);
  }
  
  .filter-section,
  .sort-section {
    width: auto;
    flex: 1;
    min-width: 0;
  }
  
  .filter-select,
  .sort-select {
    font-size: 11px;
    padding: var(--space-2);
    min-height: 44px;
  }
  
  /* Star ratings on mobile — 2-line layout:
     Line 1: Label (left) + Score (right)
     Line 2: Stars (full width)
     
     Only apply to outer .star-rating that has a direct <label> child
     (not the inner .star-rating that contains star spans)
  */
  .star-rating:has(> label) {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 var(--space-2);
    overflow: visible;
    align-items: center;
  }
  
  .star-rating:has(> label) > label {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    font-size: 12px;
    word-break: break-word;
  }
  
  /* Pull the score out of rating-container flow and place it on row 1 */
  .star-rating:has(> label) > .rating-container {
    display: contents;
  }
  
  .star-rating:has(> label) > .rating-container > .star-rating-output {
    grid-column: 2;
    grid-row: 1;
    font-size: 13px;
    font-weight: 700;
    min-width: 44px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2px 6px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    margin-left: 0;
  }
  
  /* Stars on row 2, spanning full width */
  .star-rating:has(> label) > .rating-container > .star-rating {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex !important;
    flex-wrap: nowrap;
    gap: 0;
    border-bottom: none;
    padding: var(--space-1) 0 0 0;
    margin: 0;
  }
  
  .star-rating:has(> label) > .rating-container > .star-rating .star {
    font-size: clamp(16px, 5vw, 24px);
    margin-right: 2px;
  }
  
  /* Category summary headers — 2-line layout on mobile */
  .category-summary-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 var(--space-2);
    padding: var(--space-2);
    align-items: center;
  }
  
  .category-summary-header > i {
    grid-column: 1;
    grid-row: 1;
  }
  
  .category-summary-label {
    grid-column: 2;
    grid-row: 1;
    font-size: 12px;
  }
  
  .category-summary-header > .rating-container {
    display: contents;
  }
  
  .category-summary-header > .rating-container > .star-rating-output {
    grid-column: 3;
    grid-row: 1;
  }
  
  .category-summary-header > .rating-container > .star-rating {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex !important;
    flex-wrap: nowrap;
    gap: 0;
    border-bottom: none;
    padding: var(--space-1) 0 0 0;
    margin: 0;
  }
  
  .category-summary-header .star {
    font-size: clamp(14px, 4vw, 20px);
  }
  
  .category-summary-label {
    font-size: 12px;
  }
  
  .category-individual-ratings {
    padding-left: var(--space-2);
    margin-left: var(--space-2);
  }
  
  .switch-container {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
  }
  
  .switch-container label {
    font-size: 12px;
    flex: 1;
    word-break: break-word;
  }
  
  .comment-card {
    padding: var(--space-3);
    margin-bottom: var(--space-2);
  }
  
  .comment-rating-badge {
    font-size: 11px;
    padding: 2px 8px;
  }
  
  .comment-text {
    font-size: 12px;
    line-height: 1.6;
  }
  
  .switch-container {
    min-height: 44px;
  }
  
  #amenities {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .disclaimer-section {
    padding: var(--space-3);
  }
  
  .disclaimer-section h2 {
    font-size: var(--font-size-base);
  }
  
  .disclaimer-section li {
    font-size: 12px;
    line-height: 1.6;
  }
  
  .disclaimer-section p {
    font-size: 12px;
    line-height: 1.6;
  }
}

/* ============================================
   Small Mobile (360px)
   ============================================ */
@media (max-width: 360px) {
  .property-header {
    padding: var(--space-2);
  }
  
  .property-address {
    font-size: 13px;
  }
  
  .stat-badge {
    font-size: 11px;
    padding: 3px 5px;
  }
  
  .star-rating label {
    font-size: 12px;
  }
  
  /* At 360px, hide stars completely — only show numeric score */
  .rating-container .star-rating {
    display: none;
  }
  
  .category-summary-header .rating-container .star-rating {
    display: none;
  }
  
  .star-rating-output {
    font-size: 12px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .category-summary-label {
    font-size: 12px;
  }
  
  .section-title {
    font-size: 13px;
  }
  
  /* Ensure sort/filter dropdowns fit side-by-side at 360px */
  .sort-filter {
    gap: 2px;
    padding: var(--space-1);
  }
  
  .filter-select,
  .sort-select {
    font-size: 11px;
    padding: var(--space-2);
    min-height: 44px;
  }
  
  .comment-text {
    font-size: 12px;
  }
  
  .switch-container label {
    font-size: 12px;
  }
  
  .category-individual-ratings {
    padding-left: var(--space-1);
    margin-left: var(--space-1);
  }
  
  .switch-container {
    min-height: 44px;
  }
  
  #amenities {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* ============================================
   Toggle Label Responsive
   ============================================ */
@media (max-width: 768px) {
  .toggle-label {
    width: 50px !important;
    height: 26px !important;
    display: block !important;
  }
}

/* ============================================
   Accessibility & Contrast
   ============================================ */

/* WCAG Contrast Compliance */
.light-mode {
  --text-on-light: var(--gray-900);
  --text-on-primary: var(--white);
  --text-on-success: var(--white);
  --text-on-warning: var(--gray-900);
  --text-on-error: var(--white);
}

.dark-mode {
  --text-on-dark: var(--gray-100);
  --text-on-primary: var(--white);
  --text-on-success: var(--white);
  --text-on-warning: var(--gray-900);
  --text-on-error: var(--white);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .property-header {
    border: 3px solid var(--white);
  }
  
  .comment-card {
    border-width: 2px;
  }
  
  .section-header {
    border-bottom: 2px solid var(--brand-primary);
  }
  
  .star {
    filter: saturate(1.5) contrast(1.2);
  }
  
  .comment-rating-badge {
    border: 2px solid currentColor;
  }
  
  .stat-badge {
    background: rgba(255, 255, 255, 0.95);
    color: var(--brand-primary);
  }
}

/* Focus Indicators */
*:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
}

.dark-mode *:focus-visible {
  outline-color: var(--brand-primary-light);
}

/* Dark mode text contrast */
.dark-mode .comment-card {
  color: var(--gray-100);
}

.dark-mode .comment-text {
  color: var(--gray-200);
}

.dark-mode .star-rating label,
.dark-mode .star-rating-output,
.dark-mode .switch-container label {
  color: var(--gray-100);
}

/* Light mode text contrast */
.light-mode .comment-card {
  color: var(--gray-900);
}

.light-mode .star-rating label,
.light-mode .star-rating-output,
.light-mode .switch-container label {
  color: var(--gray-900);
}

/* Disabled toggle states */
.toggle-input:disabled + .toggle-label {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* Section badge contrast */
.light-mode .section-badge {
  background: var(--success);
  color: var(--white);
}

/* Comment card hover */
.dark-mode .comment-card:hover {
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

/* Sort/filter contrast */
.light-mode .filter-select,
.light-mode .sort-select {
  background: var(--white);
  color: var(--gray-900);
  border-color: var(--gray-300);
}

.light-mode .filter-select:hover,
.light-mode .sort-select:hover {
  border-color: var(--brand-primary);
  background: var(--gray-50);
}

/* Submit button */
#submit-btn {
  background: var(--brand-accent);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 190, 6, 0.3);
}

#submit-btn:hover {
  background: var(--success-dark);
  box-shadow: 0 4px 12px rgba(0, 190, 6, 0.4);
}

.light-mode #submit-btn {
  background: var(--success);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.light-mode #submit-btn:hover {
  background: var(--success-dark);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .section-content {
    transition: none;
  }
  
  .section-toggle {
    transition: none;
  }
  
  .comment-card {
    transition: none;
  }
}

/* Print Styles */
@media print {
  .sort-filter,
  .share-buttons-container,
  .location-btn,
  .add-review-btn,
  .map-popup-overlay {
    display: none !important;
  }
  
  .review-section-wrapper {
    break-inside: avoid;
  }
  
  .section-content {
    max-height: none !important;
    overflow: visible !important;
  }
}
