@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --cor-primaria: #6ec6d9;
  --cor-fundo: #f8f9fa;
  --cor-titulo: #f7f6f6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #eef5f7;
  color: #2c3e50;
}

/* ── HEADER ───────────────────────── */

.header {
  background-color: #6ec6d9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.header h1 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #ffffff;
}

.header h2 {
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.7);
}

/* ── MAIN ───────────────────────── */

.main-container {
  padding-top: 30px;
  padding-bottom: 60px;
}

/* ── INPUT ───────────────────────── */

.ToDo-Container {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 30px auto;
  background: #ffffff;
  padding: 18px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.input-tarefa {
  width: 100%;
  padding: 14px 18px;
  padding-right: 60px;
  border-radius: 14px;
  border: 2px solid transparent;
  background-color: #f1f7f9;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: #2c3e50;
  transition: border-color 0.2s;
}

.input-tarefa::placeholder {
  color: #b0c4ca;
}

.input-tarefa:focus {
  outline: none;
  border-color: #6ec6d9;
}

/* ← estava sem "top", ficava desalinhado */
.char-counter {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #b0c4ca;
  pointer-events: none;
  transition: color 0.2s;
}

.char-counter-warning {
  color: #e8a838;
}

.char-counter-limit {
  color: #e74c3c;
}

.add-task-button {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 14px;
  background-color: #63b8c9;
  color: white;
  font-size: 28px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.add-task-button:hover {
  background-color: #4da6b8;
}

.add-task-button:active {
  transform: scale(0.93);
}

/* ── PROGRESSO ───────────────────────── */

.progresso-container {
  max-width: 600px;
  margin: 0 auto 20px;
  padding: 0 20px;
  text-align: center;
}

.progresso-texto {
  color: #6ec6d9;
  font-size: 14px;
  font-weight: 500;
}

.progresso-trilho {
  width: 100%;
  height: 10px;
  background: #cfe8ef;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progresso-fill {
  height: 100%;
  background: #6ec6d9;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── TABS ───────────────────────── */

.tabs {
  position: relative;
  max-width: 600px;
  margin: 0 auto 20px;
  display: flex;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* fundo deslizante */
.tab-indicator {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  background-color: #6ec6d9;
  border-radius: 12px;
  transition: transform 0.3s ease;
  z-index: 0;
}

.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: #8faab1;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.3s;
}

.tab.active {
  color: #ffffff;
}

/* ── LISTA ───────────────────────── */

.lista-tarefas {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── EMPTY STATE ← não existia, mensagem ficava grudada à esquerda */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: #a8b8be;
}

.empty-icon {
  font-size: 40px;
  color: #b8d4da;
}

.empty-state p {
  font-size: 15px;
  line-height: 1.6;
  color: #a8b8be;
}

/* ── TASK ITEM ───────────────────────── */

/* animação de entrada */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  animation: slideIn 0.25s ease both;
  transition: box-shadow 0.2s, transform 0.2s;
}

.task-item:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* estado de drag */
.task-item.dragging {
  opacity: 0.4;
}

.task-item.drag-over {
  border-top: 2px solid #6ec6d9;
}

.task-item.drag-over-bottom {
  border-top: none;
  border-bottom: 2px solid #6ec6d9;
}

/* estado de remoção */
.task-item.removing {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* drag handle */
.drag-handle {
  color: #c8d8dc;
  cursor: grab;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
}

/* texto */
.task-text {
  flex: 1;
  font-size: 15px;
  word-break: break-word;
  min-width: 0;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: #a8b8be;
}

/* input de edição inline */
.edit-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #6ec6d9;
  background: #f1f7f9;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: #2c3e50;
  outline: none;
}

/* ── BOTÕES DAS TASKS ───────────────────────── */

.task-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-done,
.btn-edit,
.btn-delete {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.btn-done:hover,
.btn-edit:hover,
.btn-delete:hover {
  opacity: 0.8;
}

.btn-done:active,
.btn-edit:active,
.btn-delete:active {
  transform: scale(0.88);
}

.btn-done {
  background: #d4f3e2;
  color: #27ae60;
}

.btn-edit {
  background: #d6ecf5;
  color: #3498db;
}

.btn-delete {
  background: #fde2e2;
  color: #e74c3c;
}

/* ── BOTÃO LIMPAR CONCLUÍDAS ───────────────────────── */

/* 
  O container .clear-completed precisa de display: flex 
  para centralizar — o JS vai setar display block/none 
  mas o padding e max-width garantem o alinhamento.
*/
.clear-completed {
  max-width: 600px;
  margin: 16px auto 30px;
  padding: 0 10px;
}

#clear-completed {
  display: block;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 14px;
  background-color: #fde2e2;
  color: #e74c3c;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  text-align: center;
}

#clear-completed:hover {
  background-color: #f5c0c0;
}

#clear-completed:active {
  transform: scale(0.98);
}

/* ── CONFIRM OVERLAY ───────────────────────── */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 20px; /* evita colar nas bordas no mobile */
}

.confirm-overlay--visible {
  opacity: 1;
}

.confirm-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  transform: scale(0.92) translateY(10px);
  transition: transform 0.25s ease;
}

.confirm-overlay--visible .confirm-box {
  transform: scale(1) translateY(0);
}

.confirm-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 8px;
}

.confirm-desc {
  font-size: 13px;
  color: #8faab1;
  margin-bottom: 28px;
}

.confirm-buttons {
  display: flex;
  gap: 10px;
}

.confirm-btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.confirm-btn:hover {
  opacity: 0.85;
}

.confirm-btn:active {
  transform: scale(0.96);
}

.confirm-btn--cancel {
  background: #f1f7f9;
  color: #5a7a84;
}

.confirm-btn--delete {
  background: #fde2e2;
  color: #e74c3c;
}

/* ── TOAST ← também não existia no CSS original ───────────────────────── */

.app-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #2c3e50;
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
}

.app-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-toast--limit .toast-icon {
  color: #e74c3c;
}

.app-toast--empty .toast-icon {
  color: #6ec6d9;
}

/* ── MOBILE ───────────────────────── */

@media (max-width: 600px) {
  .header h1 {
    font-size: 28px;
    letter-spacing: 4px;
  }

  .header h2 {
    font-size: 11px;
  }

  .ToDo-Container {
    flex-direction: column;
    gap: 10px;
    margin: 20px 10px;
  }

  .input-tarefa {
    font-size: 16px; /* evita zoom automático no iOS */
  }

  .add-task-button {
    width: 100%;
    height: 48px;
  }

  .tabs {
    margin: 0 10px 16px;
  }

  .lista-tarefas {
    padding: 0 10px;
  }

  .task-item {
    padding: 14px;
    gap: 10px;
  }

  .btn-done,
  .btn-edit,
  .btn-delete {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .task-text {
    font-size: 14px;
  }

  .clear-completed {
    margin: 12px 10px 24px;
    padding: 0;
  }

  .app-toast {
    bottom: 20px;
    font-size: 13px;
    padding: 10px 16px;
    max-width: calc(100vw - 40px);
    white-space: normal;
    text-align: center;
  }
}