/* Main Repair Report Container */
.routine-count {
  color: #1c2a44 !important;
  font-weight: bold !important;
}

#maintenance-count {
  color: #1c2a44 !important;
  font-weight: bold !important;
}

/* New heading for Local Insights section */
.local-insights-heading {
  font-size: 28px !important;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px !important;
  font-family: "Poppins", sans-serif;
  line-height: 1 !important;
  text-align: center !important;
}

.repair-report {
  font-family: "Poppins", sans-serif;
  padding: 20px;
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.defects-list h3 {
  margin: 0px !important;
}
.popup-circles {
  display: flex;
  gap: 10px; /* Reduced gap between circles */
  margin: 8px 0;
  align-items: center;
  justify-content: center;
}

.property-address {
  font-size: 18px !important;
}

.popup-circles .metric-circle {
  width: 35px; /* Smaller circles */
  height: 35px; /* Smaller circles */
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px; /* Smaller font size */
  font-weight: 700;
  color: white;
  margin-top: 0px !important;
}
/* Title Styling */
.report-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  font-family: "Poppins", sans-serif;
}

/* Repair Averages Section (Flexbox for Left Title & Right Numbers) */
.repair-averages {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Labels Section (On Left) */
.repair-labels {
  text-align: left;
  font-size: 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  font-family: "Poppins", sans-serif;
}

.repair-labels p {
  margin-bottom: 0 !important;
  font-family: "Poppins", sans-serif;
}

/* Numbers Section (On Right - Circles Stacked) */
.repair-numbers {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

/* Circular Number Styling */
.repair-box {
  width: 90px;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: bold;
  border-radius: 50%;
  color: white;
  font-family: "Poppins", sans-serif;
}

/* Gold Box for Immediate Repairs */
.gold-box {
  background: gold;
  color: white;
}

#property-slider.slick {
  padding: 20px 0px !important;
}

/* Purple Box for Maintenance (Slightly Below Gold Box) */
.purple-box {
  background: blue;
  color: white;
  margin-top: -30px;
}

.legend-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-color {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-block;
}

.charts-wrapper {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: center;
}

/*  Form	 */
/* General Form Styling */
#inspection-search-form {
  background: #fff !important;
  padding: 15px;
  border-radius: 4px;
}

/* Search Bar Styling (Step 1) */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  /*     border-radius: 8px; */
}

/* Address Input */
.search-bar input[type="text"] {
  flex: 3;
  flex-basis: 300px;
}
input {
  border: none;
  outline: none;
  font-size: 16px;
  padding: 10px;
  border-radius: 2px !important;
  background: #f5f5f5;
  box-shadow: none;
}

/* Zip Code Input */
.search-bar input[type="text"]:nth-child(2) {
  flex: 1;
  flex-basis: 80px;
}

.search-bar input[type="number"]:nth-child(3) {
  flex: 1;
  flex-basis: 80px;
}
/* Search Button */
.search-btn {
  background: #0d3b66;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 2px;
  border: 1px solid #0d3b66;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 11px 20px !important;
  border-radius: 5px !important;
  align-items: center;
  justify-content: center;
}

.search-btn svg path {
  fill: #fff !important;
}

.search-btn:hover {
  background: #084298;
}

/* Step 2 Fields */
.search-details {
  display: flex;
  gap: 10px;
  flex-direction: row !important;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0 !important;
}

/* Input Fields for Step 2 */
.search-details input {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  font-size: 16px;
  flex-basis: 300px;
}

/* Submit Button */
.submit-btn {
  background: #0d3b66;
  color: white;
  padding: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  background: #0d3b66;
  color: white;
  border: 1px solid #0d3b66;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 11px 20px !important;
  border-radius: 5px !important;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover {
  background: #084298;
}

/* Loading Text */
#loading {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

#result_section {
  height: auto;
  overflow: hidden;
  padding: 20px 0px;
}
#result_section.active {
  height: auto !important;
}

/* Hide Step 2 Initially */
#step-2 {
  opacity: 0;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Transition when Step 1 disappears */
.hide-step {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}

/* Transition when Step 2 appears */
.show-step {
  opacity: 1 !important;
  transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }

  .form-group.address,
  .form-group.zipcode {
    flex: 1;
  }
}

/* Map	 */

#inspection-map-wrapper {
  position: relative;
  margin: 30px 0px;
  border-radius: 8px;
  overflow: hidden;
}

#inspection-map {
  height: 500px;
  z-index: 1;
}

#map-buttons {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 999;
  display: flex;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#map-buttons .map-toggle {
  background-color: transparent;
  border: none;
  color: #555;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 25px;
  margin: 0 2px;
}

#map-buttons .map-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333;
}

#map-buttons .map-toggle.active {
  background-color: #141659;
  color: white;
}

/* Custom map style - Leaflet container */
.leaflet-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Global styles */
body,
body * {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* Clean, Refined Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 0;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0;
  line-height: 1.5;
  width: 220px !important;
}

.popup-content {
  padding: 12px 14px;
  background-color: white;
  text-align: center;
}

.popup-address {
  font-size: 14px;
  font-weight: 600;
  color: #141659;
  margin-bottom: 0px;
  line-height: 1;
}

.popup-details {
  font-size: 12px;
  color: #666;
  margin-bottom: 0;
}

.popup-link-container {
  background-color: #f7941d;
  padding: 8px;
  text-align: center;
  border-top: 1px solid #faa43d;
}

