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

body {
  background: linear-gradient(135deg, #1f1c2c, #928DAB);
  font-family: 'Poppins', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  color: #fff;
  overflow: hidden;
}

/* --- Main Content --- */
#main-content {
  opacity: 0;
}

/* --- Conteneur de l'App --- */
.container {
  width: 90%;
  max-width: 500px;
  background: rgba(20, 20, 30, 0.7);
  padding: 20px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  text-align: center;
  margin: 0 auto;
}

/* --- Header --- */
header h1 {
  font-size: 2.5em;
  color: #ffcc00;
  margin-bottom: 5px;
}

header p {
  font-size: 1em;
  opacity: 0.8;
  margin-bottom: 15px;
}

/* --- Barre de Progression --- */
.progress-container {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 15px;
  height: 10px;
}

.progress-bar {
  height: 10px;
  width: 0%;
  background: #ffcc00;
  transition: width 0.3s ease;
}

/* --- Navigation des Onglets --- */
.nav-tabs {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
}

.tab-btn {
  background: transparent;
  border: 1px solid #ffcc00;
  padding: 8px 12px;
  border-radius: 20px;
  color: #ffcc00;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.tab-btn.active, .tab-btn:hover {
  background: #ffcc00;
  color: #1f1c2c;
}

/* --- Sections (To-Do, Profil, Paramètres) --- */
section {
  display: none;
}

section.active {
  display: block;
}

/* --- Input et Boutons --- */
.input-container {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
}

input {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 5px;
  font-size: 1em;
}

button {
  background: #ffcc00;
  border: none;
  padding: 12px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.3s;
}

button:hover {
  background: #ffaa00;
}

button:active {
  transform: scale(0.98);
}

/* --- Filtres To-Do --- */
.filters {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
}

.filter-btn {
  background: transparent;
  border: 1px solid #ffcc00;
  padding: 8px 12px;
  border-radius: 20px;
  color: #ffcc00;
  transition: background 0.3s, color 0.3s;
}

.filter-btn.active, .filter-btn:hover {
  background: #ffcc00;
  color: #1f1c2c;
}

/* --- Liste des Tâches --- */
#task-list {
  list-style: none;
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 15px;
}

.task-item {
  background: rgba(255, 255, 255, 0.15);
  padding: 12px;
  margin: 5px 0;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s;
  position: relative;
}

.task-item:hover {
  transform: scale(1.02);
}

.task-item.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

/* --- Bouton pour Tout Supprimer --- */
#clear-all {
  width: 100%;
  background: #ff4444;
  transition: background 0.3s;
}

#clear-all:hover {
  background: #cc0000;
}

#clear-all:active {
  background: #bb3333;
}

/* --- Section Profil --- */
#profile-section {
  text-align: left;
  padding: 15px;
}

#profile-section h2 {
  font-size: 2em;
  margin-bottom: 10px;
  color: #ffcc00;
}

#profile-section p {
  font-size: 1em;
  margin-bottom: 8px;
}

/* --- Section Paramètres --- */
#settings-section {
  text-align: left;
  padding: 15px;
}

#settings-section h2 {
  font-size: 2em;
  margin-bottom: 10px;
  color: #ffcc00;
}

.setting-item {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-item label {
  font-size: 1em;
}

.setting-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

/* --- Responsive pour Petits Écrans --- */
@media (max-width: 480px) {
  .container {
    width: 95%;
    padding: 15px;
  }

  header h1 {
    font-size: 1.8em;
  }

  .input-container {
    flex-direction: column;
    gap: 8px;
  }

  .input-container input,
  .input-container button {
    width: 100%;
    font-size: 1em;
    padding: 10px;
  }

  .nav-tabs {
    flex-direction: column;
    gap: 8px;
  }

  .tab-btn {
    width: 100%;
    padding: 10px;
    font-size: 1em;
  }

  #clear-all {
    font-size: 1em;
    padding: 10px;
  }

  .update-banner {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffcc00;
    color: black;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.5s ease-out;
  }

  @keyframes slideIn {
    from {
      transform: translateX(-50%) translateY(20px);
    }
    to {
      transform: translateX(-50%) translateY(0);
    }
  }

  .update-banner button {
    background: black;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
  }

  .update-banner button:hover {
    background: #222;
  }
}
