@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700');

/* Réinitialiser les styles par défaut */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Définir les variables de couleur pour le thème clair */
:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --btn-color: #1a73e8;
  --input-color: #f8f8ff;
}

/* Définir les variables de couleur pour le thème sombre */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #202124;
    --text-color: #ffffff;
    --btn-color: #4285f4;
    --input-color: #303134;
  }
}

/* Style de l'en-tête */
header {
  background-color: var(--btn-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Style du logo */
.logo {
  color: var(--bg-color);
  font-size: 2rem;
  font-weight: bold;
  text-decoration: none;
}

/* Style du bouton d'historique */
#btn-history {
  background-color: var(--input-color);
  color: var(--text-color);
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

#btn-history:hover {
  background-color: var(--bg-color);
}

/* Style principal */
body {
  font-family: Roboto, Arial, sans-serif;
  font-size: 1rem;
  color: var(--text-color);
  background-color: var(--bg-color);
}

/* Style du contenu principal */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

/* Style du traducteur */
.translator {
  display: grid;
  grid-template-columns: 1fr 0.2fr 1fr;
  grid-gap: 1rem;
  margin-top: 2rem;
}

/* Style des sélecteurs de langue */
.source select,
.target select {
  width: 100%;
  height: 2rem;
  background-color: var(--input-color);
  color: var(--text-color);
  font-size: 1rem;
  border: none;
  cursor: pointer;
}

/* Style des zones de texte */
.source textarea,
.target textarea {
  width: 100%;
  height: 10rem;
  background-color: var(--input-color);
  color: var(--text-color);
  font-size: 1rem;
  border: none;
  padding: 0.5rem;
  resize: none;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
}

#speaker-source, #speaker-target {
  background-color: var(--btn-color);
  color: var(--bg-color);
  font-size: 1rem;
  padding: 7px;
  text-shadow: 2px 2px 4px black;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.5s, font-size 0.5s;
}

#speaker-source:hover, #speaker-target:hover {
  transform: scale(1.1);
  font-size: 1.2rem;
}

/* Style du bouton de traduction */
#btn-translate, #btn-paste, #btn-copy  {
  margin-top: 1rem;
  width: 80%;
  height: 2rem;
  background-color: var(--btn-color);
  color: var(--bg-color);
  font-size: 1rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.5s;
}

/* Définir le style du bouton de traduction au survol */
#btn-translate:hover, #btn-paste:hover, #btn-copy:hover {
  transform: scale(1.1);
}

/* Style du bouton d'échange */
#swap-button {
  width: 50%;
  height: 2rem;
  background-color: var(--input-color);
  color: var(--text-color);
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  transition: transform 1s;
}

#swap-button:hover {
  transform: rotate(180deg);
}

/* Style de l'historique */
.history {
  margin-top: 2rem;
}

/* Style du titre de l'historique */
.history h2 {
  font-size: 1.5rem;
  color: var(--text-color);
}

/* Style du conteneur de l'historique */
.history-container {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Style d'une traduction */
.translation {
  width: 80%;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--text-color);
  border-radius: 0.25rem;
  padding: 0.5rem;
}

/* Style des langues d'une traduction */
.languages {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Style du texte source d'une traduction */
.source-text {
  font-style: italic;
  color: var(--text-color);
}

/* Style du texte cible d'une traduction */
.target-text {
  font-weight: bold;
  color: var(--text-color);
}

/* Style de la date et de l'heure d'une traduction */
.date-time {
  font-size: 0.8rem;
  color: var(--text-color);
  text-align: right;
}

/* Style du pied de page */
.footer {
  background-color: var(--btn-color);
  padding: 1rem;
}

/* Style du texte du pied de page */
.footer p {
  color: var(--bg-color);
  text-align: center;
}

/* Media query pour les écrans de petite taille */
@media screen and (max-width: 768px) {

  /* Réduire la taille du logo */
  .logo {
    font-size: 1.5rem;
  }

  /* Changer la disposition du traducteur */
  .translator {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  /* Changer la position des boutons */
  .buttons {
    order: 3;
    display: flex;
    flex-direction: column;
  }

  /* Changer la largeur des boutons */
  #btn-translate,
  #swap-button {
    width: 80%;
    margin: 0.5rem auto;
  }
}
