/*
 * Deployment Sites Dashboard Styles
 * Modern layout using CSS Grid and Flexbox
 */

/* Main container using modern layout */
.deployment-sites-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Map section */
.map-section {
  width: 100%;
  height: 600px;
}

.map-holder {
  position: relative;
  height: 100%;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.map {
  height: 100%;
  width: 100%;
}

/* Popup styling */
.deployment-popup .mapboxgl-popup-content {
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: none;
    max-width: 250px;
}

.deployment-popup .mapboxgl-popup-tip {
    border-top-color: #ffffff;
}

/* Popup content */
/* TODO Copied from deployment-map.css, delete what we don't need after updating the popups. */
.popup-content {
    text-align: center;
}

.popup-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
}

.popup-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3b82f6;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.popup-link:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.popup-link:active {
    transform: translateY(0);
}

/* Stats section with modern centering */
.stats-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Stats grid using Flexbox for proper responsive grouping */
.deployment-sites-stats-holder {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  max-width: 1000px;
  width: 100%;
}

.stat-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 120px;
  flex: 1;
}

.stat-group img {
  height: 70px;
  margin: 15px 0;
  transition: transform 0.2s ease;
}

.stat-group img:hover {
  transform: scale(1.05);
}

.deployment-sites-stats-header {
  font-size: 30px;
  font-family: raleway-extrabold, sans-serif;
  color: #2c3e50;
  line-height: 1.2;
  margin-bottom: auto; /* Push to top, icon and stat to bottom */
}

.deployment-sites-stats-stat {
  font-size: 30px;
  font-family: raleway, 'Open Sans', 'Noto Sans', sans-serif;
  color: #34495e;
  font-weight: 600;
}

/* Loading screen styles */
.loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #78B9AB;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive design using modern CSS */
@media (max-width: 768px) {
  .deployment-sites-container {
    padding: 10px 15px;
    gap: 20px;
  }

  .map-section {
    height: 400px;
  }

  .deployment-sites-stats-holder {
    gap: 25px;
  }

  .stat-group {
    min-width: 100px;
  }

  .deployment-sites-stats-header {
    font-size: 20px;
  }

  .deployment-sites-stats-stat {
    font-size: 22px;
  }

  .stat-group img {
    height: 50px;
    margin: 10px 0;
  }
}

@media (max-width: 480px) {
  .deployment-sites-container {
    padding: 10px;
    gap: 15px;
  }

  .map-section {
    height: 300px;
  }

  .deployment-sites-stats-holder {
    gap: 20px;
  }

  .stat-group {
    min-width: 80px;
  }

  .deployment-sites-stats-header {
    font-size: 16px;
  }

  .deployment-sites-stats-stat {
    font-size: 18px;
  }

  .stat-group img {
    height: 40px;
    margin: 8px 0;
  }
}

/* Very small screens - stack in 2-3 columns */
@media (max-width: 360px) {
  .deployment-sites-stats-holder {
    gap: 15px;
  }

  .stat-group {
    min-width: 70px;
    flex-basis: calc(50% - 15px); /* Force 2 columns on very small screens */
  }

  .deployment-sites-stats-header {
    font-size: 14px;
  }

  .deployment-sites-stats-stat {
    font-size: 16px;
  }

  .stat-group img {
    height: 35px;
    margin: 6px 0;
  }
}

/* Focus states for accessibility */
.stat-group img:focus {
  outline: 2px solid #78B9AB;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .loading-screen {
    display: none;
  }

  .map-section {
    height: 400px;
  }

  .deployment-sites-container {
    max-width: 100%;
    padding: 0;
  }
}