.popup-link-container a {
  color: #fff !important;
  text-decoration: none !important;
}

.popup-link {
  color: #fff !important;
  font-size: 13px;
  font-weight: 500;
  display: inline-block;
  background-color: transparent;
  padding: 0;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
  text-decoration: none !important;
}

.popup-link-container a:hover {
  color: #fff !important;
  background-color: transparent;
}

/* Reduce popup tip size for a more refined look */
.leaflet-popup-tip {
  background-color: #f7941d;
  width: 10px;
  height: 10px;
}

/* Fix duplicate zoom controls */
.leaflet-top.leaflet-left .leaflet-control-zoom:nth-child(2) {
  display: none;
}

/* Style zoom controls */
.leaflet-control-zoom {
  border-radius: 4px !important;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-control-zoom a {
  background-color: #fff !important;
  color: #333 !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
}

/* Local Average Repairs Heading */
.local-repairs-heading {
  font-size: 28px !important;
  font-weight: 600;
  color: #141659;
  text-align: center;
  font-family: "Poppins", sans-serif;
  line-height: 36px !important;
}

/* Property Slider	 */

/* New Property Slider Design */
.property-slider-header {
  text-align: center;
  margin-top: 30px;
}

.local-inspection-heading {
  font-size: 28px !important;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px !important;
  font-family: "Poppins", sans-serif;
  line-height: 1 !important;
}

.local-inspection-description {
  font-size: 18px !important;
  color: #666 !important;
  line-height: 26px;
  font-family: "Inter", sans-serif;
  margin-bottom: 0px !important;
}

.property-card {
  display: flex;
  flex-direction: column;
  align-items: center !important;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin: 10px;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.property-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.property-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.property-details {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  align-items: center;
  width: 100%;
}

.property-counts {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

/* Property card metric circles */
.property-card .metric-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.property-card .maintenance-circle {
  background-color: #141659;
}

.property-card .recommended-circle {
  background-color: #f7941d;
}

/* Responsive adjustments for property card metrics */
@media (max-width: 768px) {
  .property-card .metric-circle {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .property-card .property-counts {
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .property-card .metric-circle {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .property-card .property-counts {
    gap: 10px;
  }
}

/* Keep existing property maintenance styles for backwards compatibility */
.property-maintenance {
  font-size: 14px;
  color: #34495e;
  line-height: 1.4;
  text-align: center;
}

.view-report-button {
  background-color: #141659 !important;
  border: 1px solid #141659 !important;
  color: white !important;
  text-align: center;
  padding: 10px 15px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  margin-top: auto;
  display: inline-block;
  width: 100%;
}

.view-report-button:hover {
  background-color: #f5a623 !important;
  border-color: #f5a623 !important;
}

/* Styles for property slider with 3 or fewer properties */
#property-slider.slick-initialized.slick-slider:not(.slick-dotted) {
  display: flex;
  justify-content: center;
}

/* When only showing 3 properties, ensure they have equal width */
#property-slider.slick-initialized.slick-slider:not(.slick-dotted)
  .slick-track {
  display: flex;
  width: 100% !important;
  transform: none !important;
}

#property-slider.slick-initialized.slick-slider:not(.slick-dotted)
  .slick-slide {
  width: 33.333% !important;
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .local-inspection-heading {
    font-size: 28px !important;
    line-height: 1;
    margin-bottom: 0px !important;
  }

  .local-inspection-description {
    font-size: 16px !important;
    line-height: 24px;
    margin-top: 10px !important;
  }
}

.investment-header {
  font-size: 38px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 25px;
  color: #20293c;
  font-family: "Poppins", sans-serif;
  line-height: 1.2;
}

.investment-address {
  color: #f7941d;
  font-weight: 500;
}

.insight-text {
  text-align: center;
  font-size: 22px;
  margin-bottom: 20px; /* Reduced from 35px */
  line-height: 32px;
  font-family: "Inter", sans-serif;
}

.high-cost-risks {
  color: #ffb84d !important;
  font-weight: bold !important;
}

.metrics-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px; /* Increased from 25px */
  margin: 20px 0 30px; /* Adjusted margin for new position */
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 120px; /* Added min-width */
}

.metric-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: 700;
  margin-top: 0; /* Removed top margin since there's no label */
  color: white;
}

.maintenance-circle {
  background-color: #141659;
}

.recommended-circle {
  background-color: #f7941d;
}

#immediate-repairs {
  color: #141659;
}

.metric-label {
  font-size: 18px;
  color: #333;
  opacity: 0.85;
  font-weight: 600;
}

/* Tooltip styles */
.tooltip-icon {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #4a6da7;
  color: white;
  font-weight: bold;
  font-size: 14px;
  margin-left: 5px;
  position: relative;
  font-style: normal;
}

.tooltip-icon::before {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 100;
  background-color: #1a2942;
  color: white;
  padding: 15px;
  border-radius: 6px;
  width: 300px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  line-height: 1.5;
  font-family: Arial, sans-serif;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  font-weight: normal;
}

.tooltip-icon::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: transparent transparent #1a2942 transparent;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tooltip-icon:hover::before,
.tooltip-icon:hover::after {
  opacity: 1;
  visibility: visible;
}

.cta-button {
  text-align: center;
  margin-top: 20px;
}

.estimate-button {
  background-color: #141659 !important;
  border: 1px solid #141659 !important;
  color: white !important;
  border-radius: 30px;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  display: inline-block;
  text-decoration: none !important;
}

.estimate-button:hover {
  background-color: #f5a623 !important;
  border-color: #f5a623 !important;
}

/* Add Inter font for descriptions and links */
p,
.card-description,
a,
.property-description,
.popup-content,
.insight-text {
  font-family: "Inter", sans-serif;
}

.damage-card .card-description {
  font-family: "Inter", sans-serif;
}

.repair-card-description {
  font-family: "Inter", sans-serif;
}

.popup-link {
  font-family: "Inter", sans-serif;
}

.investment-header {
  font-family: "Poppins", sans-serif;
}

.insight-text {
  font-family: "Inter", sans-serif;
}

body,
body a {
  text-decoration: none !important;
}

/* Responsive Styles for Investment Header, Map, and Metrics */
@media (max-width: 768px) {
  /* Investment Header Section */
  .investment-header {
    font-size: 42px !important;
    line-height: 50px !important;
  }

  .insight-text {
    font-size: 20px;
    line-height: 28px;
  }

  /* Map Section */
  #inspection-map-wrapper {
    margin: 20px 0;
  }

  #inspection-map {
    height: 400px;
  }

  #map-buttons {
    top: auto;
    right: auto;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    justify-content: center;
  }

  #map-buttons .map-toggle {
    padding: 6px 12px;
    font-size: 13px;
    flex: 1;
    text-align: center;
  }

  /* Metrics Section - Updated for new layout */
  .metrics-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0px !important;
    margin: 15px 0 25px;
  }

  .metric-circle {
    width: 80px;
    height: 80px;
    font-size: 26px;
  }

  /* Local Insights heading */
  .local-insights-heading {
    font-size: 28px !important;
    line-height: 1;
    margin-bottom: 0px !important;
  }

  /* Local Inspection Reports */
}

