/* Importation des fichiers CSS externes pour les couleurs et les polices. */
@import "./root/color.css";
@import "./root/font.css";

/* Réinitialisation des marges et des espacements pour tous les éléments. */
* {
  margin: 0;
  padding: 0;
}

/* Styles pour le corps de la page. */
body {
  background: var(--bg-color); /* Utilisation du dégradé de fond défini dans les variables. */
  display: flex;
  justify-content: center; /* Centrage horizontal du contenu. */
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Styles pour les conteneurs div. */
div {
  display: flex;
  align-items: center; /* Centrage vertical des éléments enfants. */
  flex-direction: column; /* Disposition des éléments enfants en colonne. */
  font-family: var(--font-police); /* Utilisation de la police définie dans les variables. */
}

/* Styles spécifiques pour le conteneur d'affichage de l'horloge */
.clock-display {
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 50vw; /* Largeur de 50% de la largeur de la fenêtre. */
  font-family: var(--font-police);
}

/* Styles pour l'élément d'affichage de l'heure. */
#time {
  color: var(--color-text); /* Utilisation de la couleur de texte définie dans les variables. */
  font-size: 15vw; /* Taille de police très grande pour l'heure. */
  text-shadow: 0 0 15px var(--shadow-color); /* Effet 'ombre avec la couleur d'accentuation. */
  padding: 0 5% 0 5%; /* Espacement horizontal de 5%. */
}

/* Styles pour l'élément d'affichage de la date. */
#date {
  color: var(--color-text); /* Utilisation de la couleur de texte définie dans les variables. */
  font-size: 4vw; /* Taille de police grande pour la date. */
  text-shadow: 0 0 15px var(--shadow-color); /* Effet de flou avec la couleur d'accentuation. */
}

/* Styles pour les particules animées en arrière-plan */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  top: 0;
  left: 0;
}

.particle {
  position: absolute;
  background: var(--particle-color);
  border-radius: 50%;
  animation: float 15s infinite ease-in-out;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-100px) translateX(50px) rotate(180deg);
    opacity: 0.8;
  }
}

/* Styles pour l'image Flozze */
.flozze-container {
  position: relative;
  z-index: 10;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.flozze-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: bounce 2s infinite ease-in-out;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.flozze-image:hover {
  transform: scale(1.1) rotate(5deg);
}

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

/* Ajustement du conteneur de l'horloge pour inclure l'image */
.clock-container {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  transition: transform 0.1s ease-out;
}


/* Style du bouton de retour */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  z-index: 1000;
  transition: all 0.3s ease;
  color: var(--color-text);
  cursor: pointer;
  font-family: var(--font-police);
}

.back-button:hover {
  transform: translateX(-3px) scale(1.05);
  background: var(--glass-hover);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.back-arrow {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--color-text);
  text-shadow: 0 0 15px var(--shadow-color);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-police);
}

/* Styles pour les contrôles en haut à droite */
.controls-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
  font-family: var(--font-police);
}

.control-group {
  position: relative;
}

.control-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-police);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 80px;
  justify-content: center;
}

.language-button {
  justify-content: flex-start;
  min-width: 120px;
}

.language-button .fi {
  flex-shrink: 0;
}

.timezone-button {
  justify-content: flex-start;
  min-width: 150px;
}

.control-button:hover {
  transform: scale(1.05);
  background: var(--glass-hover);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.control-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.control-text {
  font-size: 0.9rem;
  font-weight: 600;
  text-shadow: 0 0 10px var(--shadow-color);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  z-index: 1001;
  padding: 5px;
}

.dropdown-menu.active {
  display: flex;
}

.dropdown-item {
  padding: 12px 15px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--glass-border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-police);
  font-size: 0.9rem;
  text-align: left;
  width: 100%;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

.dropdown-item:last-child {
  margin-bottom: 0;
}

.dropdown-item:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dropdown-item:active {
  transform: translateX(5px) scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Styles pour les drapeaux flag-icons */
.fi {
  display: inline-block;
  width: 24px;
  height: 18px; /* Ratio 4:3 (24/18 = 1.33) */
  margin-right: 8px;
  vertical-align: middle;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.dropdown-item {
  display: flex;
  align-items: center;
}

.dropdown-item span:not(.flag) {
  flex: 1;
}

/* Responsive pour les petits écrans */
@media (max-width: 768px) {
  .controls-container {
    top: 10px;
    right: 10px;
    gap: 5px;
  }

  .control-button {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-width: 70px;
  }

  .control-text {
    font-size: 0.8rem;
  }

  .dropdown-menu {
    min-width: 180px;
    max-height: 250px;
  }

  .fi {
    width: 20px;
    height: 15px;
    margin-right: 6px;
  }
}