body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background: #f5f6fa;
  background: linear-gradient(
     90deg, /* gradient direction from left to right */
     #5a2a0c,
     #7f2c3f,
     #662f5c,
     #0e4057,
     #1a7d7c,
     #24786a 
  );
}
h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #f5f6fa;
  text-decoration: solid #1a7d7c underline;
}
#board {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 10px;
}
.card {
  background: #e1e4e8;
  padding: 10px;
  border-radius: 8px;
  width: 250px;
  flex-shrink: 0;   /* card maintain its width */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: auto;
}
.controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.cardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    90deg,
    #5a2a0c,
    #7f2c3f,
    #662f5c,
    #0e4057,
    #24786a 
  );
  padding: 8px;
  border-radius: 8px 8px 0 0;
  color: white;
}
.cardHeader input {
  flex: 1;
  font-size: 16px;
  font-weight: bold;
  border: none;
  background: transparent;
  outline: none;
}
.task {
  background: white;
  padding: 6px;
  border-radius: 5px;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  align-items: center;
  overflow: hidden;
  word-break: break-all;
  min-width: 0;
}
.task span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  display: inline-block;
}
.task.done span {
  text-decoration: line-through;
  color: gray;
}
button {
  border-radius: 4px;
  background: linear-gradient(90deg, #1a7d7c, #24786a);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
}
button:hover {
  background: linear-gradient(90deg, #24786a, #1a7d7c);
}
.controls button {
  margin-left: 4px;
}
#addCardBtn {
  display: block; 
  margin: 0 auto 20px auto; 
  padding: 10px 20px;
  background: linear-gradient(90deg, #1a7d7c, #24786a);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}
#addCardBtn:hover {
  background: linear-gradient(90deg, #24786a, #1a7d7c);
}
input[type="text"] {
  padding: 5px;
  width: 95%; 
  max-width: 100%; 
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box; 
}
@media (max-width: 768px) {
  #board {
    flex-direction: column;
    align-items: center;
  }
  .card {
    width: 90%;
  }
}
