body {
  font-family: sans-serif;
  background: #f2f2f2;
  padding: 20px;
}

h2 {
  text-align: center;
  margin-bottom: 20px;
}

/* ---------- Progress Bar ---------- */
.progress-container {
  width: 100%;
  background: #bebcbc;
  border-radius: 10px;
  overflow: hidden;
  height: 20px;
  margin-bottom: 10px;
}
.progress-bar {
  width: 0%;
  height: 100%;
  background: #4caf50;
  transition: width 0.5s ease;
}
#progress-text {
  text-align: center;
  margin-bottom: 20px;
}

/* ---------- Achievements ---------- */
.achievement {
  background: rgb(211, 209, 209);
  padding: 10px 15px;
  margin: 10px 0;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease;
}

.achievement.done {
  background: #b6f7b6;
}

/* ---------- Main Title ---------- */
.main-title {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 6px;
}

.main-title input[type="checkbox"] {
  transform: scale(1.5);
  margin-right: 8px;
}

.mainCheck {
  pointer-events: none; /* ป้องกันการคลิก */
}
/* ---------- ตัวเลขนับจำนวน (x/x) ---------- */
.sub-count {
  margin-left: auto;
  margin-right: 1px;
  font-size: 14px;
  color: #000000;
  min-width: 45px;
  text-align: right;
}

/* ---------- ลูกศร Dropdown ---------- */
.toggle {
  font-size: 22px;
  color: rgb(17, 0, 255);
  cursor: pointer;
  user-select: none;
  padding: 5px 10px;
  transition: transform 0.2s ease, color 0.2s ease;
}
.toggle:hover {
  transform: scale(1.2);
  color: rgb(18, 1, 255);
}

/* ---------- Sub List ---------- */
.sub-list {
  margin-left: 30px;
  margin-top: 8px;
  display: none;
}

.sub-item {
  display: flex;
  align-items: center;
  background: #ffffff;
  margin: 5px 0;
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background-color 0.3s;
}

.sub-item.done {
  background: #c6ffc6;
}

.sub-item input[type="checkbox"] {
  transform: scale(1.2);
  margin-right: 10px;
  cursor: pointer;
}

/* ---------- กล่องแสดงผล % สำเร็จ ---------- */
.progress-box {
  max-width: 500px;
  margin: 0 auto 25px auto;
  background: #ffffff;
  border: 2px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 15px 20px;
  text-align: center;
}

#progress-text {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #2c662d;
}

.progress-container {
  width: 100%;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  height: 20px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #66bb6a, #43a047);
  transition: width 0.5s ease;
}

/* ✅ เพิ่มตรงนี้ให้ checkbox ทุกอันเป็นสีฟ้า */
input[type="checkbox"] {
  accent-color: #2196F3 !important;
}

/* ✅ ให้ main-title ทั้งบล็อกคลิกได้ */
.main-title {
  user-select: none;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.main-title:hover {
  background-color: #d8f3ff; 
}
