/**
 * POPUP SÉLECTEUR DE PROFIL
 * Design moderne et discret pour la première visite
 */

/* Overlay du popup */
.profile-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 28, 60, 0.85);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Container du popup */
.profile-popup {
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9) translateY(20px);
  animation: popupIn 0.4s ease-out 0.1s forwards;
}

@keyframes popupIn {
  to {
    transform: scale(1) translateY(0);
  }
}

/* Header du popup */
.profile-popup-header {
  text-align: center;
  padding: 2.5rem 2rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.profile-popup-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--color-red-primary, #E4032E);
}

.profile-popup-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-blue-primary, #041C3C);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.profile-popup-subtitle {
  font-size: 1rem;
  color: #666;
  font-weight: 400;
}

/* Bouton de fermeture */
.profile-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.profile-popup-close:hover {
  background: #f5f5f5;
  color: #333;
  transform: rotate(90deg);
}

/* Corps du popup */
.profile-popup-body {
  padding: 2rem;
}

/* Grille des profils */
.profile-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Carte de profil compacte */
.profile-card-compact {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.profile-card-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-red-primary, #E4032E);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.profile-card-compact:hover {
  border-color: var(--color-red-primary, #E4032E);
  box-shadow: 0 8px 24px rgba(228, 3, 46, 0.15);
  transform: translateY(-4px);
}

.profile-card-compact:hover::before {
  transform: scaleX(1);
}

.profile-card-compact:focus {
  outline: 3px solid var(--color-red-primary, #E4032E);
  outline-offset: 2px;
}

/* Icône du profil */
.profile-icon-compact {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

/* Titre du profil */
.profile-title-compact {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-blue-primary, #041C3C);
  margin-bottom: 0.5rem;
}

/* Description du profil */
.profile-desc-compact {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.4;
}

/* État de sélection */
.profile-card-compact.selecting {
  border-color: var(--color-red-primary, #E4032E);
  background: linear-gradient(135deg, rgba(228, 3, 46, 0.05) 0%, rgba(4, 28, 60, 0.05) 100%);
  transform: scale(0.95);
}

.profile-card-compact.selecting::before {
  transform: scaleX(1);
}

/* Footer du popup */
.profile-popup-footer {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  border-radius: 0 0 24px 24px;
}

.profile-skip-btn {
  background: transparent;
  border: 1px solid #ccc;
  color: #666;
  padding: 0.625rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-skip-btn:hover {
  border-color: #999;
  color: #333;
  background: white;
}

.profile-footer-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #999;
}

/* Animation de fermeture */
.profile-popup-overlay.closing {
  animation: fadeOut 0.3s ease-out forwards;
}

.profile-popup-overlay.closing .profile-popup {
  animation: popupOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  to { opacity: 0; }
}

@keyframes popupOut {
  to {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .profile-popup {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }
  
  .profile-popup-header {
    padding: 2rem 1.5rem 1rem;
  }
  
  .profile-popup-title {
    font-size: 1.5rem;
  }
  
  .profile-popup-body {
    padding: 1.5rem;
  }
  
  .profile-grid-compact {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  
  .profile-card-compact {
    padding: 1.25rem;
  }
  
  .profile-icon-compact {
    font-size: 2rem;
  }
  
  .profile-title-compact {
    font-size: 1rem;
  }
  
  .profile-desc-compact {
    font-size: 0.8125rem;
  }
}

/* Scrollbar personnalisée pour le popup */
.profile-popup::-webkit-scrollbar {
  width: 8px;
}

.profile-popup::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.profile-popup::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.profile-popup::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Masqué par défaut */
.profile-popup-overlay.hidden {
  display: none;
}

/* Animations de chargement */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.profile-card-compact.loading {
  animation: pulse 1s ease-in-out infinite;
  pointer-events: none;
}