@media (max-width: 480px) {
  /* Investment Header Section */

  .insight-text {
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 15px;
  }

  /* Map Section */
  #inspection-map {
    height: 350px;
  }

  #map-buttons {
    flex-wrap: wrap;
    padding: 4px;
  }

  #map-buttons .map-toggle {
    font-size: 12px;
    padding: 5px 8px;
    margin: 2px;
  }

  /* Metrics Section - Updated for new layout */
  .metrics-container {
    margin: 10px 0 20px;
  }

  .metric-circle {
    width: 70px;
    height: 70px;
    font-size: 24px;
  }

  .estimate-button {
    font-size: 14px;
    padding: 10px 20px;
  }

  /* Local Inspection Reports */

  /* Property Cards */
  .property-card {
    margin: 5px;
  }
}

/* Extra Small Devices */
@media (max-width: 380px) {
  /* Metrics - Updated for new layout */
  .metrics-container {
    margin: 8px 0 15px;
  }

  .metric-circle {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }

  /* Map */
  #inspection-map {
    height: 300px;
  }

  #map-buttons {
    width: 95%;
    padding: 3px;
  }

  #map-buttons .map-toggle {
    font-size: 11px;
    padding: 4px 6px;
    margin: 1px;
  }

  /* CTA */
  .estimate-button {
    font-size: 13px;
    padding: 8px 16px;
  }

  /* Properties Section */

  .local-inspection-description {
    font-size: 16px !important;
    line-height: 22px;
  }
}

/* Property slider - Make it scrollable across all devices */
#property-slider {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 15px 0;
  display: flex;
  touch-action: pan-x;
  scrollbar-width: thin;
  /* Ensure no snap or pagination */
  scroll-snap-type: none !important;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  /* Property slider adjustments for scroll mode */
  #property-slider {
    padding: 10px 0;
    /* Removing scroll snap for smooth scrolling */
    scroll-snap-type: none !important;
  }

  .property-card {
    width: 280px;
    margin: 0 8px;
    /* Removing scroll snap alignment for smooth scrolling */
    scroll-snap-align: none !important;
  }

  /* Defect Row - Enhanced smooth scrolling */
  .defect-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px !important;
    padding: 15px 0px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    width: 100%;
    padding-bottom: 10px;
    /* Removing scroll snap for smooth scrolling */
    scroll-snap-type: none !important;
    scrollbar-width: thin;
  }

  .defect-row .defect-item {
    flex: 0 0 370px;
    max-width: 370px;
    /* Removing scroll snap alignment for smooth scrolling */
    /* scroll-snap-align: start; */
    margin-bottom: 0; /* Remove bottom margin to avoid spacing issues */
  }
}

