/* styles.css - Version Mobile Optimisée */
:root {
  --animation-duration: 2s;
  --color-primary: #3561bd;
  --color-secondary: #2ecc71;
  --color-accent: #e74c3c;
  --color-de-fond: #f2f4f3;
  --color-font-sombre: #1f1300;
  --border-radius: 10px;
}

/* Reset et Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Montserrat Alternates", sans-serif;
  font-weight: 300;
  font-style: normal;
  background-color: var(--color-de-fond);
  color: var(--color-font-sombre);
  overflow-x: hidden;
  width: 100vw;
}

a:link {
  color: var(--color-secondary);
  font-weight: bold;
  text-decoration: none;
}

h1, h2 {
  font-family: "Young Serif", serif;
  font-weight: 400;
  font-style: normal;
}

/* Loading Page */
#loading-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 4s;
  z-index: 20000;
}

#intro {
  width: 80%;
  text-align: center;
  color: white;
  margin-bottom: 20px;
}

.centrage-creature {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

#loading-focil-container {
  width: 200px;
  height: 200px;
  position: relative;
}

#loading-creature {
  width: 100%;
  height: 100%;
}

#loading-bar-container {
  width: 200px;
  height: 5px;
  background-color: #ddd;
  border-radius: 0px;
  overflow: hidden;
  margin: 0 auto;
}

#loading-bar {
  width: 0;
  height: 100%;
  background-color: #4caf50;
  animation: load var(--animation-duration) forwards;
}

@keyframes load {
  0% { width: 0; }
  100% { width: 100%; }
}

/* Hero Banner */
#hero-banner {
  display: block;
  background-color: var(--color-primary);
  color: white;
  text-align: center;
  padding: 20px 10px;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.animated-text {
  font-family: "Young Serif", serif;
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1.4;
  color: var(--color-de-fond);
  white-space: normal;
  padding: 20px;
}

.dynamic-word {
  position: relative;
  z-index: 1;
  opacity: 0;
  display: inline-block;
  animation: motVivant 2s normal ease-in-out forwards;
  animation-delay: var(--animation-duration);
}

/* Animations des créatures */
.preanimeContainer1, .preanimeContainer2, .preanimeContainer3, .preanimeContainer4 {
  position: relative;
  display: inline-block;
  animation: deBasEnHaut 2s normal cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  animation-delay: var(--animation-duration);
}

@keyframes deBasEnHaut {
  0% { transform: translateY(70vh); }
  100% { transform: translateY(0); }
}

@keyframes motVivant {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0px);
  }
}

/* Images flottantes - Réduites pour mobile */
#NautileSautiyante, #OursinSautiyante, #MeduseSautiyante, #EtoileSautiyante {
  position: absolute;
  animation: float-up 2.5s ease-in-out infinite;
  animation-delay: var(--animation-duration);
  pointer-events: none;
}

#NautileSautiyante {
  width: 120px;
  top: -10vh;
  left: -5vw;
}

#OursinSautiyante {
  width: 100px;
  top: -50px;
  right: 5vw;
}

#MeduseSautiyante {
  width: 80px;
  top: 10vh;
  right: 10vw;
}

#EtoileSautiyante {
  width: 150px;
  bottom: 10vh;
  left: 5vw;
}

@keyframes float-up {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Menu Capsule Navigation - IMPORTANT: z-index élevé */
#sticky-menu {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999 !important; /* Z-index très élevé pour rester au-dessus */
  width: auto;
  max-width: 90%;
}

.capsule-icons {
  display: flex;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 55px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.44);
}

.capsule-menu .icon {
  display: inline-block;
  margin: 0 10px;
  width: 60px;
  height: 60px;
  cursor: pointer;
}

/* Sections principales */
#lereste {
  display: none;
  position: relative;
  z-index: 1;
}

#explication-ra {
  padding: 40px 20px;
  text-align: center;
  background-color: var(--color-primary);
  background-image: url("https://cdn.glitch.global/efcb4e9c-2622-4b77-b75d-39881b6b4401/1745675191288.jpg?v=1745675217200");
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#explication-ra h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--color-de-fond);
  padding: 0 10px;
}

/* Section Fossiles */
#fossiles {
  padding: 40px 20px;
  text-align: center;
}

#fossiles h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

#fossiles > p {
  font-size: 1rem;
  margin: 0 auto 30px;
  padding: 0 20px;
  line-height: 1.6;
}

