* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e); /* Fond spatial */
  color: #f0f0f0;
  line-height: 1.6;
}

header {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(15px);
  color: white;
  text-align: center;
  padding: 10px 20px;
  position: relative;
  z-index: 10;
  border: none;
  max-width: 1500px;
  margin: 0 auto;
  border-radius: 0 0 20px 20px;
}


header h1 {
  color: #ffcc33;
  font-size: 2.8rem;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(255, 204, 51, 0.5);
}

header p {
  font-size: 1.1rem;
  color: #ccc;
  margin-bottom: 15px;
}

header nav {
  margin-top: 15px;
}

.btn {
  display: inline-block;
  background: #ff6b6b;
  color: white;
  padding: 10px 25px;
  text-decoration: none;
  border-radius: 25px;
  margin: 5px;
  transition: 0.3s;
  font-weight: bold;
}

.btn:hover {
  background: #ee5a52;
  transform: scale(1.05);
}

.btn.active {
  background: #ffcc33;
  color: #2d3436;
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(255, 204, 51, 0.6);
  font-weight: bold;
}

.btn.active:hover {
  background: #ffd700;
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(255, 204, 51, 0.8);
}

/* Sélecteur de langue */
.language-selector {
  margin-bottom: 15px;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid #ffcc33;
  padding: 8px 20px;
  margin: 0 5px;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: bold;
}

.lang-btn:hover {
  background: rgba(255, 204, 51, 0.3);
}

.lang-btn.active {
  background: #ffcc33;
  color: #2d3436;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Hero Section */
.hero-members {
  text-align: center;
  margin-bottom: 50px;
}

.hero-members h1 {
  font-size: 3rem;
  color: #ffcc33;
  margin-bottom: 15px;
  text-shadow: 0 0 30px rgba(255, 204, 51, 0.3);
}

.subtitle {
  font-size: 1.3rem;
  color: #ccc;
  margin-bottom: 40px;
}

/* Stats Container */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
  max-width: 900px;
  margin: 0 auto;
}

.stat-box {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 20px;
  border: 2px solid rgba(255, 204, 51, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: 0.3s;
}

.stat-box:hover {
  transform: translateY(-10px);
  border-color: #ffcc33;
  box-shadow: 0 15px 40px rgba(255, 204, 51, 0.3);
}

.stat-number {
  font-size: 3rem;
  font-weight: bold;
  color: #ffcc33;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 1rem;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Globe Section */
.globe-section {
  position: relative;
  margin: 50px 0;
  min-height: 600px;
}

#globeViz {
  width: 100%;
  height: 600px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.globe-instructions {
  text-align: center;
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.globe-instructions p {
  margin: 5px 0;
  color: #ffcc33;
  font-size: 0.95rem;
}

/* Map Alternative View */
.map-alternative {
  padding: 50px 0;
}

.map-alternative h2 {
  text-align: center;
  color: #ffcc33;
  font-size: 2.5rem;
  margin-bottom: 40px;
}

.country-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.country-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
  border: 2px solid rgba(255, 204, 51, 0.2);
}

.country-card:hover {
  transform: translateY(-15px);
  border-color: #ffcc33;
  box-shadow: 0 20px 50px rgba(255, 204, 51, 0.3);
}

.country-flag {
  font-size: 5rem;
  margin-bottom: 20px;
}

.country-card h3 {
  color: #ffcc33;
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.country-count {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.count-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
}

.count-label {
  font-size: 0.9rem;
  color: #ccc;
  text-transform: uppercase;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
}

.modal[style*="display: flex"] {
  animation: fadeIn 0.3s ease-in-out;
}

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

.modal-content {
  background: linear-gradient(135deg, #1e1e2e, #2d2d44);
  margin: auto 50px;
  padding: 50px;
  max-width: 1100px;
  border-radius: 25px;
  box-shadow: 0 20px 80px rgba(255, 204, 51, 0.3);
  border: 3px solid #ffcc33;
  animation: slideDown 0.3s ease-out;
  position: relative;
  max-height: calc(100vh - 100px);
  overflow: auto;
  scrollbar-width: none;
}

.modal-content::-webkit-scrollbar {
  display: none;
}

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

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #ffcc33;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.modal-close:hover {
  color: #ff6b6b;
  transform: scale(1.2) rotate(90deg);
}

#modal-country-name {
  color: #ffcc33;
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-align: center;
}

.modal-subtitle {
  text-align: center;
  color: #ccc;
  font-size: 1.2rem;
  margin-bottom: 40px;
}

/* Members Grid */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.member-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
  border: 2px solid rgba(255, 204, 51, 0.3);
}

.member-card:hover {
  transform: translateY(-10px);
  border-color: #ffcc33;
  box-shadow: 0 15px 40px rgba(255, 204, 51, 0.4);
}

.member-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
  border: 4px solid #ffcc33;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.member-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.3s;
}

