/* ========================================
   COULEURS ET VARIABLES
   ======================================== */
:root {
  --bg-dark:  #4a4a4f;
  --bg-darker: rgba(5, 5, 10, 0.92);
  --accent-green: #00ff88;
  --accent-red: #ff3333;
  --accent-blue: #00a2ff;
  --accent-purple: #9b59b6;
  --text-primary: #e0e0e0 ;
  --text-secondary: #a0a0a0;
  --border-color: #333;
}

/* ========================================
   BASE & TYPOGRAPHIE
   ======================================== */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-image: url('/images/lucid.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 2em;
}

/* Titres adaptatifs */
h1 { font-size: 2.2rem; margin-bottom: 0.5em; color: var(--accent-blue); }
h2 { font-size: 1.8rem; margin-bottom: 0.5em; color: var(--accent-blue); }
h3 { font-size: 1.4rem; margin-bottom: 0.5em; color: var(--accent-blue); }
h4 { font-size: 1.2rem; margin-bottom: 0.5em; color: var(--accent-blue); }

@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.2rem; }
}

/* ========================================
   NAVIGATION (Responsive)
   ======================================== */
.navbar {
  background-color: var(--bg-darker);
  padding: 1em 2em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.logo {
  height: 80px;
  width: 80px;
  vertical-align: middle;
  transition: opacity 0.3s ease;
}

.logo:hover { opacity: 0.8; }

.navbar h1 { display: none; }

.nav-links {
  display: flex;
  gap: 1em;
  align-items: center;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--accent-blue);
  border-radius: 2px;
}

/* ========================================
   COMPOSANTS (Cartes, Boutons, Alertes)
   ======================================== */
.card {
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2em;
  margin: 1.5em auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  max-width: 1200px;
  width: 90%;
}

.btn {
  padding: 0.8em 1.5em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-primary { background-color: var(--accent-blue); color: white; }
.btn-success { background-color: var(--accent-green); color: var(--bg-dark); }
.btn-danger { background-color: var(--accent-red); color: white; }

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.alert {
  padding: 1em;
  border-radius: 4px;
  margin: 1em 0;
}

.alert-success { background-color: rgba(0, 255, 136, 0.1); border-left: 4px solid var(--accent-green); color: var(--accent-green); }
.alert-danger { background-color: rgba(255, 51, 51, 0.1); border-left: 4px solid var(--accent-red); color: var(--accent-red); }
.alert-info { background-color: rgba(0, 162, 255, 0.1); border-left: 4px solid var(--accent-blue); color: var(--accent-white); }

a { color: var(--accent-purple); text-decoration: none; }
a:hover { text-decoration: underline; }

.glow { transition: box-shadow 0.3s ease; }
.glow:hover { box-shadow: 0 0 10px var(--accent-blue); }

/* ========================================
   GRILLES & LAYOUT
   ======================================== */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5em;
  margin-top: 1.5em;
}

/* Liste de services stylisée */
.service-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5em;
  margin: 2em auto;
  max-width: 1200px;
  width: 90%;
}

/* Style de base pour chaque carte */
.service-item, .service-card {
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5em;
  width: 300px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  min-height: 150px;
}

/* Effet au survol (uniquement si pas actif) */
.service-item:hover, .service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px rgba(0, 162, 255, 0.5);
}

/* ========================================
   MODALES POUR LES CARTES DE SERVICE (CORRIGÉ)
   ======================================== */

/* Le bouton de fermeture est CACHÉ par défaut sur toutes les cartes */
.service-card .close-modal,
.service-item .close-modal {
  display: none;
}

/* Le bouton n'apparaît QUE quand la carte est active (en modale) */
.service-card.active .close-modal,
.service-item.active .close-modal {
  display: block;
}

/* Contenu des cartes masqué par défaut */
.service-content {
  display: none;
  text-align: left;
  margin-top: 1em;
}

/* Style de la carte en mode modale */
.service-card.active,
.service-item.active {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  margin: 0;
  box-shadow: 0 0 30px rgba(0, 162, 255, 0.7);
  border: 2px solid var(--accent-blue);
  border-radius: 12px;
  background-color: var(--bg-darker);
  padding: 2em;
  text-align: left;
  backdrop-filter: blur(10px);
}

/* Affiche le contenu quand la carte est active */
.service-card.active .service-content,
.service-item.active .service-content {
  display: block;
}

