/* Reset e base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Sidebar */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 350px;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  margin-bottom: 25px;
  text-align: center;
}

.sidebar-header h1 {
  margin: 0 0 10px 0;
  font-size: 28px;
  font-weight: 700;
}

.sidebar-header p {
  margin: 0 0 15px 0;
  opacity: 0.9;
  font-size: 16px;
}

/* Language switcher */
.language-switcher {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 15px;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 50px;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.lang-btn.active {
  background: white;
  color: #667eea;
  border-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Roma Matches Button */
.roma-matches-section {
  margin: 20px 0;
  text-align: center;
}

.roma-btn {
  background: linear-gradient(135deg, #8B0000, #DC143C);
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.roma-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 0, 0, 0.4);
  background: linear-gradient(135deg, #A00000, #FF1744);
}

.roma-women-btn {
  background: linear-gradient(135deg, #8B008B, #DA70D6);
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(139, 0, 139, 0.3);
  margin-top: 10px;
}

.roma-women-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 0, 139, 0.4);
  background: linear-gradient(135deg, #9932CC, #FF69B4);
}

.roma-icon {
  font-size: 16px;
}

.roma-text {
  font-weight: bold;
}

#sidebar h2 {
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: bold;
}

#sidebar p {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* Map Provider Toggle */
.map-toggle {
  margin-bottom: 20px;
}

.toggle-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 15px;
  margin-right: 5px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.toggle-btn.active {
  background: white;
  color: #667eea;
  border-color: white;
  font-weight: bold;
}

/* Category Filter */
.category-filter {
  margin-bottom: 20px;
}

.category-filter h3 {
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: 600;
}

#category-select {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: white;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#category-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Places Counter */
.places-counter {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

/* Map Containers */
.map-container {
  flex: 1;
  height: 100vh;
  display: none;
}

.map-container.active {
  display: block;
}

#mapbox-map, #google-map {
  width: 100%;
  height: 100%;
}

/* Legacy map support */
#map {
  flex: 1;
  height: 100vh;
}

/* Popup personalizzazione */
.mapboxgl-popup-content {
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border: none;
  max-width: 300px;
}

.mapboxgl-popup-content b {
  color: #333;
  font-size: 16px;
}

.popup-content {
  padding: 5px;
}

.popup-content h3 {
  color: #333;
  font-size: 18px;
  margin-bottom: 8px;
  font-weight: bold;
}

.popup-content p {
  color: #666;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 5px;
}

.popup-content p strong {
  color: #333;
  font-weight: 600;
}

/* Google Maps Info Window Styling */
.gm-style .gm-style-iw-c {
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gm-style .gm-style-iw-d {
  overflow: hidden !important;
}

/* Marker personalizzazione */
.mapboxgl-marker {
  cursor: pointer;
}

/* Category Color Legend */
.category-legend {
  margin-top: 15px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Loading States */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  background: #f5f5f5;
  color: #666;
  font-size: 16px;
}

/* Roma Matches Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  background: linear-gradient(135deg, #8B0000, #DC143C);
  color: white;
  padding: 20px;
  position: relative;
  text-align: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
}

.close {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.close:hover {
  opacity: 0.7;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #8B0000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.match-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid #8B0000;
  transition: transform 0.2s, box-shadow 0.2s;
}

.match-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.match-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.match-date .date {
  font-weight: bold;
  color: #333;
}

.match-date .time {
  background: #8B0000;
  color: white;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.team {
  display: flex;
  align-items: center;
  flex: 1;
}

.team-logo {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50%;
}

.team-name {
  font-weight: bold;
  color: #333;
}

.vs {
  font-weight: bold;
  color: #8B0000;
  margin: 0 15px;
  font-size: 14px;
}

.match-venue {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666;
}

.venue {
  font-style: italic;
}

.competition {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
  color: #495057;
}

.no-matches {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 40px;
}

.api-note {
  text-align: center;
  margin-top: 20px;
  padding: 10px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 5px;
  color: #856404;
  font-size: 12px;
}

.error {
  text-align: center;
  color: #dc3545;
  padding: 40px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  
  #sidebar {
    width: 100%;
    height: auto;
    padding: 15px;
    max-height: 40vh;
  }
  
  #sidebar h2 {
    font-size: 20px;
  }
  
  #sidebar p {
    font-size: 12px;
  }
  
  .map-container {
    height: 60vh;
  }
  
  #map {
    height: calc(100vh - 40vh);
  }
  
  .toggle-btn {
    padding: 8px 12px;
    font-size: 12px;
    margin-right: 3px;
  }
  
  .category-filter h3 {
    font-size: 14px;
  }
  
  #category-select {
    padding: 8px;
    font-size: 12px;
  }
  
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .match-teams {
    flex-direction: column;
    gap: 10px;
  }
  
  .vs {
    margin: 0;
  }
  
  .match-venue {
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
  }
}

/* Controlli mappa */
.mapboxgl-ctrl-group {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: none;
}

.mapboxgl-ctrl-group button {
  border-radius: 8px;
  border: none;
}

/* Enhanced marker styling */
.mapboxgl-marker {
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

/* Custom scrollbar for sidebar */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