.member-card:hover .member-image img {
  transform: scale(1.1);
}

.member-card h3 {
  color: #ffcc33;
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.member-role {
  color: #ccc;
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 15px;
}

.member-description {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Country Mission */
.country-mission {
  background: rgba(255, 204, 51, 0.1);
  padding: 30px;
  border-radius: 15px;
  border-left: 5px solid #ffcc33;
}

.country-mission h3 {
  color: #ffcc33;
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.country-mission p {
  color: #ddd;
  line-height: 1.8;
  font-size: 1.1rem;
}

/* Modal Detail */
.modal-detail .modal-content {
  max-width: 800px;
  padding: 80px 50px 50px 50px;
  max-height: calc(100vh - 100px);
  overflow: auto;
}

.modal-close {
  position: absolute;
  top: 30px; /* Plus d'espace depuis le haut */
  right: 30px;
  color: #ffcc33;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  z-index: 10; /* Pour qu'il reste au-dessus */
}

.member-detail-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 20px;
}

.member-detail-image {
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 25px;
  overflow: hidden;
  border: 6px solid #ffcc33;
  box-shadow: 0 20px 60px rgba(255, 204, 51, 0.4), inset 0 0 30px rgba(255, 204, 51, 0.1);
  background: rgba(0, 0, 0, 0.5);
  margin: 0 auto 30px;
}

.member-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Affiche toute l'image */
  display: block;
}

.member-detail-info h2 {
  color: #ffcc33;
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.member-detail-role {
  color: #ff6b6b;
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.member-detail-location {
  color: #ccc;
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.member-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.member-stat {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
}

.member-stat .stat-label {
  display: block;
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.member-stat .stat-value {
  display: block;
  color: #ffcc33;
  font-size: 1.5rem;
  font-weight: bold;
}

.member-bio,
.member-achievements {
  margin-bottom: 30px;
}

.member-bio h3,
.member-achievements h3 {
  color: #ffcc33;
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.member-bio p {
  color: #ddd;
  line-height: 1.8;
  font-size: 1.05rem;
}

.member-achievements ul {
  list-style: none;
  padding: 0;
}

.member-achievements li {
  background: rgba(255, 204, 51, 0.1);
  padding: 12px 20px;
  margin: 10px 0;
  border-left: 4px solid #ffcc33;
  border-radius: 8px;
  color: #ddd;
}

.member-achievements li::before {
  content: "🏆 ";
  margin-right: 10px;
}

.btn-toggle {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 40px;
  font-size: 1.2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  font-weight: bold;
}

.btn-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.btn-delete {
  background: #ff4757;
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: 0.3s;
  box-shadow: 0 10px 25px rgba(255, 71, 87, 0.3);
}

.btn-delete:hover {
  background: #ff3838;
  transform: scale(1.05);
  box-shadow: 0 15px 35px rgba(255, 71, 87, 0.5);
}

/* Styles du formulaire d'ajout de membre */
#addMemberModal .modal-content {
  max-width: 700px;
  padding: 40px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #ffcc33;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid rgba(255, 204, 51, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #ffcc33;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 204, 51, 0.3);
}

.form-group textarea {
  resize: vertical;
}

.form-group select {
  cursor: pointer;
}

.form-group select option {
  background: #2d2d44;
  color: #fff;
}

.form-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 30px;
}

.btn-submit,
.btn-cancel {
  padding: 15px 30px;
  font-size: 1.1rem;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: bold;
}

.btn-submit {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  box-shadow: 0 10px 30px rgba(17, 153, 142, 0.4);
}

.btn-submit:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(17, 153, 142, 0.6);
}

.btn-cancel {
  background: #ff6b6b;
  color: white;
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

.btn-cancel:hover {
  background: #ee5a52;
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(255, 107, 107, 0.6);
}

/* Footer */
footer {
  background: rgba(0, 0, 0, 0.9);
  color: white;
  text-align: center;
  padding: 30px 20px;
  margin-top: 60px;
}

.footer-tagline {
  color: #ffcc33;
  font-style: italic;
  font-size: 0.95rem;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-members h1 {
    font-size: 2rem;
  }

  .stats-container {
    grid-template-columns: 1fr;
  }

  #globeViz {
    height: 400px;
  }

  .modal-detail .modal-content {
    padding: 40px 20px 20px 20px;
    max-width: 95vw;
    max-height: calc(100vh - 80px);
  }

  .member-detail-content {
    grid-template-columns: 1fr;
  }

  .member-detail-image {
    width: 220px;
    height: 220px;
  }

  .member-stats {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 30px 20px;
    margin: auto 20px;
    max-width: 95vw;
    max-height: calc(100vh - 80px);
  }

  .form-buttons {
    grid-template-columns: 1fr;
  }

  .country-cards {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.btn-edit {
  background: #00b894;
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: 0.3s;
  box-shadow: 0 10px 25px rgba(0, 184, 148, 0.3);
  margin-right: 10px;
}

.btn-edit:hover {
  background: #00a085;
  transform: scale(1.05);
  box-shadow: 0 15px 35px rgba(0, 184, 148, 0.5);
}

/* Fond cosmique avec particules */
#particles-js {
  position: fixed; /* Pour qu’il reste en fond, même au scroll */
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1; /* Derrière tout le contenu */
  background: transparent;
}


/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #ff6b6b, #ffcc33);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #ffcc33, #ff6b6b);
}

/* Style pour l'indication cliquable des agents */
.click-hint-agent {
  text-align: center;
  margin: 20px 0 30px 0;
  padding: 15px;
  background: rgba(102, 126, 234, 0.1);
  border: 2px dashed #667eea;
  border-radius: 15px;
  animation: glow-border-agent 2s infinite alternate;
}

.click-hint-agent-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.click-hint-agent-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: #667eea;
}

.click-arrow-agent {
  font-size: 2rem;
  animation: bounce-agent 1.5s infinite;
}

@keyframes glow-border-agent {
  0% { border-color: #667eea; box-shadow: 0 0 10px rgba(102, 126, 234, 0.3); }
  100% { border-color: #764ba2; box-shadow: 0 0 20px rgba(118, 75, 162, 0.5); }
}

@keyframes bounce-agent {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* Amélioration visuelle des cartes d'agents pour mieux indiquer qu'elles sont cliquables */
.member-card {
  position: relative;
  overflow: hidden;
}

.member-card::after {
  content: "👆Voir le profil👆";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(102, 126, 234, 0.9);
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.member-card:hover::after {
  transform: translateY(0);
}

/* Bouton Retour en haut - Version Chat */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ff6b6b, #ffcc33);
  color: #2d3436;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 5px 25px rgba(255, 107, 107, 0.5);
  transition: all 0.3s ease;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.back-to-top:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 35px rgba(255, 204, 51, 0.7);
  background: linear-gradient(135deg, #ffcc33, #ff6b6b);
}

.back-to-top:hover::after {
  content: "🐱";
  position: absolute;
  font-size: 20px;
}

.back-to-top:active {
  transform: translateY(0) scale(0.95);
}

.back-to-top.show {
  display: flex;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}