/* ============================================================
   POPUP STATISTIQUES PÔLES COMMERCIAUX
   Phase 2.4.3
   ============================================================ */

.pole-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.pole-popup {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pole-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.pole-popup-header h3 {
  margin: 0;
  font-size: 20px;
  color: #1f2937;
}

.pole-popup-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.pole-popup-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.pole-popup-content {
  padding: 24px;
}

/* Infos générales */
.pole-info-section {
  margin-bottom: 20px;
}

.pole-info-item {
  padding: 8px 0;
  color: #4b5563;
  font-size: 14px;
}

.pole-info-item strong {
  color: #1f2937;
  margin-right: 8px;
}

/* KPI Cards */
.pole-stats-kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid #dee2e6;
}

.kpi-card.kpi-completion {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #93c5fd;
}

.kpi-card.kpi-vacance {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #fca5a5;
}

.kpi-card.kpi-diversite {
  background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
  border-color: #c084fc;
}

.kpi-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 4px;
}

.kpi-detail {
  font-size: 11px;
  color: #9ca3af;
}

/* Interprétation visuelle diversité */
.kpi-interpretation {
  font-size: 10px;
  font-weight: 600;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-block;
}

.kpi-interpretation.faible {
  background: #fee2e2;
  color: #991b1b;
}

.kpi-interpretation.moyenne {
  background: #fef3c7;
  color: #92400e;
}

.kpi-interpretation.bonne {
  background: #d1fae5;
  color: #065f46;
}

.kpi-interpretation.excellente {
  background: #dbeafe;
  color: #1e40af;
}

/* Indice secondaire (Simpson) */
.kpi-secondary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 11px;
}

.kpi-secondary-label {
  color: #6b7280;
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-secondary-value {
  color: #1f2937;
  font-weight: 700;
  font-size: 16px;
  margin-top: 2px;
}

/* Tooltip */
.kpi-tooltip {
  position: relative;
  cursor: help;
}

.kpi-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 400;
  white-space: normal;
  width: 220px;
  text-align: left;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
  text-transform: none;
}

.kpi-tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
  z-index: 1001;
}

/* Profil marchand */
.pole-profil-section {
  margin-bottom: 24px;
}

.pole-profil-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #1f2937;
  font-weight: 600;
}

.profil-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profil-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profil-bar-label {
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}

.profil-bar-container {
  position: relative;
  height: 24px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.profil-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  transition: width 0.3s ease;
}

.profil-bar-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #1f2937;
  z-index: 1;
}

/* Répartition statuts */
.pole-status-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #1f2937;
  font-weight: 600;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.status-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.status-count {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
}

.status-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 640px) {
  .pole-popup {
    width: 95%;
    max-height: 90vh;
  }
  
  .pole-stats-kpi {
    grid-template-columns: 1fr;
  }
  
  .kpi-value {
    font-size: 24px;
  }
  
  .status-grid {
    grid-template-columns: 1fr;
  }
}
