/* Todos Page Header */
.todos-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.todos-page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #e2e8f0;
}

/* Todos list creation form */
.todos-list-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.todos-list-form input {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #2d2d3a;
  background: #1a1a24;
  color: #e2e8f0;
  font-size: 0.875rem;
  outline: none;
  width: 200px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.todos-list-form input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.todos-list-form button {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}

.todos-list-form button:hover {
  background: #4f52d4;
}

.todos-list-form button:active {
  transform: scale(0.98);
}

/* Container for Todo Cards */
.todos-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

/* Todo Card */
.todo-card {
  width: 320px;
  background: #1a1a24;
  border: 1px solid #2d2d3a;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.todo-card:hover {
  border-color: #3b3b4f;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* Card Header */
.todo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2d2d3a;
  padding-bottom: 0.75rem;
}

.todo-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.todo-card-title:hover {
  background: #272738;
}

/* Card Header Inline Edit Form */
.todo-card-edit-form {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.todo-card-edit-form input {
  flex: 1;
  padding: 0.2rem 0.4rem;
  background: #0f0f13;
  border: 1px solid #6366f1;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.95rem;
  outline: none;
}

/* Delete Card Button */
.todo-card-delete-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.todo-card-delete-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* Card Add Item Form */
.todo-card-add-form {
  display: flex;
  gap: 0.5rem;
}

.todo-card-add-form input {
  flex: 1;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #2d2d3a;
  background: #0f0f13;
  color: #e2e8f0;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}

.todo-card-add-form input:focus {
  border-color: #6366f1;
}

.todo-card-add-form button {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.todo-card-add-form button:hover {
  background: #4f52d4;
}

/* Todo Items List */
.todo-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Todo Scrollbar */
.todo-items-list::-webkit-scrollbar {
  width: 4px;
}
.todo-items-list::-webkit-scrollbar-track {
  background: transparent;
}
.todo-items-list::-webkit-scrollbar-thumb {
  background: #2d2d3a;
  border-radius: 2px;
}

/* Todo Item Row */
.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  border-radius: 6px;
  background: #222230;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.todo-item:hover {
  background: #272738;
  border-color: #2d2d3a;
}

.todo-item-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

/* Custom checkbox wrapper */
.todo-checkbox {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid #64748b;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.todo-checkbox::after {
  content: "✓";
  font-size: 0.75rem;
  color: #fff;
  display: none;
  font-weight: bold;
}

.todo-item.completed .todo-checkbox {
  background: #3b82f6;
  border-color: #3b82f6;
}

.todo-item.completed .todo-checkbox::after {
  display: block;
}

.todo-item-text {
  font-size: 0.875rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  transition: color 0.15s, text-decoration 0.15s;
}

.todo-item.completed .todo-item-text {
  text-decoration: line-through;
  color: #64748b;
}

/* Delete Item Button */
.todo-item-delete-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.todo-item:hover .todo-item-delete-btn {
  opacity: 1;
}

.todo-item-delete-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}
