/* 
 * BERLIN IMMOBILIEN - Interactive Map Styles
 * Styles for the interactive property map feature
 */

/* ===== MAP CONTAINER ===== */
.map-container {
  width: 100%;
  height: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  margin-bottom: var(--spacing-xl);
}

/* Map wrapper to ensure proper sizing */
.map-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

/* The actual map element */
#property-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ===== MAP CONTROLS ===== */
.map-controls {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.map-control-button {
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  color: var(--neutral-700);
  border: none;
}

.map-control-button:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ===== MAP FILTERS ===== */
.map-filters-container {
  position: absolute;
  top: var(--spacing-md);
  left: var(--spacing-md);
  z-index: 2;
  width: 300px;
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform var(--transition-normal);
}

.map-filters-header {
  padding: var(--spacing-md);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.map-filters-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.map-filters-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-filters-body {
  padding: var(--spacing-md);
  max-height: 400px;
  overflow-y: auto;
}

.map-filters-section {
  margin-bottom: var(--spacing-md);
}

.map-filters-section:last-child {
  margin-bottom: 0;
}

.map-filters-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--neutral-700);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.map-filter-group {
  margin-bottom: var(--spacing-sm);
}

.map-filter-label {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--neutral-700);
  cursor: pointer;
}

.map-filter-checkbox {
  margin-right: var(--spacing-xs);
}

.map-price-range {
  margin-top: var(--spacing-sm);
}

.map-price-inputs {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xs);
}

.map-price-input {
  flex: 1;
  position: relative;
}

.map-price-input input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 1.5rem;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.map-price-input::before {
  content: '€';
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-600);
}

.map-filters-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--neutral-200);
  display: flex;
  justify-content: space-between;
}

.map-filters-reset {
  background: none;
  border: none;
  color: var(--neutral-600);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.map-filters-reset:hover {
  color: var(--secondary-red);
}

.map-filters-apply {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.map-filters-apply:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Collapsed state */
.map-filters-container.collapsed {
  transform: translateX(-290px);
}

.map-filters-container.collapsed .map-filters-toggle {
  transform: rotate(180deg);
}

/* ===== MAP MARKERS ===== */
.map-marker {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.map-marker:hover {
  transform: rotate(-45deg) scale(1.1);
  box-shadow: var(--shadow-lg);
}

.map-marker::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-marker-content {
  position: relative;
  z-index: 1;
  transform: rotate(45deg);
  color: var(--primary-violet);
  font-weight: 700;
  font-size: 0.875rem;
}

.map-marker-residential {
  background: linear-gradient(135deg, var(--primary-turquoise), var(--primary-violet));
}

.map-marker-commercial {
  background: linear-gradient(135deg, var(--secondary-yellow), var(--primary-violet));
}

.map-marker-featured {
  background: linear-gradient(135deg, var(--secondary-red), var(--primary-violet));
}

.map-marker-featured::before {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  background-color: var(--secondary-red);
  border-radius: 50%;
  border: 2px solid white;
  z-index: 2;
}

/* ===== MAP POPUP ===== */
.map-popup {
  width: 280px;
  background-color: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.map-popup-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.map-popup-content {
  padding: var(--spacing-md);
}

.map-popup-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: var(--spacing-xs);
}

.map-popup-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.map-popup-address {
  font-size: 0.875rem;
  color: var(--neutral-600);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
}

.map-popup-address i {
  margin-right: var(--spacing-xs);
  color: var(--primary-turquoise);
}

.map-popup-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-violet);
  margin-bottom: var(--spacing-sm);
}

.map-popup-features {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}

.map-popup-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  color: var(--neutral-600);
}

.map-popup-feature i {
  margin-bottom: 2px;
  color: var(--primary-turquoise);
}

.map-popup-link {
  display: block;
  text-align: center;
  padding: var(--spacing-sm);
  background-color: var(--neutral-100);
  color: var(--primary-violet);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  border-top: 1px solid var(--neutral-200);
}

.map-popup-link:hover {
  background: var(--gradient-primary);
  color: white;
}

/* ===== MAP LEGEND ===== */
.map-legend {
  position: absolute;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  background-color: white;
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: var(--shadow-md);
  z-index: 2;
  display: flex;
  gap: var(--spacing-md);
}

.map-legend-item {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--neutral-700);
}

.map-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: var(--spacing-xs);
}

.map-legend-residential {
  background: linear-gradient(135deg, var(--primary-turquoise), var(--primary-violet));
}

.map-legend-commercial {
  background: linear-gradient(135deg, var(--secondary-yellow), var(--primary-violet));
}

.map-legend-featured {
  background: linear-gradient(135deg, var(--secondary-red), var(--primary-violet));
}

/* ===== MAP SEARCH ===== */
.map-search {
  position: absolute;
  top: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  z-index: 2;
}

.map-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  transition: box-shadow var(--transition-fast);
}

.map-search-input:focus {
  outline: none;
  box-shadow: var(--shadow-lg);
}

.map-search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--primary-violet);
  cursor: pointer;
  font-size: 1rem;
}

/* ===== MAP RESULTS COUNT ===== */
.map-results-count {
  position: absolute;
  bottom: var(--spacing-md);
  left: var(--spacing-md);
  background-color: white;
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: var(--shadow-md);
  z-index: 2;
  font-size: 0.875rem;
  color: var(--neutral-700);
}

.map-results-count strong {
  color: var(--primary-violet);
}

/* ===== MAP LOADING OVERLAY ===== */
.map-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.map-loading-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(120, 115, 245, 0.1);
  border-top-color: var(--primary-violet);
  animation: spin 1s linear infinite;
  margin-bottom: var(--spacing-sm);
}

.map-loading-text {
  font-size: 0.875rem;
  color: var(--neutral-700);
  font-weight: 600;
}

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

/* ===== MAP CLUSTER STYLES ===== */
.map-cluster {
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.map-cluster:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.map-cluster-sm {
  width: 40px;
  height: 40px;
  font-size: 0.875rem;
}

.map-cluster-md {
  width: 50px;
  height: 50px;
  font-size: 1rem;
}

.map-cluster-lg {
  width: 60px;
  height: 60px;
  font-size: 1.125rem;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 991.98px) {
  .map-container {
    height: 500px;
  }
  
  .map-filters-container {
    width: 250px;
  }
  
  .map-filters-container.collapsed {
    transform: translateX(-240px);
  }
  
  .map-search {
    width: 250px;
  }
}

@media (max-width: 767.98px) {
  .map-container {
    height: 400px;
  }
  
  .map-filters-container {
    width: 100%;
    left: 0;
    top: 0;
    border-radius: 0;
    transform: translateY(-100%);
    transition: transform var(--transition-normal);
  }
  
  .map-filters-container.collapsed {
    transform: translateY(-100%);
  }
  
  .map-filters-container.expanded {
    transform: translateY(0);
  }
  
  .map-filters-toggle {
    transform: rotate(90deg);
  }
  
  .map-filters-container.expanded .map-filters-toggle {
    transform: rotate(-90deg);
  }
  
  .map-search {
    width: 200px;
  }
  
  .map-legend {
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
  }
  
  .map-controls {
    flex-direction: row;
  }
}

@media (max-width: 575.98px) {
  .map-container {
    height: 350px;
  }
  
  .map-search {
    width: 180px;
  }
  
  .map-popup {
    width: 220px;
  }
  
  .map-popup-img {
    height: 120px;
  }
  
  .map-results-count,
  .map-legend {
    font-size: 0.75rem;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .map-container {
    height: 400px;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .map-controls,
  .map-filters-container,
  .map-search,
  .map-legend {
    display: none !important;
  }
}