/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Roboto Mono", monospace;
  font-weight: 300;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
}

/* Theme Variables */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --primary-color: #307843;
  --secondary-color: #f2f2f2;
  --accent-color: #0078D7; /* Modification : bleu moderne pour un meilleur contraste */
  --shadow-color: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-color: #f5f5f5;
    --primary-color: #1f1f1f;
    --secondary-color: #333333;
    --accent-color: #ff9800;
    --shadow-color: rgba(0, 0, 0, 0.5);
  }
}

/* Header */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--primary-color);
  color: var(--text-color);
  text-align: center;
  padding: 1rem;
  font-size: 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9999;
  box-shadow: 0 4px 10px var(--shadow-color);
}

/* Form */
form {
  display: flex;
  align-items: center;
  justify-content: center;
}

form select {
  font-size: 1rem;
  padding: 0.5rem;
  border-radius: 5px;
  border: 1px solid var(--secondary-color);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

form select option {
  font-size: 1rem;
}

/* Main Content */
main {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: -1;
  background-color: var(--bg-color);
}

/* Clock Section */
.heure {
  background-color: var(--secondary-color); /* Couleur plus foncée par défaut en thème clair */
  padding: 1rem 5rem;
  font-size: 3rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px var(--shadow-color);
}

.heure:hover {
  transform: scale(1.1);
  background-color: var(--bg-color); /* Couleur plus claire au survol en thème clair */
  color: var(--text-color); /* Conserve la couleur du texte */
  box-shadow: 0 6px 15px var(--shadow-color);
}

@media (prefers-color-scheme: dark) {
  .heure {
    background-color: var(--primary-color); /* Couleur plus foncée par défaut en thème sombre */
    color: var(--text-color);
  }

  .heure:hover {
    background-color: var(--secondary-color); /* Couleur plus claire au survol en thème sombre */
    color: var(--text-color); /* Conserve la couleur du texte */
    box-shadow: 0 6px 15px var(--shadow-color);
  }
}

.heure h1 {
  font-size: 6rem;
  color: var(--text-color);
  text-align: center;
  user-select: none;
}

.heure span {
  font-weight: bold;
}

#clock0_bg {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%; /* Assure que le conteneur occupe tout l'espace disponible */
    width: 100%; /* Assure que le conteneur occupe toute la largeur */
    text-align: center; /* Centre le texte horizontalement */
}

#clock {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap; /* Empêche les éléments de passer à la ligne */
    text-align: center; /* Centre le texte horizontalement */
    height: 100%; /* Assure que l'horloge occupe tout l'espace vertical */
}

.group {
    display: flex;
    gap: 0; /* Supprime l'espace entre les chiffres dans un groupe */
}

#clock span {
    display: inline-block;
    text-align: center;
    font-weight: bold;
    font-size: 6rem; /* Ajustez la taille si nécessaire */
    color: var(--text-color);
    margin: 0; /* Supprime les marges entre les chiffres */
}

.sep {
    font-size: 6rem; /* Ajustez la taille pour correspondre aux chiffres */
    color: var(--accent-color);
    margin: 0 10px; /* Ajoute un petit espace autour des séparateurs */
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: #ffffff; /* Modification : texte blanc pour un meilleur contraste */
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  z-index: 9999;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-shadow: 0 -4px 10px var(--shadow-color);
}

footer p {
  margin: 0;
  user-select: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .heure {
    padding: 1rem 5rem;
    font-size: 2rem;
  }

  .heure h1 {
    font-size: 4rem;
  }
}

/* Responsive Design pour les téléphones */
@media (max-width: 480px) {
  /* Ajuster la taille de la section heure */
  .heure {
    padding: 0.5rem 1rem; /* Réduire les marges internes */
    font-size: 1.5rem; /* Réduire la taille de la police */
    border-radius: 10px; /* Réduire les coins arrondis */
  }

  .heure h1 {
    font-size: 2.5rem; /* Réduire la taille du texte */
  }

  /* Ajuster l'horloge */
  #clock span {
    font-size: 3rem; /* Réduire la taille des chiffres */
  }

  .sep {
    font-size: 3rem; /* Réduire la taille des séparateurs */
    margin: 0 5px; /* Réduire l'espace autour des séparateurs */
  }

  /* Footer */
  footer {
    font-size: 0.7rem; /* Réduire la taille du texte */
    padding: 0.5rem; /* Réduire les marges internes */
  }

  /* Header */
  header {
    font-size: 1rem; /* Réduire la taille du texte */
    padding: 0.5rem; /* Réduire les marges internes */
  }
}