/* styles.css */

/* Variáveis de cor para fácil ajuste */
:root{
  --bg: #0f1724; /* fundo */
  --card: #0b1220;
  --muted: #9aa4b2;
  --fg: #e6eef6;
  --primary: #2563eb;
  --destructive: #ef4444;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(2,6,23,0.6);
  --max-width: 720px;
}

/* Reset simples */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,var(--bg), #071028);
  color:var(--fg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Container central */
.app-container{
  min-height:100vh;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:4rem 1rem;
}

/* Card principal */
.card{
  width:100%;
  max-width:var(--max-width);
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:16px;
  padding:20px;
  box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,0.03);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:focus-within{transform:translateY(-4px);box-shadow:0 14px 40px rgba(2,6,23,0.6)}

/* Layout do conteúdo */
.header{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:1rem;
}
.logo{
  width:48px;height:48px;border-radius:12px;
  background:linear-gradient(135deg,var(--primary), #1e40af);
  display:flex;align-items:center;justify-content:center;font-size:20px;
  box-shadow:0 8px 30px rgba(37,99,235,0.15);
}
.title{margin:0;font-size:1.4rem;font-weight:700}
.subtitle{margin:0;color:var(--muted);font-size:0.95rem}

/* Input row */
.input-row{
  display:flex;
  gap:8px;
  margin-bottom:1rem;
}
.input-row input{
  flex:1;height:48px;padding:0 14px;border-radius:12px;border:1px solid rgba(255,255,255,0.05);
  background:var(--card);color:var(--fg);outline:none;box-shadow:var(--shadow);
  font-size:1rem;
  transition:box-shadow .12s ease, transform .12s ease, border-color .12s ease;
}
.input-row button{
  width:48px;height:48px;border-radius:12px;border:0;background:var(--primary);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:18px;cursor:pointer;
}
.input-row button:hover{background:#1d4ed8}
.input-row input:focus{box-shadow:0 8px 30px rgba(37,99,235,0.12);transform:translateY(-1px);border-color:rgba(37,99,235,0.45)}

/* Filtros */
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:0.75rem;flex-wrap:wrap}
.filters{display:inline-flex;gap:6px;padding:4px;border-radius:12px;background:rgba(255,255,255,0.02)}
.filter-btn{padding:6px 12px;border-radius:8px;border:0;background:transparent;color:var(--muted);cursor:pointer;transition:background .12s ease,color .12s ease}
.filter-btn:hover{background:rgba(255,255,255,0.04)}
.filter-btn.active{background:var(--card);color:var(--fg);box-shadow:0 4px 12px rgba(2,6,23,0.45)}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.actions .ghost{background:transparent;border:0;color:var(--muted);cursor:pointer;padding:8px 10px;border-radius:8px;transition:background .12s ease,color .12s ease,opacity .12s ease}
.actions .ghost:hover:not(:disabled){color:var(--fg);background:rgba(255,255,255,0.03)}
.actions .ghost:disabled{opacity:.45;cursor:not-allowed}

/* Lista */
.list{display:flex;flex-direction:column;gap:8px}
.empty{padding:3rem 1rem;text-align:center;color:var(--muted)}

/* Item */
.todo-item{
  display:flex;align-items:center;gap:12px;padding:14px;border-radius:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
  border:1px solid rgba(255,255,255,0.03);box-shadow:0 6px 18px rgba(2,6,23,0.45);
  transform:translateY(6px);opacity:0;transition:transform .28s cubic-bezier(.2,.9,.2,1),opacity .28s ease,box-shadow .18s ease;
}
.todo-item:hover{box-shadow:0 10px 24px rgba(2,6,23,0.4)}
.check-btn{
  width:36px;height:36px;border-radius:8px;border:2px solid rgba(255,255,255,0.08);
  display:flex;align-items:center;justify-content:center;cursor:pointer;background:transparent;transition:border-color .12s ease,background .12s ease;
}
.check-btn:hover{border-color:rgba(37,99,235,0.35);background:rgba(37,99,235,0.06)}
.todo-text{flex:1;font-size:0.95rem;word-break:break-word;transition:color .12s ease}
.todo-text.done{text-decoration:line-through;color:var(--muted)}
.del-btn{
  width:36px;height:36px;border-radius:8px;border:0;background:transparent;cursor:pointer;color:var(--muted);transition:background .12s ease,color .12s ease;
}
.del-btn:hover{background:rgba(239,68,68,0.07);color:var(--destructive)}

.edit-input{
  flex:1;height:40px;padding:10px 12px;border-radius:10px;border:1px solid rgba(255,255,255,0.15);
  background:rgba(255,255,255,0.05);color:var(--fg);outline:none;font-size:1rem;
}
.edit-input:focus{border-color:rgba(37,99,235,0.45);box-shadow:0 0 0 3px rgba(37,99,235,0.12)}

.todo-item.visible{transform:none;opacity:1}

/* foco acessível via teclado apenas */
button:focus-visible, input:focus-visible{outline:2px solid rgba(37,99,235,0.55);outline-offset:2px}

.footer{margin-top:14px;text-align:center;color:var(--muted);font-size:0.85rem}

@media (max-width:520px){
  .card{padding:14px;border-radius:12px}
  .logo{width:40px;height:40px}
  .input-row{flex-direction:column}
  .input-row button{width:100%}
  .actions{width:100%;justify-content:flex-start}
}
