/* --- Importation d'une police moderne --- */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap");

:root {
  --primary-color: #0056b3;
  --secondary-color: #f8f9fa;
  --accent-color: #e74c3c;
  --text-color: #333;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f4f7f6;
  overflow-x: hidden; /* Évite le scroll horizontal sur mobile */
}

/* --- NOUVEAU STYLE DIAPORAMA (Fondu croisé) --- */
.slideshow-container {
    max-width: 700px; /* Même largeur qu'avant sur PC */
    width: 95%;       /* Adaptatif sur mobile */
    position: relative;
    margin: 20px auto;
    overflow: hidden; /* Empêche les débordements */
    border-radius: 8px; /* Petits coins arrondis pour le style */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Légère ombre pour décoller l'image */
}

/* Cache les images par défaut */
.mySlides {
    display: none;
}

.mySlides img {
    width: 100%;
    height: auto; /* Conserve le ratio */
    display: block; /* Évite les espaces sous l'image */
    object-fit: cover; /* Remplit l'espace sans déformer */
}

/* Boutons Précédent & Suivant */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3); /* Fond semi-transparent pour la lisibilité */
}

/* Positionne le bouton "suivant" à droite */
.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

/* Effet de survol sur les boutons */
.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Style des points indicateurs */
.dot {
    cursor: pointer;
    height: 13px;
    width: 13px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.active, .dot:hover {
    background-color: #003d7a; /* Couleur de ton Lycée */
}

/* L'Animation de fondu (Fade) */
.fade {
    animation-name: fade;
    animation-duration: 1.5s; /* Durée de la transition */
    /* Utilisation de will-change pour optimiser les performances */
    will-change: opacity; 
}

@keyframes fade {
    from { opacity: .4 }
    to { opacity: 1 }
}

/* Ajustement pour mobile */
@media (max-width: 500px) {
    .prev, .next { font-size: 14px; padding: 12px;}
}

.diapo-wrapper {
    display: flex;
    width: 400%; /* 4 images côte à côte (3 originales + 1 copie) */
    height: 100%;
    animation: slide 12s infinite ease-in-out;
}

.diapo-wrapper img {
    width: 25%; /* Chaque image prend 1/4 */
    height: 100%;
    object-fit: cover; /* Remplit l'espace sans déformer */
}

/* Animation fluide */
@keyframes slide {
    0%, 20% { transform: translateX(0); }
    25%, 45% { transform: translateX(-25%); }
    50%, 70% { transform: translateX(-50%); }
    75%, 95% { transform: translateX(-75%); }
    100% { transform: translateX(-75%); }
}

/* --- Ajustement spécial pour les tout petits écrans --- */
@media (max-width: 400px) {
    .diapo-container {
        width: 90%; /* Pleine largeur sur petits écrans */
    }
}

/* --- Barre de Navigation --- */
.navbar {
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar ul {
  display: flex;
  list-style: none;
  align-items: center;
}

.navbar ul li {
  margin-left: 20px;
}

.navbar a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s;
}

/* Styles spécifiques boutons nav */
.messagerie-btn,
.rdv-btn,
.expression-btn {
  padding: 8px 15px;
  border-radius: 5px;
  transition: all 0.3s;
}

.messagerie-btn:hover {
  background: #e3f2fd;
  color: #0d47a1;
}
.rdv-btn:hover {
  background: #f1f8e9;
  color: #33691e;
}
.expression-btn:hover {
  background: #fff3e0;
  color: #e65100;
}

/* --- Dropdown Profile --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.login-icon {
  cursor: pointer;
  border-radius: 50%;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: white;
  min-width: 200px;
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 10px 0;
}

.dropdown-content span {
  display: block;
  padding: 10px 15px;
  font-size: 0.9rem;
  border-bottom: 1px solid #eee;
}

.dropdown-content a {
  color: black;
  padding: 10px 15px;
  display: block;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.show {
  display: block;
}

/* --- Section Main --- */
.main {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #ffffff 20%, #003d7a 80%);
  color: white;
}

.img {
  text-align: center;
  margin-top: -30px;
}

.img img {
  border-radius: 15px;
  max-width: 90%;
  height: auto;
}

/* --- Cards (Grille) --- */
.section {
  padding: 50px 5%;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card h2 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* --- Section Juridique --- */
.card2 {
  background: white;
  margin: 20px 5%;
  padding: 40px;
  border-radius: 12px;
  border-left: 5px solid var(--accent-color);
}

/* --- Contact & Boutons --- */
.contact {
  text-align: center;
  padding: 50px;
}

.btn-contact {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 15px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
}

.btn-contact:hover {
  background: #c0392b;
}

/* --- Footer --- */
.site-footer {
  background: #222;
  color: #fff;
  padding: 50px 5% 20px;
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

.footer-section h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: #64b5f6;
}

.footer-section a {
  color: #bbb;
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #444;
  font-size: 0.9rem;
}

/* ============================================= */
/* --- AJOUTS POUR LE RESPONSIVE (MOBILE) ---   */
/* ============================================= */

@media (max-width: 850px) {
  .navbar {
    flex-direction: column;
    padding: 1.5rem 1rem;
  }

  .navbar ul {
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .navbar ul li {
    margin-left: 0;
  }

  .main h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 30px 20px;
  }

  .cards {
    grid-template-columns: 1fr; /* Force une seule colonne */
  }

  .card2 {
    margin: 20px 15px;
    padding: 20px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .btn-contact {
    width: 100%;
    padding: 15px 10px;
  }
}