:root {
  --bg-color: #f5f7fa;
  --panel-bg: rgba(255, 255, 255, 0.95);
  --xburg-purple: #4f0f87;
  --xburg-light-purple: #9146FF;
  --xburg-dark-purple: #3d0a6b;
  --light-grey: #f5f5f5;
  --medium-grey: #eaeaea;
  --dark-grey: #888;
  --text-color: #333;
  --white: #fff;
  --chat-bg: #ffffff;
  --chat-border: #eaeaea;
  --border-radius: 8px;
  --project-color: #4f0f87;
  --property-color: #4f0f87;
  --slider-color: #4f0f87;
  --text-dark: #222;
}

/* App container is now defined in fullscreen.css */
/* .app-container {
  display: flex;
  height: 100%;
  width: 100%;
} */

/* 
 * NOTICE: Map Panel styling has been moved to fullscreen.css
 * The following definitions are commented out to avoid duplication
 */

/* Map Panel - see fullscreen.css */
/* .map-panel {
  flex: 1;
  position: relative;
  height: 100%;
  width: 60%;
} */

/* Map container - see fullscreen.css */
/* #map {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
} */

/* Comparison Overlay */
.comparison-overlay {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: auto;
  max-width: 800px;
  display: none; /* Hidden by default */
  z-index: 9999 !important;
}

