/**
 * @file
 * LINCS Theme - Map Styles
 * 
 * Stili per la mappa interattiva Leaflet.
 */

/* ========================================
   MAP CONTAINER
   ======================================== */

.map-section {
  padding: var(--space-16) 0;
  background-color: var(--bg-secondary);
}

.map-container {
  background: var(--bg-primary);
  border-radius: var(--border-radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.map-wrapper {
  position: relative;
  height: 500px;
  background: linear-gradient(135deg, #E8F4F8 0%, #D4E8ED 100%);
}

@media (min-width: 1024px) {
  .map-wrapper {
    height: 600px;
  }
}

/* ========================================
   LEAFLET CUSTOMIZATION
   ======================================== */

.leaflet-container {
  font-family: var(--font-sans);
}

.leaflet-popup-content-wrapper {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: var(--space-4);
  font-family: var(--font-sans);
}

.leaflet-popup-content h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.leaflet-popup-content p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.leaflet-popup-content a {
  color: var(--sapienza-bordeaux);
  font-weight: var(--font-weight-medium);
}

/* Custom Marker */
.leaflet-marker-icon {
  transition: transform var(--transition-fast);
}

.leaflet-marker-icon:hover {
  transform: scale(1.1);
}

/* ========================================
   MAP CONTROLS
   ======================================== */

.map-controls {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 400;
}

.map-control {
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.map-control:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

.map-control svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

/* ========================================
   MAP LEGEND
   ======================================== */

.map-legend {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: var(--border-radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-md);
  z-index: 400;
}

.map-legend__title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.map-legend__items {
  display: flex;
  gap: var(--space-4);
}

.map-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.map-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.map-legend__dot--primary {
  background-color: var(--sapienza-bordeaux);
}

.map-legend__dot--secondary {
  background-color: var(--accent-gold);
}

/* ========================================
   MAP SIDEBAR
   ======================================== */

.map-sidebar {
  background: var(--bg-primary);
  border-left: 1px solid var(--border-light);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.map-sidebar__header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-light);
}

.map-sidebar__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.map-sidebar__count {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

.map-sidebar__list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

@media (min-width: 1024px) {
  .map-sidebar__list {
    max-height: 500px;
  }
}

.map-location {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 4px solid transparent;
}

.map-location:hover {
  background-color: var(--bg-secondary);
}

.map-location--active {
  background-color: rgba(var(--sapienza-bordeaux-rgb), 0.05);
  border-left-color: var(--sapienza-bordeaux);
}

.map-location__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.map-location__name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.map-location__name svg {
  width: 16px;
  height: 16px;
  color: var(--sapienza-bordeaux);
}

.map-location__type {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.map-location__count {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background-color: rgba(var(--sapienza-bordeaux-rgb), 0.1);
  color: var(--sapienza-bordeaux);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--border-radius-full);
}

.map-sidebar__footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-light);
}

/* ========================================
   MAP GRID LAYOUT
   ======================================== */

.map-grid {
  display: grid;
}

@media (min-width: 1024px) {
  .map-grid {
    grid-template-columns: 2fr 1fr;
  }
}