@media (max-width: 480px) {
  /* Smaller screens need more compact cards */
  .property-card {
    width: 260px;
    border-radius: 6px;
    margin: 0 6px;
  }

  /* Adjust image height */
  .property-image,
  .property-card img {
    height: 130px;
  }

  /* Further reduce text sizes */
  .property-content h3 {
    font-size: 14px;
  }

  .property-content p {
    font-size: 12px;
    line-height: 1.4;
  }

  /* Compact the view report button */
  .view-report-button {
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* Add active state for when user is scrolling */
#property-slider.active {
  cursor: grabbing;
  cursor: -webkit-grabbing;
  transform: scale(1);
  user-select: none;
}

/* Add a horizontal indicator to show there's more content */

/* Hidden Defects Section Styles */
.defects-container {
  max-width: 1200px;
  margin: 30px auto 30px auto;
}

.defects-title {
  font-size: 28px !important;
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
  font-family: "Poppins", sans-serif;
  line-height: 1 !important;
}

.defects-subtitle {
  font-size: 18px !important;
  color: #666;
  margin-bottom: 30px;
  text-align: center;
  font-family: "Inter", sans-serif;
  line-height: 1.4;
}

.defects-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Section Item Styles */
.section-item {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 15px;
}

/* Section Header Styles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(245, 166, 35, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 4px solid #f5a623;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  gap: 15px;
  font-family: "Poppins", sans-serif;
  position: relative;
  border-radius: 8px;
  margin-bottom: 2px;
}

.section-header:hover {
  background-color: rgba(245, 166, 35, 0.1);
}

.section-left {
  display: flex;
  align-items: center;
}

.defect-icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: #f5a623;
  color: white;
  border-radius: 50%;
  margin-right: 10px;
  line-height: 1;
  font-size: 16px;
  position: relative;
}

.section-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  filter: invert(70%) sepia(47%) saturate(1648%) hue-rotate(356deg)
    brightness(100%) contrast(95%);
}

.section-name {
  font-size: 24px !important;
  font-weight: 600;
  margin: 0 !important;
  font-family: "Poppins", sans-serif;
}

/* Hidden defect count styling */
.hidden-defect-count {
  background-color: #fef1dc;
  color: #f5a623;
  font-size: 14px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 4px;
}

/* Section Content Styles */
.section-content {
  display: block;
  padding: 0;
}

/* Defect Row Styles - Show exactly 3 cards with the rest scrollable */
.defect-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px !important;
  padding: 15px 0px !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  width: 100%;
  padding-bottom: 10px;
  /* Removing scroll snap for smooth scrolling */
  /* scroll-snap-type: x mandatory; */
}

/* Hide scrollbar but allow scrolling */
.defect-row::-webkit-scrollbar {
  height: 6px;
  background-color: #f5f5f5;
}

.defect-row::-webkit-scrollbar-thumb {
  background-color: #0d3b66;
  border-radius: 3px;
}

.defect-row .defect-item {
  flex: 0 0 370px;
  max-width: 370px;
  /* Removing scroll snap alignment for smooth scrolling */
  /* scroll-snap-align: start; */
  margin-bottom: 0; /* Remove bottom margin to avoid spacing issues */
}

/* Ensure cards maintain aspect ratio */
.defect-item {
  min-height: 450px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Improve touch scrolling feedback */
.defect-row:active {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}

/* Add horizontal scroll indicator */
.section-content {
  position: relative;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .defect-row .defect-item {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex: 0 0 300px;
  }

  .defects-title {
    margin-bottom: 10px !important;
  }

  /* When only two cards are present */
  .defect-row:only-child {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .defect-row .defect-item {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex: 0 0 300px;
  }
}

/* Defect Item Styles - Updated for consistent card styling */
.defect-item {
  display: flex;
  flex-direction: column;
  flex: 0 0 300px;
  min-width: 300px;
  max-width: 300px;
  width: 300px;
  margin-right: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 15px;
  transition: box-shadow 0.3s ease;
  position: relative;
  border: 1px solid #f0f0f0;
}

.defect-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.defect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-radius: 4px 4px 0 0;
  position: relative;
}

@media (max-width: 768px) {
  .defect-header {
    flex-direction: column;
    gap: 10px;
  }

  .defect-name {
    width: 100%;
    font-size: 18px !important;
    line-height: 24px !important;
  }
  .defect-meta {
    width: 100%;
    justify-content: space-between;
  }

  .section-name {
    font-size: 20px !important;
  }
}

.defect-name {
  margin: 0;
  font-size: 20px !important;
  font-weight: 600;
  color: inherit;
  line-height: 26px !important;
  font-family: "Poppins", sans-serif;
  flex: 1;
  color: #fff !important;
}

.defect-meta {
  display: flex;
  gap: 12px;
  font-size: 14px;
  align-items: center;
}

.defect-probability {
  color: #f5a623;
  font-weight: 600;
  background-color: rgba(245, 166, 35, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

.defect-cost {
  color: white;
  font-weight: 600;
  letter-spacing: 1px;
}

.defect-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.defect-description {
  position: relative;
  max-height: 80px; /* Match the value in JavaScript (line 802) */
  overflow: hidden;
  /* margin-bottom: 10px; */
  transition: max-height 0.3s ease;
}

.defect-description.expanded {
  max-height: 1000px; /* Allow plenty of room for expanded content */
}

.defect-description:not(.expanded)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 1)
  );
  pointer-events: none;
}

.show-more-btn {
  background-color: #141659 !important;
  border: 1px solid #141659 !important;
  color: white !important;
  border-radius: 30px !important;
  padding: 8px 15px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background-color 0.3s ease, border-color 0.3s ease !important;
  display: inline-block !important;
  text-decoration: none !important;
  width: max-content !important;
}

.show-more-btn:hover {
  background-color: #f5a623 !important;
  border-color: #f5a623 !important;
}

/* Description expansion */
.defect-description {
  position: relative;
  max-height: 80px; /* Match the value in JavaScript (line 802) */
  overflow: hidden;
  /* margin-bottom: 10px; */
  transition: max-height 0.3s ease;
}

.defect-description.expanded {
  max-height: 1000px; /* Allow plenty of room for expanded content */
}

.defect-description:not(.expanded)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 1)
  );
  pointer-events: none;
}

