:root {
  --background-main-color: #161618;
  --category-title-color: #007bff;
  --hover-color: #1b1b1f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    sans-serif;
  background: var(--background-main-color);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

main{
  width: 100%;
  max-width: 980px;
}

header {
  text-align: center;
  margin-bottom: 18px;
}
h1 {
  font-size: 28px;
  color: #ddd;
}

.addTodoContainer {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

#inputTask {
  flex: 1 1 auto;
  padding: 10px 12px;
  font-size: 16px;
  border-radius: 4px;
  border: none;
  outline: none;
}

#addTodobtn {
  width: 56px;
  height: 44px;
  border: none;
  border-radius: 6px;
  background: #1f9b1f;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

#showTasks {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.taskContainer {
  display: flex;
  gap: 8px;
  align-items: flex-start; /* importante: permite que o texto cresça para baixo */
  border: 1px solid #444;
  padding: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

/* botões fixos (não crescem) */
.icon-btn,
.edit-btn,
.delete-btn {
  flex: 0 0 44px; /* tamanho fixo */
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #fff;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.02);
}
.edit-btn:hover {
  background: var(--hover-color);
  color: var(--category-title-color);
}
.delete-btn:hover {
  background: var(--hover-color);
  color: #ff4b4b;
}

/* texto e editor: ocupam espaço disponível, mas não forçam o pai a expandir */
.text,
.editTextarea {
  flex: 1 1 auto; /* ocupa o espaço restante */
  min-width: 0; /* >>> essencial para evitar estouro em flexbox */
  max-height: 96px; /* altura máxima do bloco (ajuste conforme quiser) */
  overflow-y: auto; /* scroll vertical se passar do max-height */
  white-space: normal;
  word-break: break-word;
  padding: 8px;
  font-size: 15px;
  line-height: 1.35;
  border-radius: 4px;
}

.text {
  color: #eee;
  background: transparent;
}
.taskChecked{
  background-color:#1b3326
}
.taskChecked .text {
  text-decoration: line-through;
  opacity: 0.8;
}
.taskChecked .icon-btn svg {
  stroke: #4ecb4e;
}

/* textarea estilo de edição */
.editTextarea {
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.01);
  color: #fff;
  outline: none;
}

/* pequenas melhorias visuais para barras de scroll (opcional) */
.text::-webkit-scrollbar,
.editTextarea::-webkit-scrollbar {
  height: 6px;
  width: 8px;
}
.text::-webkit-scrollbar-thumb,
.editTextarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}
/* Footer */
/* Footer */
.footer {
    width: 90%; /* aumenta a largura em telas menores */
    max-width: 1200px; /* mantém um limite em telas grandes */
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap; /* permite que os itens quebrem linha */
    justify-content: space-between;
    align-items: center;
    color: #555;
    font-weight: 600;
    padding: 20px 0;
    gap: 10px; /* espaçamento entre itens */
}

.footer p {
    margin: 0;
    flex: 1 1 100%; /* ocupa a largura toda em telas pequenas */
    text-align: center;
}

.footer-links {
    display: flex;
    list-style: none;
    gap: 15px;
    flex: 1 1 100%; /* ocupa a largura toda em telas pequenas */
    justify-content: center;
    padding: 0;
    margin: 10px 0 0 0;
}

.footer-links a:hover {
    color: rgb(18, 38, 150);
}

a {
    text-decoration: none !important;
    color: inherit;
}

/* Media queries */
@media (min-width: 600px) {
    .footer {
        flex-wrap: nowrap; /* volta a ser em linha em telas maiores */
    }
    .footer p {
        flex: 1;
        text-align: left;
    }
    .footer-links {
        flex: 1;
        justify-content: flex-end;
        margin: 0;
    }
}
