@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:Poppins,sans-serif;
}

/* ===== ROOT COLORS ===== */
:root{
  --header:#4f46e5;
  --bg:#f4f6fb;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --danger:#ef4444;
  --border:#d1d5db;
}

/* ===== DARK MODE COLORS ===== */
body.dark{
  --header:#020617;
  --bg:#020617;
  --card:#020617;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --border:#334155;
}

/* ===== BODY ===== */
body{
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
}

/* ===== MAIN APP ===== */
.app-container{
  width:100%;
  max-width:420px;
  background:var(--card);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 15px 40px rgba(0,0,0,.2);
}

/* ===== HEADER ===== */
.app-header{
  background:var(--header);
  color:white;
  padding:20px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.app-header p{
  font-size:13px;
  opacity:.85;
}

.app-header button{
  background:white;
  border:none;
  border-radius:8px;
  padding:6px 10px;
  cursor:pointer;
  font-size:16px;
}

/* ===== BODY ===== */
.app-body{
  padding:20px;
}

/* ===== FORM ===== */
.todo-form{
  display:flex;
  gap:10px;
}

.todo-form input{
  flex:1;
  padding:12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#ffffff;
  color:#1f2937;
}

/* 🔥 DARK MODE INPUT FIX */
body.dark .todo-form input{
  background:#020617;
  color:#e5e7eb;
  border:1px solid #334155;
}

.todo-form input::placeholder{
  color:#9ca3af;
}

body.dark .todo-form input::placeholder{
  color:#94a3b8;
}

.todo-form input:focus{
  outline:none;
  border-color:var(--header);
}

.todo-form button{
  background:var(--header);
  color:white;
  border:none;
  padding:12px 16px;
  border-radius:10px;
  cursor:pointer;
}

#formNote{
  display:block;
  margin-top:6px;
  font-size:13px;
  color:var(--muted);
}

/* ===== STATS ===== */
.stats-row{
  margin:15px 0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:14px;
}

/* 🔴 CLEAR ALL BUTTON */
.clear-btn{
  background:var(--danger);
  color:white;
  border:none;
  padding:8px 14px;
  border-radius:8px;
  cursor:pointer;
}

/* ===== TASK LIST ===== */
.task-item{
  background:#f1f5f9;
  padding:12px;
  border-radius:12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;

  /* ✨ SHADOW + ANIMATION */
  box-shadow:0 8px 20px rgba(0,0,0,.15);
  animation:slideIn .3s ease;
}

body.dark .task-item{
  background:#020617;
  box-shadow:0 8px 20px rgba(0,0,0,.6);
}

@keyframes slideIn{
  from{
    opacity:0;
    transform:translateY(12px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

.task-content{
  display:flex;
  gap:8px;
  align-items:center;
}

.task-content span{
  font-size:14px;
}

.task-content.completed span{
  text-decoration:line-through;
  opacity:.6;
}

/* ===== TASK BUTTONS ===== */
.task-actions button{
  border:none;
  padding:6px 10px;
  border-radius:6px;
  margin-left:4px;
  cursor:pointer;
  font-size:12px;
}

.update-btn{
  background:#22c55e;
  color:white;
}

.delete-btn{
  background:#ef4444;
  color:white;
}

/* ===== MODAL ===== */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  display:none;
  justify-content:center;
  align-items:center;
}

.modal-box{
  background:white;
  padding:20px;
  border-radius:12px;
  width:85%;
  max-width:300px;
}

body.dark .modal-box{
  background:#020617;
  color:#e5e7eb;
}

/* ===== MODAL ACTIONS ===== */
.modal-actions{
  margin-top:15px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* ✅ CANCEL BUTTON FIXED */
.cancel-btn{
  background:#e5e7eb;
  border:none;
  padding:8px 14px;
  border-radius:8px;
  cursor:pointer;
}

body.dark .cancel-btn{
  background:#1e293b;
  color:#e5e7eb;
}

.danger-btn{
  background:var(--danger);
  color:white;
  border:none;
  padding:8px 14px;
  border-radius:8px;
  cursor:pointer;
}