/* Video button styling */
.defect-video-btn {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.defect-video-btn img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.video-play-overlay:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

.video-play-icon {
  color: white !important;
  font-size: 16px;
  background-color: #ff0000 !important;
  width: 50px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding-left: 3px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.defect-video-btn:hover .video-play-icon {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .defects-subtitle {
    font-size: 16px !important;
    margin-bottom: 20px;
  }

  .defect-row .defect-item {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex: 0 0 300px;
  }

  /* Adjust grid layout for tablets */
  .defect-media-grid {
    grid-template-columns: 65% 35%; /* Adjust ratio slightly for tablets */
  }

  .defect-main-photo img {
    height: 100% !important; /* Keep the same height on tablets */
    background-size: cover !important;
  }

  .defect-small-photo img,
  .defect-video-btn img {
    height: 70px; /* Keep the same height on tablets */
  }

  .gallery-show-more-btn {
    height: 55px;
    font-size: 13px;
  }

  .gallery-more-icon {
    font-size: 18px;
  }

  .gallery-more-text {
    font-size: 16px;
  }

  .video-play-icon {
    font-size: 14px;
    width: 40px;
    height: 25px;
  }
}

/* Mobile map height adjustment */
@media (max-width: 480px) {
  #inspection-map {
    height: 350px !important;
  }

  /* Adjust grid layout for mobile */
  .defect-media-grid {
    grid-template-columns: 60% 40%; /* Adjust ratio for mobile */
  }

  .defect-main-photo img {
    height: 100% !important; /* Keep the same height on tablets */
    background-size: cover !important;
  }

  .defect-small-photo img,
  .defect-video-btn img {
    height: 70px; /* Keep consistent with larger screens */
  }

  .gallery-show-more-btn {
    height: 50px;
    font-size: 12px;
    padding: 8px 5px;
  }

  .gallery-more-icon {
    font-size: 16px;
  }

  .gallery-more-text {
    font-size: 14px;
  }

  .video-play-icon {
    font-size: 14px;
    width: 35px;
    height: 20px;
  }
}

/* Video modal styles */
.video-modal-overlay,
.video-modal,
.photo-gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9997; /* Slightly lower than lightbox gallery */
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal-content,
.photo-gallery-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
}

.video-modal-close,
.close-video-modal,
.close-gallery {
  position: absolute;
  top: 15px;
  right: 15px;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000; /* Ensure it's above other elements */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  transition: background-color 0.2s;
  border: 2px solid white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  text-decoration: none;
  user-select: none;
}

.video-modal-close:hover,
.close-video-modal:hover,
.close-gallery:hover {
  background-color: rgba(255, 0, 0, 0.7);
  transform: scale(1.1);
}

/* Video containers */
.video-container,
.video-modal-content video,
.lightbox-gallery-video-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  max-height: calc(85vh - 150px);
}

.lightbox-gallery-video-container {
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container iframe,
#video-placeholder,
.lightbox-gallery-video-container iframe,
.lightbox-gallery-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
}

.property-info {
  display: flex;
  justify-content: center;
  gap: 5px;
  /* width: 90%; */
  padding: 10px;
}

/* Gallery content area */
.lightbox-gallery-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 9990;
}

.lightbox-gallery-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Navigation controls */
.lightbox-gallery-nav {
  position: absolute;
  top: 0;
  width: 80px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9991;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-gallery-nav:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-gallery-prev {
  left: 0;
}

.lightbox-gallery-next {
  right: 0;
}

/* Thumbnails, counter, and caption */
.lightbox-gallery-thumbnails {
  height: 80px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding: 5px 0;
}

.lightbox-gallery-thumbnail {
  width: 80px;
  height: 60px;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
  transition: border-color 0.2s;
}

.lightbox-gallery-thumbnail.active {
  border-color: #fff;
}

.lightbox-gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-gallery-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #fff;
  font-size: 14px;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 5px 10px;
  border-radius: 15px;
  z-index: 9992;
}

.lightbox-gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  text-align: center;
  font-size: 14px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.lightbox-gallery-container:hover .lightbox-gallery-caption {
  transform: translateY(0);
}

/* Gallery animations */
.lightbox-gallery-image,
.lightbox-gallery-video-container {
  opacity: 0;
  animation: fade-in 0.3s ease forwards;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Photo gallery modal styles from shortcodes.php */
.gallery-main-image {
  width: 100%;
  height: 70vh;
  max-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.gallery-main-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: #111;
  color: white;
}

.gallery-prev,
.gallery-next {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  margin: 0 15px;
}

.gallery-prev:disabled,
.gallery-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-counter {
  font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .lightbox-gallery-container,
  .video-modal-content,
  .photo-gallery-content {
    width: 95%;
  }

  .lightbox-gallery-nav {
    width: 50px;
  }

  .lightbox-gallery-close,
  .video-modal-close,
  .close-video-modal,
  .close-gallery {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    font-size: 25px;
  }

  .lightbox-gallery-thumbnails {
    height: 70px;
  }

  .lightbox-gallery-thumbnail {
    width: 60px;
    height: 45px;
  }

  .lightbox-gallery-counter {
    top: 10px;
    left: 10px;
    font-size: 12px;
  }
}

/* Navigation button icons */
.lightbox-gallery-nav-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.lightbox-gallery-nav-icon:before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-top: 3px solid #000;
  border-left: 3px solid #000;
}