.fossile-card {
  display: block;
  width: 90%;
  max-width: 350px;
  height: 300px;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.fossile-date {
  color: var(--color-de-fond);
  padding: 10px;
  font-size: 0.9rem;
  text-transform: uppercase;
  font-weight: 500;
}

.fossile-card h2 {
  color: var(--color-de-fond);
  font-size: 1.2rem;
  margin: 10px;
  text-transform: uppercase;
  line-height: 1;
}

.imageFossille {
  width: 70%;
  height: 150px;
  background-size: cover;
  background-position: center;
  margin: 0 auto;
  visibility: hidden;
}

.fossile-card p {
  color: var(--color-de-fond);
  font-size: 0.9rem;
  margin-top: 20px;
  font-weight: 500;
}

/* Section Financeurs et Crédits - OPTIMISÉ POUR MOBILE */
#financeurs-credits {
  padding: 40px 20px;
  text-align: center;
  background-color: var(--color-de-fond);
}

#financeurs-credits h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--color-font-sombre);
}

#financeurs-credits > p {
  font-size: 1rem;
  margin-bottom: 30px;
  color: var(--color-font-sombre);
}

/* Grille des logos partenaires - 4 LIGNES */
#financeurs-credits .custom-logo-link {
  display: inline-block;
  width: 22%; /* 4 par ligne avec marges */
  margin: 1.5%;
  vertical-align: middle;
}

#financeurs-credits .custom-logo {
  width: 100%;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}

/* FAQ */
#faq {
  padding: 40px 20px;
  background-color: var(--color-de-fond);
}

#faq h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 20px;
}

.faq-container {
  max-width: 100%;
  margin: 20px auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.faq-container h1 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.faq-item {
  margin-bottom: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.faq-question {
  font-size: 1rem;
  color: var(--color-accent);
  padding: 15px;
  background-color: var(--color-de-fond);
  cursor: pointer;
  font-weight: bold;
  position: relative;
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 15px;
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
  content: '-';
}

.faq-answer {
  font-size: 0.9rem;
  color: #555;
  padding: 0 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  line-height: 1.6;
}

/* Footer */
footer {
  background-color: var(--color-accent);
  color: var(--color-de-fond);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: auto;
}

.footer-content {
  margin-bottom: 20px;
}

.footer-content p,
.footer-content a {
  margin: 5px 0;
  color: var(--color-de-fond);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-logo img {
  max-height: 40px;
  margin: 10px 0;
}

.footer-address {
  margin-top: 20px;
}

.footer-address p {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

#map-container iframe {
  width: 100%;
  max-width: 300px;
  height: 200px;
}

/* Info Bubbles */
.info-bubble {
  background-color: var(--color-accent);
  display: none;
  text-align: center;
  border-radius: 10px;
  padding: 15px;
  margin: 10px auto 20px;
  font-weight: bold;
  width: 90%;
  color: var(--color-de-fond);
  position: relative;
  font-size: 0.9rem;
}

.BoutonFermeture {
  position: absolute;
  right: 10px;
  top: 5px;
  font-size: 2rem;
  cursor: pointer;
}

/* États d'affichage */
#btn-immersive { display: none; }
#btn-fixe { display: block; }
#messageIphone { display: block; }
#messageNavigateur { display: none; }
#PanelIOS { display: none; }

/* Éléments graphiques du menu */
.container, .recontainer {
  position: relative;
  width: 60px;
  height: 60px;
  overflow: hidden;
}

.phone {
  position: absolute;
  top: 50%;
  left: 0;
  width: 15px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 4px solid #fff;
  border-radius: 2px;
  transform: translateY(-50%);
  animation: movePhone 3s ease-in-out infinite;
}

@keyframes movePhone {
  0%, 100% { left: 0px; }
  50% { left: calc(100% - 25px); }
}

.rotation-bg-image {
  position: absolute;
  width: 60px;
  height: 60px;
  animation: rotate 10s infinite linear;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.front-rectangle {
  position: absolute;
  top: 20px;
  left: 10px;
  width: 40px;
  height: 40px;
}

/* SVG Styles */
.front-rectangle svg path {
  fill: var(--color-de-fond);
  stroke: var(--color-primary);
  stroke-width: 7;
}

.rotation-bg-image svg path,
.container svg path {
  stroke: var(--color-primary);
  stroke-width: 7;
}

/* Media Queries pour tablettes */
@media (min-width: 768px) {
  .animated-text {
    font-size: 2.5rem;
  }
  
  #financeurs-credits .custom-logo-link {
    width: 18%; /* 5 par ligne sur tablette */
  }
  
  .fossile-card {
    display: inline-block;
    width: 45%;
    margin: 10px 2%;
  }
  
  footer {
    flex-direction: row;
    justify-content: space-around;
    align-items: flex-start;
    text-align: left;
  }
}

/* Ajustements pour très petits écrans */
@media (max-width: 360px) {
  .animated-text {
    font-size: 1.5rem;
  }
  
  #financeurs-credits .custom-logo-link {
    width: 46%; /* 2 par ligne sur très petit écran */
    margin: 2%;
  }
  
  .capsule-icons {
    padding: 8px 15px;
  }
  
  .capsule-menu .icon {
    width: 50px;
    height: 50px;
    margin: 0 5px;
  }
}