/* --- 全体リセットと基本フォント --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  background-color: #f9f9f9;
  color: #333;
  padding: 20px;
}

/* --- ヘッダー --- */
header {
  background-color: #4CAF50;
  color: white;
  padding: 1em;
  margin-bottom: 2em;
  border-radius: 8px;
}

header h1 {
  font-size: 1.8em;
}

nav a {
  color: white;
  text-decoration: underline;
  font-weight: bold;
  display: inline-block;
  margin-top: 0.5em;
}

/* --- メインのセクション --- */
main section {
  background-color: white;
  padding: 1em 1.5em;
  margin-bottom: 1.5em;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

main h2 {
  color: #4CAF50;
  margin-bottom: 0.5em;
}

/* --- フォームと入力 --- */
form {
  display: flex;
  gap: 10px;
}

input[type="text"] {
  flex: 1;
  padding: 0.5em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

button {
  padding: 0.5em 1em;
  font-size: 1em;
  border: none;
  background-color: #4CAF50;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #45a049;
}

/* --- タスクリスト --- */
ul {
  list-style-type: none;
  padding-left: 0;
}

li {
  display: flex;
  align-items: center;
  padding: 0.6em;
  border-bottom: 1px solid #eee;
}

li span {
  flex: 1;
  margin-left: 0.5em;
}

.completed span {
  text-decoration: line-through;
  color: #888;
}

/* --- 削除ボタン --- */
.delete-btn {
  margin-left: 1em;
  background-color: #f44336;
  color: white;
  border: none;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}

.delete-btn:hover {
  background-color: #d32f2f;
}

/* --- フッター --- */
footer {
  text-align: center;
  margin-top: 2em;
  color: #666;
}


/* ポップアップ */
.popup {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

.popup-content {
  background-color: #fff;
  padding: 20px 25px;
  border: 1px solid #ccc;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  position: relative;
  transform: translateY(-10%);
  animation: fadeIn 0.2s ease-out;
}

.popup-content form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-content input[type="text"],
.popup-content button {
  width: 100%;
}

/* フェードイン効果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20%);
  }
  to {
    opacity: 1;
    transform: translateY(-10%);
  }
}


/*ケバブメニュー表示 */
.kebab {
  position: absolute;    /* 変更: relative→absolute */
  top: 10px;             /* 上から10px */
  right: 10px;            /* 左から10px */
  width: 17px;
  height: 17px;
  padding: 6px; /* 10px→6pxに調整 */
  border-radius: 50%;
  z-index: 20;           /* メニューより上に */
}

.kebab-ball {
  display: block;
  width: 4px;
  height: 4px;
  position: absolute;
  left: 50%;
  background: #000;
  border-radius: 50%;
}

.kebab-ball:nth-child(1) {
  top: 0;
  transform: translate(-50%, 0);
}

.kebab-ball:nth-child(2) {
  top: 50%;
  transform: translate(-50%, -50%);
}

.kebab-ball:nth-child(3) {
  top: 100%;
  transform: translate(-50%, -100%);
}

.kebab:hover{
  background-color: #d4d4d4;
}

/* ケバブメニュー */
.kebab-menu {
  display: none;
  position: absolute;
  top: 35px;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 10;
  min-width: 90px;
}

.kebab-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0.7em 1em;
  text-align: left;
  cursor: pointer;
  font-size: 1em;
  color: #333;
}

.kebab-menu button:hover {
  background: #f0f0f0;
}

/* --- モーダル中の背景操作禁止 --- */
body.modal-open {
  overflow: hidden;
  pointer-events: none;
}

body.modal-open .popup {
  pointer-events: auto;
}

/* --- タスクグループカード --- */
.task-group {
  border: 1px solid #ccc;
  background-color: #fff;
  padding: 1em;
  border-radius: 8px;
  margin-top: 1.0em;
  margin-bottom: 1.0em;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
  position: relative; /* 追加: ケバブの絶対配置の基準に */
}

.task-group h3 {
  margin-bottom: 0.3em;
  color: #4CAF50;
}

.task-group p {
  font-size: 0.95em;
  color: #666;
  margin-bottom: 1em;
}

.task-group form {
  margin-bottom: 1em;
}

.task-form {
  margin-bottom: 1em;
  background-color: #f5f5f5;
  padding: 0.75em;
  border-radius: 6px;
}

.task-label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5em;
  color: #333;
}

.task-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.task-input,
.task-date {
  padding: 0.5em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
  flex: 1;
}

.task-date {
  max-width: 160px;
}

.task-progress {
  font-size: 0.9em;
  color: #4CAF50;
  font-weight: bold;
  margin-bottom: 0.6em;
}

/* --- 学習目次（.toc） --- */
nav.toc {
  background-color: #eafbea;
  border: 1px solid #c3e6cb;
  padding: 1em 1.5em;
  border-radius: 8px;
  margin-bottom: 2em;
  box-shadow: 0 0 4px rgba(0,0,0,0.05);
}

nav.toc h2 {
  font-size: 1.2em;
  color: #388e3c;
  margin-bottom: 0.6em;
}

nav.toc ol {
  list-style-type: decimal;
  padding-left: 1.2em;
  line-height: 1.8;
}

nav.toc li a {
  color: #2e7d32;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.2s ease;
}

nav.toc li a:hover {
  text-decoration: underline;
  color: #1b5e20;
}

nav.toc .app-link {
  display: inline-block;
  margin-top: 1em;
  padding: 0.4em 1em;
  background-color: #4CAF50;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
}

nav.toc .app-link:hover {
  background-color: #43a047;
}

pre {
  background-color: #f6f8fa;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.8em;
  margin: 1em 0;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95em;
  line-height: 1.6;
}

code {
  font-family: Consolas, Monaco, 'Courier New', monospace;
  color: #2d2d2d;
  display: block;
}