.lightbox-gallery-prev .lightbox-gallery-nav-icon:before {
  transform: rotate(-45deg);
  margin-left: 4px;
}

.lightbox-gallery-next .lightbox-gallery-nav-icon:before {
  transform: rotate(135deg);
  margin-right: 4px;
}

/* Updated Lightbox gallery modal styles */
.lightbox-gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 99999;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  justify-content: center;
  align-items: center;
}

.lightbox-gallery-modal.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.lightbox-gallery-container {
  position: relative;
  width: 90%;
  max-width: 900px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  margin: auto;
}

.lightbox-gallery-close {
  position: absolute;
  top: 15px;
  right: 15px;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000; /* Ensure it's above other elements */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  transition: background-color 0.2s;
  border: 2px solid white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  text-decoration: none;
  user-select: none;
}

.lightbox-gallery-close:hover {
  background-color: rgba(255, 0, 0, 0.7);
  transform: scale(1.1);
}

.defect-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

/* Defect meta bottom section */
.defect-meta-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

.defect-cost {
  font-size: 18px;
  font-weight: 600;
  color: #f5a623;
}

.defect-probability {
  font-size: 18px;
  font-weight: 600;
  color: #f5a623;
  background-color: rgba(245, 166, 35, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

.defect-recommendation {
  font-size: 12px;
  line-height: 20px !important;
  color: #666;
  max-width: 150px;
  text-align: right;
}

/* Media styling */
.defect-media {
  display: flex;
  flex-direction: column;
  margin: 15px 0;
  overflow: hidden !important;
}

.defect-media-grid {
  display: grid;
  grid-template-columns: 67% 30%; /* Changed from 1fr 1fr to 70% 30% */
  gap: 8px;
}

.defect-main-photo {
  height: 190px !important;
  overflow: hidden;
  border-radius: 4px;
}

.defect-main-photo a {
  display: block;
  height: 100%;
}

.defect-main-photo img {
  width: 100%;
  height: 100% !important;
  background-size: cover !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  transition: transform 0.3s ease;
}

.defect-main-photo img:hover {
  transform: scale(1.05);
}

.defect-secondary-column {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 8px;
}

.defect-small-photo {
  height: calc(50% - 4px);
  overflow: hidden;
  border-radius: 4px;
}

.defect-small-photo a {
  display: block;
  height: 100%;
}

.defect-small-photo img {
  width: 100%;
  height: 60px; /* Reduced from 70px */
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.defect-small-photo img:hover {
  transform: scale(1.05);
}

.defect-video-btn img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  border-radius: 4px;
}

.gallery-show-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #141659 !important;
  border: 1px solid #141659 !important;
  color: white !important;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  text-align: center;
  padding: 12px 10px;
  height: 50px; /* Fixed height of 60px */
  position: relative;
  overflow: hidden;
}

.gallery-show-more-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(
    0,
    0,
    0,
    0.5
  ); /* Semi-transparent overlay for text readability */
  z-index: 1;
}

.gallery-show-more-btn:hover {
  background-color: #f5a623 !important;
  border-color: #f5a623 !important;
}

.gallery-more-icon,
.gallery-more-text {
  position: relative;
  z-index: 2; /* Place text above the background overlay */
}

.gallery-more-icon {
  font-weight: bold;
  display: inline-block;
  font-size: 20px;
  margin-right: 5px;
}

.gallery-more-text {
  font-weight: 600;
  font-size: 18px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
  .defects-subtitle {
    font-size: 16px !important;
    margin-bottom: 20px;
  }

  .defect-row .defect-item {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex: 0 0 300px;
  }

  /* When only two cards are present */
  .defect-row:only-child {
    justify-content: flex-start;
  }

  .defect-main-photo img {
    height: 100% !important;
    background-size: cover !important;
  }

  .defect-small-photo img,
  .defect-video-btn img {
    height: 55px; /* Reduced from 70px */
  }
}

@media (max-width: 480px) {
  .defects-subtitle {
    font-size: 14px !important;
    line-height: 20px !important;
    margin-bottom: 18px !important;
  }

  #inspection-map {
    height: 350px !important;
  }
}

/* Different color variations for defect items */
.defect-item.orange .defect-probability {
  color: #f5a623;
  background-color: rgba(245, 166, 35, 0.1);
}

.defect-item.blue .defect-probability {
  color: #56b2e9;
  background-color: rgba(86, 178, 233, 0.1);
}

.defect-item.red .defect-probability {
  color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.1);
}

.defect-item.green .defect-probability {
  color: #2ecc71;
  background-color: rgba(46, 204, 113, 0.1);
}

.defect-item.purple .defect-probability {
  color: #9b59b6;
  background-color: rgba(155, 89, 182, 0.1);
}

/* Mobile optimization for Show More functionality */
@media (max-width: 768px) {
  .defect-description {
    max-height: 70px; /* Slightly smaller on mobile */
    font-size: 14px;
  }

  .defect-description:not(.expanded)::after {
    height: 40px; /* Stronger gradient on mobile */
  }

  .show-more-btn {
    padding: 8px 15px !important;
    font-size: 16px !important;
    margin-bottom: 8px !important;
  }
}

@media (max-width: 480px) {
  .defect-description {
    max-height: 60px;
    font-size: 13px;
  }

  .show-more-btn {
    padding: 5px 10px !important;
    font-size: 14px !important;
  }
}