/* Scrollbar personnalisée pour la modale */
.service-card.active::-webkit-scrollbar,
.service-item.active::-webkit-scrollbar {
  width: 8px;
}
.service-card.active::-webkit-scrollbar-track,
.service-item.active::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}
.service-card.active::-webkit-scrollbar-thumb,
.service-item.active::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 4px;
}

/* Overlay pour flouter l'arrière-plan */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1999;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: block;
  opacity: 1;
}

/* Style du bouton de fermeture */
.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 2rem;
  color: var(--accent-red);
  cursor: pointer;
  background: none;
  border: none;
  transition: all 0.3s ease;
  line-height: 1;
  padding: 5px;
  z-index: 2001;
}

.close-modal:hover {
  color: white;
  transform: scale(1.2);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  background-color: var(--bg-darker);
  border-top: 1px solid var(--border-color);
  padding: 2em 2em 1em;
  margin-top: 3em;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2em;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section h3 {
  color: var(--accent-blue);
  font-size: 1.1em;
  margin-bottom: 1em;
  border-bottom: 2px solid var(--accent-green);
  padding-bottom: 0.5em;
  display: inline-block;
}

.footer-section p, .footer-section li {
  color: var(--text-secondary);
  font-size: 0.95em;
  line-height: 1.7;
}

.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section li { margin-bottom: 0.5em; }
.footer-section a { color: var(--text-secondary); text-decoration: none; transition: color 0.3s ease; }
.footer-section a:hover { color: var(--accent-green); text-decoration: none; }

.social-links { display: flex; gap: 1em; margin-top: 1em; }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background-color: rgba(0, 162, 255, 0.1);
  color: var(--accent-blue); transition: all 0.3s ease;
}
.social-links a:hover {
  background-color: var(--accent-green); color: var(--bg-dark);
  transform: translateY(-3px); box-shadow: 0 0 15px var(--accent-green);
}

.footer-divider { border-top: 1px solid var(--border-color); margin: 1.5em 0; }
.footer-bottom { text-align: center; padding-top: 1.5em; color: var(--text-secondary); font-size: 0.9em; }
.footer-links { display: flex; justify-content: center; gap: 1.5em; flex-wrap: wrap; margin-top: 0.5em; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--accent-blue); }

/* ========================================
   MEDIA QUERIES (MOBILE)
   ======================================== */
@media (max-width: 768px) {
  .navbar {
    flex-direction: row;
    padding: 0.8em 1em;
    gap: 0.5em;
    justify-content: space-between;
  }

  .logo {
    height: 70px;
    width: 70px;
    order: 1;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0.5em;
    order: 2;
    z-index: 1001;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background-color: var(--accent-blue);
    border-radius: 2px;
    margin: 2px 0;
    transition: all 0.3s ease;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-darker);
    padding: 1em 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    z-index: 1000;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 1em 1.5em;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    font-size: 1rem;
    background: transparent;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a:hover,
  .nav-links a:focus {
    background-color: rgba(0, 162, 255, 0.15);
    color: var(--accent-blue);
    padding-left: 2em;
  }

  .nav-links a.btn-primary {
    background-color: var(--accent-blue);
    color: white;
    margin: 0.5em 1em;
    border-radius: 4px;
  }

  .nav-links a.btn-primary:hover {
    background-color: var(--accent-blue);
    color: white;
    padding-left: 1em;
  }

  .card {
    padding: 1.2em;
    width: 95%;
    margin: 1em auto;
  }

  .grid-container, .service-list, .footer-content {
    grid-template-columns: 1fr !important;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5em;
    text-align: center;
  }

  .btn + .btn { margin-left: 0 !important; }

  .hero-text {
    text-align: center !important;
    padding: 1.5em 1em !important;
  }

  .hero-title { font-size: 1.6rem !important; }
  .hero-subtitle { font-size: 1rem !important; }
  .hero-highlight { font-size: 0.9rem !important; }
  
  /* Ajustement spécifique pour les modales sur mobile très petit */
  .service-card.active, .service-item.active {
    width: 95%;
    padding: 1.5em;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0.5em;
  }

  .logo {
    height: 50px;
    width: 50px;
  }

  .menu-toggle span {
    width: 20px;
    height: 2px;
  }

  .nav-links a {
    padding: 0.8em 1em;
    font-size: 0.95rem;
  }

  h1 { font-size: 1.4rem !important; }
  h2 { font-size: 1.2rem !important; }
  h3 { font-size: 1.1rem !important; }
}


/* Force le texte en blanc pur pour les sections principales */
.card h2, 
.card h3, 
.card p, 
.card ul li {
  color: #ffffff !important;
}