/* Project Comparison Cards */
.comparison-projects {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  justify-content: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.project-comparison-card {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 10px;
  width: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.project-comparison-card .remove-project {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.project-comparison-card .remove-project:hover {
  background: rgba(220, 53, 69, 0.9);
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.project-comparison-card .project-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

.project-comparison-card h3.project-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
  text-align: center;
}

.comparison-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.comparison-controls button {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background-color: var(--xburg-purple);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  min-width: 80px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(79, 15, 135, 0.3);
}

.comparison-controls button:hover {
  background-color: var(--xburg-dark-purple);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 15, 135, 0.4);
}

.filters-panel h2 {
  font-size: 1.8rem;
  margin-bottom: 25px;
  color: var(--text-dark);
}

.filter-item {
  margin-bottom: 28px;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.filter-header span:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.filter-value {
  color: #555;
}

/* Sliders */
.dual-slider, 
.single-slider {
  position: relative;
  height: 30px;
}

.slider-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
  transform: translateY(-50%);
}

.track-highlight {
  position: absolute;
  height: 100%;
  background-color: var(--slider-color);
  border-radius: 2px;
}

.track-thumb {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  background-color: var(--slider-color);
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.track-thumb.min {
  left: 20%;
}

.track-thumb.max {
  left: 60%;
}

/* Specific z-index for dual slider thumbs */
.dual-slider .track-thumb.min {
    z-index: 3; /* Ensure min thumb is clickable on top */
}

.dual-slider .track-thumb.max {
    z-index: 2; /* Max thumb behind min when overlapping */
}

/* Range input styling */
input[type="range"] {
  position: absolute;
  width: 100%;
  height: 30px;
  opacity: 0;
  cursor: pointer;
  margin: 0; /* Ensure no default margins */
  padding: 0; /* Ensure no default padding */
  left: 0; /* Align to the container */
  top: 50%; /* Center vertically */
  transform: translateY(-50%); /* Precise vertical centering */
}

.dual-slider input[type="range"] {
  pointer-events: none; /* Disable direct interaction ONLY for price inputs */
}

/* Disable pointer events ONLY for single-slider inputs */
.single-slider input[type="range"] {
  pointer-events: none; /* Disable direct interaction for area/year inputs */
}

/* Bedroom buttons */
.filter-buttons {
  display: flex;
  gap: 6px;
}

.filter-buttons button {
  flex: 1;
  padding: 8px 2px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #555;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-buttons button:hover {
  background-color: #f5f5f5;
}

.filter-buttons button.active {
  background-color: var(--slider-color);
  color: white;
  border-color: var(--slider-color);
}

/* Year chart and slider */
.year-chart {
  height: 50px;
  margin-bottom: 0;
}

.bar-graph {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 100%;
  padding: 0 5px;
}

.year-bar {
  width: 12px;
  background-color: #8cc472;
  border-radius: 2px 2px 0 0;
}

.year-slider {
  margin-bottom: 15px;
}

.year-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #777;
  margin: 5px 0;
}

/* Filter action buttons */
.filter-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.btn-apply, 
.btn-reset {
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-apply {
  background-color: var(--xburg-purple);
  color: white;
  flex: 2;
}

.btn-reset {
  background-color: #eee;
  color: #666;
  flex: 1;
}

.btn-apply:hover {
  background-color: #381e66;
}

.btn-reset:hover {
  background-color: #ddd;
}

.map-container {
  flex: 1;
  position: relative;
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  height: 500px;
  min-height: 500px;
  margin-top: 12px;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.insights-bubble {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.insights-label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  color: #555;
}

/* Responsive Design */
@media (max-width: 1024px) {
  /* App-container styles moved to fullscreen.css */
  
  /* Update responsive chat panel styles */
  .chat-panel {
    width: 100%;
    height: 50vh;
    border-radius: 0;
  }
  
  .map-panel {
    height: 50vh;
  }
}

@media (max-width: 768px) {
  .comparison-overlay {
    padding: 12px;
    bottom: 10px;
    right: 10px;
  }
  
  .comparison-projects {
    flex-direction: row; /* Keep horizontal on mobile for 2 projects */
    gap: 8px;
    justify-content: center;
  }
  
  .project-comparison-card {
    width: 160px; /* Smaller cards for mobile */
    padding: 8px;
  }
  
  .project-comparison-card .project-image {
    height: 100px; /* Smaller image on mobile */
    margin-bottom: 8px;
  }
  
  .project-comparison-card h3.project-name {
    font-size: 13px;
    margin-bottom: 4px;
  }
  
  .project-comparison-card .remove-project {
    width: 20px;
    height: 20px;
    font-size: 14px;
    top: 6px;
    right: 6px;
  }
  
  .comparison-controls {
    gap: 6px;
  }
  
  .comparison-controls .btn-compare {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .chat-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .chat-controls {
    width: 100%;
    justify-content: space-between;
  }
}

.listing-item {
  padding: 15px;
  background-color: white;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.listing-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.listing-price {
  font-size: 1.4rem;
  font-weight: 600;
}

.listing-area {
  font-size: 1.4rem;
  color: #666;
}

@media (max-width: 992px) {
  main {
    flex-direction: column;
  }
  
  .filters-panel {
    flex: 0 0 auto;
  }
}

/* Map Markers and Popups */
.property-marker {
  cursor: pointer;
}

.property-popup {
  background-color: var(--property-color);
  color: white;
  padding: 5px 10px;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.property-price {
  font-size: 0.9rem;
  font-weight: 700;
}

/* Project marker styling */
.project-marker {
  cursor: pointer;
  z-index: 1; /* Lower z-index so popups can appear on top */
}

/* Project marker bubble - only targeting the name bubble on map */
.project-marker .project-popup {
  background-color: var(--project-color);
  color: white;
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  min-width: 120px;
  text-align: center;
}

.project-marker .project-name {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ensure mapbox popups have higher z-index than markers */
.mapboxgl-popup {
  z-index: 2 !important; /* Higher z-index than markers */
}

/* Project popup styling - specifically scoped to project popups */
.mapboxgl-popup.project-popup .mapboxgl-popup-content {
  padding: 0 !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(79, 15, 135, 0.15);
  max-width: 300px;
}

.mapboxgl-popup.project-popup .mapboxgl-popup-close-button {
  font-size: 18px;
  color: white;
  background: rgba(79, 15, 135, 0.5);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  right: 8px;
  top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  transition: background 0.2s ease;
}

.mapboxgl-popup.project-popup .mapboxgl-popup-close-button:hover {
  background: var(--xburg-purple);
}

/* Project popup content styling */
.popup-content.project-popup-content {
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

.popup-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.popup-content h3 {
  margin-top: 8px;
  color: var(--project-color);
  font-size: 18px;
  font-weight: 600;
  margin: 12px 16px 8px;
}

.project-details {
  margin: 10px 0;
  padding: 0 16px;
}

.project-details p {
  margin: 6px 0;
  font-size: 14px;
  color: #555;
}

.project-status {
  display: inline-block;
  background-color: rgba(79, 15, 135, 0.1);
  color: var(--project-color);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.project-developer {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 10px;
  padding: 0 16px;
  border-top: 1px solid rgba(79, 15, 135, 0.1);
  padding-top: 10px;
}

.project-actions {
  margin-top: 10px;
  padding: 0 16px 16px;
  text-align: center;
}

.project-actions .details-link {
  display: inline-block;
  padding: 8px 15px;
  background-color: var(--project-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.2s;
}

.project-actions .details-link:hover {
  background-color: #3d0a6b;
}

/* Miscellaneous styles */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}

/* Custom SweetAlert2 styles for XBurg branding */
.xburg-alert.swal2-popup {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(79, 15, 135, 0.3);
}

.xburg-alert .swal2-title {
  color: #4f0f87;
  font-weight: 600;
  font-size: 1.5rem;
}

.xburg-alert .swal2-content {
  color: #333;
  font-size: 1rem;
  line-height: 1.5;
}

.xburg-alert .swal2-confirm {
  background-color: #4f0f87 !important;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.xburg-alert .swal2-confirm:hover {
  background-color: #6b1cb8 !important;
  transform: translateY(-1px);
}

.xburg-alert .swal2-icon.swal2-warning {
  border-color: #f39c12;
  color: #f39c12;
}

.xburg-alert .swal2-icon.swal2-error {
  border-color: #e74c3c;
  color: #e74c3c;
}

.xburg-alert .swal2-icon.swal2-success {
  border-color: #27ae60;
  color: #27ae60;
}

.xburg-alert .swal2-icon.swal2-info {
  border-color: #3498db;
  color: #3498db;
}

/* Mobile-specific SweetAlert2 optimizations */
@media (max-width: 768px) {
  .xburg-alert .swal2-icon.swal2-success {
    width: 60px !important;
    height: 60px !important;
    margin: 10px auto 15px !important;
  }
  
  .xburg-alert .swal2-icon.swal2-success [class^='swal2-success-line'] {
    height: 4px !important;
    background-color: #27ae60 !important;
  }
  
  .xburg-alert .swal2-icon.swal2-success .swal2-success-line-tip {
    top: 26px !important;
    left: 14px !important;
    width: 18px !important;
    transform: rotate(45deg) !important;
  }
  
  .xburg-alert .swal2-icon.swal2-success .swal2-success-line-long {
    top: 22px !important;
    right: 8px !important;
    width: 30px !important;
    transform: rotate(-45deg) !important;
  }
  
  .xburg-alert .swal2-icon.swal2-success .swal2-success-ring {
    border: 4px solid #27ae60 !important;
    box-sizing: content-box;
    top: -0.5em !important;
  }
  
  .xburg-alert.swal2-popup {
    width: 90% !important;
    max-width: 320px !important;
    padding: 20px !important;
    margin: 10px;
  }
  
  .xburg-alert .swal2-title {
    font-size: 1.2rem !important;
    margin-bottom: 10px !important;
  }
  
  .xburg-alert .swal2-content {
    font-size: 0.9rem !important;
    margin: 10px 0 !important;
    line-height: 1.4;
  }
  
  .xburg-alert .swal2-confirm {
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    min-height: 44px; /* Touch-friendly minimum */
  }
  
  .xburg-alert .swal2-icon {
    width: 60px !important;
    height: 60px !important;
    margin: 10px auto 15px !important;
  }
  
  .xburg-alert .swal2-timer-progress-bar {
    height: 3px !important;
  }
}

/* Find Alternative Button Styling */
.alternative-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  text-align: center;
}

.btn-find-alternative {
  background: linear-gradient(135deg, #4f0f87, #6b2d9e);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(79, 15, 135, 0.2);
}

.btn-find-alternative:hover:not(:disabled) {
  background: linear-gradient(135deg, #6b2d9e, #4f0f87);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 15, 135, 0.3);
}

.btn-find-alternative:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(79, 15, 135, 0.2);
}

.btn-find-alternative:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-find-alternative i {
  font-size: 13px;
}

.btn-find-alternative .fa-spinner {
  animation: spin 1s linear infinite;
}

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

/* Mobile responsiveness for Find Alternative buttons */
@media (max-width: 768px) {
  .btn-find-alternative {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    min-height: 44px; /* Touch-friendly */
  }
  
  .alternative-section {
    margin-top: 12px;
    padding-top: 12px;
  }
}