/* Video direct link and error styling */
.video-direct-link,
.video-error {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  text-align: center;
  border-radius: 8px;
}

.video-direct-link p,
.video-error p {
  color: white;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

.video-direct-link a {
  color: #f5a623;
  font-weight: bold;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.video-direct-link a:hover {
  color: #ffb84d;
}

/* Fixed navigation icons for lightbox gallery */
.lightbox-gallery-prev:after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-left: 3px solid white;
  border-bottom: 3px solid white;
  transform: rotate(45deg);
  margin-left: 5px;
}

.lightbox-gallery-next:after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-right: 3px solid white;
  border-top: 3px solid white;
  transform: rotate(45deg);
  margin-right: 5px;
}

/* Enhanced video container styles */
.lightbox-gallery-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

iframe.lightbox-gallery-video {
  width: 80%;
  height: 80%;
  aspect-ratio: 16/9;
}

/* Video loading indicator */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 16px;
}

/* Statistics Display */
.stats-section {
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.stats-header {
  background-color: #fff;
  padding: 15px 0;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stats-heading {
  font-size: 28px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  color: #333 !important;
  padding: 0 15px;
  line-height: 1.3 !important;
}

.stats-container {
  position: relative;
  color: #333;
  height: 450px;
  background-color: #f5f5f5;
}

.stats-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../assets/images/house.jpeg");
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.stats-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.05);
  z-index: 2;
}

.stats-legend {
  position: absolute;
  top: 15px;
  left: 38px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: rgba(245, 245, 245, 0.85);
  padding: 10px 15px;
  border-radius: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-color {
  width: 15px;
  height: 15px;
}

.legend-text {
  font-size: 16px;
  white-space: nowrap;
  font-weight: 500;
  color: #333;
}

.color-hidden {
  background-color: #f5a623;
}

.color-total {
  background-color: #1c2a44;
}

.stats-columns {
  display: flex;
  height: 100%;
  position: relative;
  z-index: 3;
  justify-content: space-around;
}

.stats-column {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 30px;
  width: 35%;
}

.column-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background-color: #ffffff;
  z-index: 4;
}

/* Left container (New Construction) */
.stats-column:first-child .bar-container {
  width: 85px;
  height: 190px;
}

/* Right container (Pre-Owned) */
.stats-column:last-child .bar-container {
  width: 85px;
  height: 230px;
}

/* Text sizes for left container */
.stats-column:first-child .blue-bar {
  font-size: 24px;
  flex: 1;
}

.stats-column:first-child .orange-bar {
  font-size: 24px;
  flex: 0.2;
}

/* Text sizes for right container */
.stats-column:last-child .blue-bar {
  font-size: 26px;
  flex: 1;
}

.stats-column:last-child .orange-bar {
  font-size: 26px;
  flex: 0.15;
}

.bar-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 3px;
}

.blue-bar {
  background-color: #1c2a44;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: 600;
  border-radius: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  padding-top: 25px;
  padding-bottom: 25px;
  position: relative;
  z-index: 1;
}

.orange-bar {
  background-color: #f5a623;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: 600;
  border-radius: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  padding-top: 10px;
  padding-bottom: 10px;
  position: relative;
  z-index: 2;
}

.nc-blue,
.nc-orange,
.po-blue,
.po-orange {
  height: auto;
}

.stats-footer {
  background-color: #fff;
  text-align: center;
  font-size: 14px;
  color: #666;
  font-style: italic;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 10px 0px;
}

.footer-labels {
  display: flex;
  justify-content: space-between;
  padding: 0;
  background-color: #fff;
  margin: 10px 0px;
  width: 100%;
}

.footer-label {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  background-color: #fff;
  padding: 8px 15px;
  white-space: nowrap;
  font-style: normal;
  width: 50%;
  text-align: center;
}

.footnote-text {
  text-align: center;
}

/* Responsive styles for stats section */
@media screen and (max-width: 768px) {
  .stats-section {
    max-width: 95%;
  }

  .stats-container {
    height: 400px;
  }

  .stats-heading {
    font-size: 24px !important;
  }

  .stats-legend {
    left: 20px;
    top: 10px;
    padding: 8px 12px;
    gap: 0px !important;
    max-width: calc(50% - 30px); /* Ensure it stays within left column */
  }

  .legend-text {
    font-size: 14px;
    white-space: normal; /* Allow text to wrap if needed */
  }

  .legend-item {
    gap: 6px;
    align-items: flex-start; /* Align items at the start */
  }

  .legend-color {
    width: 12px;
    height: 12px;
    flex-shrink: 0; /* Prevent the color box from shrinking */
    margin-top: 5px; /* Add space at the top */
  }

  /* Left container (New Construction) */
  .stats-column:first-child .bar-container {
    width: 70px;
    height: 170px;
  }

  /* Right container (Pre-Owned) */
  .stats-column:last-child .bar-container {
    width: 70px;
    height: 210px;
  }

  .stats-column:first-child .blue-bar,
  .stats-column:first-child .orange-bar {
    font-size: 20px;
  }

  .stats-column:last-child .blue-bar,
  .stats-column:last-child .orange-bar {
    font-size: 22px;
  }

  .footer-label {
    font-size: 20px;
    padding: 6px 10px;
  }

  .footer-labels {
    padding: 0 10%;
  }
}

