/* --------------------------- VARIABLES GLOBALES --------------------------- */
:root {
  --primary-color: #4CAF50;
  --secondary-color: #388E3C;
  --light-bg: #f4f4f9;
  --dark-bg: #222;
  --light-text: #333;
  --dark-text: #f4f4f9;
  --success-color: #2ecc71;
}


/* --------------------------- RESET & BASE --------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}


/* --------------------------- MODES (Clair / Sombre) --------------------------- */
body.light-mode {
  background-color: var(--light-bg);
  color: var(--light-text);
}

body.dark-mode {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}


/* --------------------------- HEADER --------------------------- */
header {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: var(--primary-color);
  color: white;
  font-size: 0.9rem;
}

.site-title a {
  font-size: 1.5rem;
  text-decoration: none;
  color: white;
}

.language-selector select {
  font-size: 1rem;
  padding: 8px;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  width: 100px;
}

.toggle-mode {
  background: none;
  border: 2px solid white;
  color: white;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 5px;
  transition: 0.3s;
  font-size: 0.9rem;
}

.toggle-mode:hover {
  background: white;
  color: var(--primary-color);
}


/* --------------------------- MAIN --------------------------- */
main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 15px 80px;
  overflow-y: auto;
  width: 100%;
  text-align: center;
}


/* --------------------------- CONTAINER GÉNÉRATEUR --------------------------- */
.generator-container {
  max-width: 600px;
  padding: 20px;
  background: white;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

body.dark-mode .generator-container {
  background: var(--dark-bg);
  box-shadow: 0px 4px 10px rgba(255, 255, 255, 0.1);
}


/* --------------------------- FILTRES --------------------------- */
.filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
}

.filters label {
  font-size: 0.9rem;
}

.filters input {
  padding: 8px;
  width: 100%;
  max-width: 200px;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}


/* --------------------------- BOUTON GÉNÉRER --------------------------- */
.generate-btn {
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: var(--primary-color);
  color: white;
  transition: background 0.3s, transform 0.2s;
  margin-top: 15px;
}

.generate-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}


/* --------------------------- LISTE DES MOTS --------------------------- */
.word-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 15px 0;
}

.word-item {
  font-size: 1.2rem;
  padding: 8px 12px;
  background: var(--primary-color);
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.word-item:hover {
  background: var(--secondary-color);
}


/* --------------------------- MESSAGE DE COPIE --------------------------- */
.copy-message {
  margin-top: 10px;
  font-weight: bold;
  color: var(--success-color);
}


/* --------------------------- FOOTER --------------------------- */
footer {
  text-align: center;
  width: 100%;
  padding: 10px;
  background: var(--primary-color);
  color: white;
  position: fixed;
  bottom: 0;
  font-size: 0.9rem;
}

footer a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}


/* --------------------------- RESPONSIVE DESIGN --------------------------- */
@media (max-width: 1024px) {
  .generator-container {
    max-width: 80%;
  }

  .filters input {
    max-width: 80%;
  }

  .generate-btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .generator-container {
    max-width: 90%;
  }

  .language-selector select {
    width: 100%;
  }

  .filters input {
    width: 100%;
  }

  .generate-btn {
    width: 100%;
  }

  .word-list {
    flex-direction: column;
    align-items: center;
  }

  .word-item {
    width: 90%;
    text-align: center;
  }

  header {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .site-title a {
    font-size: 1.2rem;
  }

  footer {
    padding: 8px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .generator-container {
    padding: 10px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .filters {
    width: 100%;
  }

  .filters label {
    font-size: 0.8rem;
  }

  .filters input {
    font-size: 0.8rem;
  }

  .generate-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .word-item {
    font-size: 1rem;
    padding: 6px 10px;
  }

  header {
    padding: 6px 10px;
  }

  footer {
    padding: 6px;
    font-size: 0.7rem;
  }
}
