/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, sans-serif;
}

/* ===== BODY ===== */
body {
  height: 100vh;
  background: linear-gradient(135deg, #d1fae5, #ecfeff);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;

  animation: bodyFade 1s ease;
}

/* ===== MAIN CONTAINER ===== */
#main {
  width: 420px;
  background: #ffffff;
  padding: 26px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);

  animation: containerIn 0.8s ease;
}

/* ===== HEADING ===== */
#heading {
  text-align: center;
  font-size: 24px;
  color: #065f46;
  margin-bottom: 20px;

  animation: fadeDown 0.6s ease;
}

/* ===== INPUT ===== */
#input-bar {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid #99f6e4;
  outline: none;
  font-size: 15px;
  margin-bottom: 14px;

  transition:
    border 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.25s ease;
}

#input-bar:focus {
  border-color: #10b981;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.25);
  transform: scale(1.02);
}

/* ===== ADD BUTTON ===== */
#btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: white;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 18px;

  transition:
    transform 0.2s ease,
    box-shadow 0.25s ease;
}

#btn:hover {
  box-shadow: 0 14px 30px rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
}

#btn:active {
  transform: scale(0.96);
}

/* ===== TASK LIST ===== */
#task-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

#task-list::-webkit-scrollbar {
  display: none;
}
#task-list {
  scrollbar-width: none;
}

/* ===== TASK ITEM ===== */
#task-list > div {
  background: #f9fafb;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;

  display: flex;
  align-items: center;
  gap: 10px;

  /* NO SHADOW */
  box-shadow: none;
  border: 1px solid #e5e7eb;

  animation: taskIn 0.45s ease;
  transition:
    transform 0.25s ease,
    background 0.25s ease;
}

#task-list > div:hover {
  background: #ecfeff;
  transform: translateY(-2px);
}

/* ===== REMOVE SHADOW ON FOCUS / ACTIVE ===== */
#task-list > div:focus,
#task-list > div:active,
#task-list > div:focus-within {
  box-shadow: none !important;
}

/* ===== TASK TEXT ===== */
#task-list p {
  flex: 1;
  font-size: 15px;
  color: #064e3b;

  animation: fadeIn 0.4s ease;
}

/* ===== TASK BUTTONS ===== */
#task-list button {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  cursor: pointer;

  /* remove default focus shadow */
  outline: none;
  box-shadow: none !important;

  transition:
    transform 0.2s ease,
    background 0.25s ease;
}

/* Remove shadow on all button states */
#task-list button:focus,
#task-list button:active,
#task-list button:focus-visible {
  outline: none;
  box-shadow: none !important;
}

/* Edit */
#task-list button:first-of-type {
  background: #cffafe;
  color: #155e75;
}

#task-list button:first-of-type:hover {
  transform: scale(1.08);
}

/* Remove */
#task-list button:last-of-type {
  background: #fee2e2;
  color: #991b1b;
}

#task-list button:last-of-type:hover {
  transform: scale(1.08);
}

/* ===== ANIMATIONS ===== */
@keyframes bodyFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes containerIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes taskIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