@media screen and (max-width: 600px) {
  .stats-section {
    max-width: 100%;
    margin: 0;
  }

  .stats-container {
    height: 380px;
  }

  .stats-heading {
    font-size: 22px !important;
    padding: 0 10px;
  }

  .stats-legend {
    left: 15px;
    padding: 6px 10px;
    gap: 0px !important;
    max-width: calc(45% - 20px); /* Narrower on smaller screens */
  }

  .footer-labels {
    padding: 0 5%;
  }

  .footer-label {
    font-size: 18px;
  }
}

@media screen and (max-width: 480px) {
  .stats-container {
    height: 350px;
  }

  .stats-heading {
    font-size: 20px !important;
  }

  .stats-legend {
    left: 10px;
    padding: 6px 10px;
    gap: 0px !important;
    max-width: calc(45% - 15px); /* Even narrower on mobile */
  }

  .legend-text {
    font-size: 12px;
    white-space: normal; /* Allow text to wrap if needed */
  }

  .legend-item {
    gap: 6px;
  }

  .legend-color {
    width: 10px;
    height: 10px;
    flex-shrink: 0; /* Prevent the color box from shrinking */
  }

  /* Left container (New Construction) */
  .stats-column:first-child .bar-container {
    width: 60px;
    height: 150px;
  }

  /* Right container (Pre-Owned) */
  .stats-column:last-child .bar-container {
    width: 60px;
    height: 190px;
  }

  .stats-column:first-child .blue-bar,
  .stats-column:first-child .orange-bar {
    font-size: 18px;
  }

  .stats-column:last-child .blue-bar,
  .stats-column:last-child .orange-bar {
    font-size: 20px;
  }

  .blue-bar,
  .orange-bar {
    padding-top: 15px;
    padding-bottom: 15px;
  }

  .orange-bar {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .footer-labels {
    padding: 0;
    flex-direction: row;
    align-items: center;
    gap: 5px;
  }

  .footer-label {
    font-size: 16px;
    padding: 5px 8px;
  }

  .footnote-text {
    font-size: 10px;
    padding: 5px 10px;
  }
}

@media screen and (max-width: 375px) {
  .stats-container {
    height: 320px;
  }

  .stats-legend {
    top: 5px;
    left: 5px;
    padding: 5px 8px;
    gap: 0px !important;
    max-width: calc(40% - 10px); /* Tightest constraint for smallest screens */
  }

  .legend-text {
    font-size: 10px;
  }

  /* Left container (New Construction) */
  .stats-column:first-child .bar-container {
    width: 50px;
    height: 130px;
  }

  /* Right container (Pre-Owned) */
  .stats-column:last-child .bar-container {
    width: 50px;
    height: 170px;
  }

  .stats-column:first-child .blue-bar,
  .stats-column:first-child .orange-bar {
    font-size: 16px;
  }

  .stats-column:last-child .blue-bar,
  .stats-column:last-child .orange-bar {
    font-size: 18px;
  }
}

/* Highlight active stats column */
.stats-column.active-column {
  transform: scale(1.05);
}

.stats-column.active-column .stats-bar {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.stats-column.active-column .total-count {
  color: #f7941d;
  font-weight: 700;
}

.stats-column.active-column .column-label {
  font-weight: 700;
  color: #141659;
}

/* Mobile optimizations for defect cards */
@media (max-width: 768px) {
  .defect-meta-bottom {
    padding: 12px;
  }

  .defect-cost {
    font-size: 16px;
  }

  .defect-probability {
    font-size: 16px;
    padding: 2px 6px;
  }
}

@media (max-width: 480px) {
  .defect-meta-bottom {
    padding: 12px;
  }

  .defect-cost {
    font-size: 16px;
  }

  .defect-probability {
    font-size: 16px;
    padding: 2px 5px;
  }
}

/* Map Marker Size Control */
.leaflet-marker-icon.custom-map-marker {
  width: 45px !important;
  height: 45px !important;
}

.leaflet-marker-icon.custom-map-marker svg {
  width: 45px !important;
  height: 45px !important;
}

/* Slightly larger user location marker with star */
.leaflet-marker-icon.custom-map-marker.search-marker {
  width: 65px !important;
  height: 65px !important;
}

.leaflet-marker-icon.custom-map-marker.search-marker svg {
  width: 65px !important;
  height: 65px !important;
}

/* Custom Brand Colors for Map Markers */
.custom-map-marker.orange-marker svg path[fill="#F7941D"] {
  fill: #f7941d !important;
}

.custom-map-marker.navy-marker svg path[fill="#141659"] {
  fill: #141659 !important;
}

.custom-map-marker.search-marker svg path[fill="#F7941D"] {
  fill: #f7941d !important;
}

/* Make star icon stand out */
.custom-map-marker svg path[fill="#FFF"] {
  fill: #ffffff !important;
}

@media (max-width: 768px) {
  /* Map Marker Size Control */
  .leaflet-marker-icon.custom-map-marker,
  .leaflet-marker-icon.custom-map-marker svg {
    width: 35px !important;
    height: 35px !important;
  }

  .leaflet-marker-icon.custom-map-marker.search-marker,
  .leaflet-marker-icon.custom-map-marker.search-marker svg {
    width: 50px !important;
    height: 50px !important;
  }
}

@media screen and (max-width: 768px) {
  .property-info {
    width: 100%;
    padding: 10px 0px;
  }
}

/* Backward compatibility for old heading class */
.local-repairs-heading {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin: 15px 0 20px;
  color: #20293c;
  font-family: "Poppins", sans-serif;
}
