/* =======================================
   styles.css — The "skin" of the Todo App
   styles.css — A "pele" da Todo App
   =======================================

   EN:
   - HTML is the skeleton (structure)
   - CSS is the skin (colors, layout, design)
   - JS is the brain (interactivity)

   PT:
   - HTML é o esqueleto (estrutura)
   - CSS é a pele (cores, layout, design)
   - JS é o cérebro (interatividade)
*/

/* ---------- RESET (PT: limpar estilos base | EN: reset browser defaults) ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------- COLOR SYSTEM (PT: paleta global | EN: global color palette) ---------- */
:root {
  --primary: #FF69B4;
  --secondary: #FFA500;
  --dark: #212529;
  --light: #f8f9fa;
  --gray: #868e96;
  --danger: #fa5252;
  --success: #40c057;
  --border: #e9ecef;
}

/* ---------- PAGE LAYOUT (PT: layout geral | EN: global layout) ---------- */
body {
  font-family: sans-serif;
  background-color: #f1f3f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: var(--dark);
}

/* ---------- APP CONTAINER (PT: cartão principal | EN: main card) ---------- */
.app {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ---------- HEADER (PT: topo rosa | EN: pink header) ---------- */
header {
  background: var(--primary);
  color: white;
  padding: 20px 25px;
}

header h1 {
  font-size: 24px;
  margin-bottom: 5px;
  font-weight: 600;
}

header p {
  font-size: 14px;
  opacity: 0.9;
}

/* ---------- INPUT AREA (PT: adicionar tarefas | EN: add task area) ---------- */
.todo-input {
  padding: 20px 25px;
  display: flex;
  gap: 10px;
  background: var(--light);
  border-bottom: 1px solid var(--border);
}

.todo-input input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 1rem;
  transition: 0.2s;
}

.todo-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.2);
}

.todo-input button {
  background: var(--primary);
  color: white;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.todo-input button:hover {
  background: var(--secondary);
}

/* ---------- FILTERS (PT: filtros | EN: filters) ---------- */
.filters {
  display: flex;
  gap: 15px;
  padding: 15px 25px;
  border-bottom: 1px solid var(--border);
}

.filter {
  padding: 5px 3px;
  cursor: pointer;
  color: var(--gray);
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}

.filter:hover {
  color: var(--primary);
}

.filter.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

/* ---------- TASK LIST (PT: lista de tarefas | EN: task list) ---------- */
.todos-container {
  padding: 15px 0;
  max-height: 300px;
  overflow-y: auto;
}

#todos-list {
  list-style: none;
}

/* ---------- TASK ITEM (PT: item da lista | EN: list item) ---------- */
.todo-item {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  transition: 0.2s;
}

.todo-item:hover {
  background: var(--light);
}

/* ---------- CUSTOM CHECKBOX (PT: checkbox personalizado | EN: custom checkbox) ---------- */
.checkbox-container {
  margin-right: 15px;
}

.todo-checkbox {
  opacity: 0;
  position: absolute;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: 0.2s;
}

.todo-checkbox:checked + .checkmark {
  background: var(--success);
  border-color: var(--success);
}

.todo-checkbox:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- TASK TEXT (PT: texto | EN: text) ---------- */
.todo-item-text {
  flex: 1;
  font-size: 1rem;
  transition: 0.2s;
}

.todo-item.completed .todo-item-text {
  text-decoration: line-through;
  color: var(--gray);
}

/* ---------- DELETE BUTTON (PT: botão apagar | EN: delete button) ---------- */
.delete-btn {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 16px;
  opacity: 0;
  transition: 0.2s;
}

.todo-item:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  color: var(--danger);
}

/* ---------- EMPTY STATE (PT: estado vazio | EN: empty state) ---------- */
.empty-state {
  text-align: center;
  padding: 40px 0;
  color: var(--gray);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.7;
}

.hidden {
  display: none;
}

/* ---------- FOOTER (PT: rodapé | EN: footer) ---------- */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-top: 1px solid var(--border);
  background: var(--light);
  font-size: 14px;
}

#items-left {
  color: var(--gray);
}

#clear-completed {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  transition: 0.2s;
}

#clear-completed:hover {
  color: var(--danger);
}

/* ---------- GITHUB LINK (PT: crédito | EN: credit) ---------- */
.github-link {
  font-size: 14px;
  color: #333;
}

.github-link a {
  color: inherit;
  text-decoration: none;
}

.github-link i {
  margin-right: 5px;
}
