/**
 * 主なセクション:
 * - 機能カード: 各機能を表示するカードのスタイル
 */



/* ===== 目次生成機能カードのスタイル ===== */
.features {
  padding: 2rem 2rem;
  background-color: var(--background-color);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 0.8rem;
  max-width: 1200px;
  margin: auto;
}

.feature-card {
  background-color: white;
  padding: 0.8rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: 0 2px 20px rgba(139, 156, 219, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 25px rgba(139, 156, 219, 0.2);
  background-color: var(--background-color);
}

.icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.feature-card p {
  font-size: 0.75rem;
  margin-bottom: 0.3rem;
}



/* ===== ドラッグ＆ドロップのスタイル ===== */
.drag-drop-container {
  background-color: #f9f9f9;  /* 背景色: 薄いグレー */
  border: 2px dashed #ccc;    /* 枠線: 2pxの破線、色は薄いグレー */
  border-radius: 10px;        /* 角の丸み: 10px */
  padding: 20px;              /* 内側の余白: 上下左右40px（より大きく） */
  text-align: center;         /* テキスト配置: 中央揃え */
  margin-top: 30px;           /* 上側の外余白: 30px */
  cursor: pointer;            /* マウスカーソル: ポインター（クリック可能を示す） */
  transition: all 0.3s ease;  /* トランジション: すべてのプロパティに0.3秒のイージング */
}

.drag-drop-container:hover {
  background-color: #f0f5ff;  /* ホバー時の背景色: 薄い青 */
  border-color: var(--secondary-color); /* ホバー時の枠線色: セカンダリカラー */
}

.drag-drop-container p {
  margin: 0;                  /* 段落の余白: なし */
  font-size: 1.2rem;          /* 文字サイズ: 1.2rem */
  color: #666;                /* 文字色: 中間グレー */
}

.drag-drop-container::after {
  content: "または、クリックしてファイルを選択";  /* 追加テキスト */
  display: block;             /* 表示: ブロック要素として */
  font-size: 0.9rem;          /* 文字サイズ: 0.9rem（小さめ） */
  color: #999;                /* 文字色: 薄いグレー */
  margin-top: 10px;           /* 上側の余白: 10px */
}



/* ===== アップロードボタンのスタイル ===== */
.upload-button-container {
  margin-top: 20px;           /* 上側の余白: 20px */
  text-align: center;         /* テキスト配置: 中央揃え */
}

.upload-btn {
  background-color: var(--primary-color, #4a6bdf); /* 背景色: プライマリカラー */
  color: white;               /* 文字色: 白 */
  border: none;               /* 枠線: なし */
  border-radius: 5px;         /* 角の丸み: 5px */
  padding: 12px 30px;         /* 内側の余白: 上下12px、左右30px */
  font-size: 1rem;            /* 文字サイズ: 1rem */
  font-weight: bold;          /* 文字の太さ: 太字 */
  cursor: pointer;            /* マウスカーソル: ポインター */
  transition: background-color 0.2s ease; /* トランジション: 背景色のみ変化 */
  box-shadow: 0 2px 5px rgba(74, 107, 223, 0.2); /* 影: 控えめな影 */
}

.upload-btn:hover {
  background-color: #7a8bc7; /* ホバー時の背景色: プライマリカラーより薄い色 */
}

.upload-btn:active {
  background-color: #3a5bcf; /* クリック時の背景色: プライマリカラーより濃い色 */
}



/* ===== 結果表示ボックスのスタイル ===== */
.result-container {
  margin-top: 30px;           /* 上側の余白: 30px */
  background-color: white;    /* 背景色: 白 */
  border-radius: 10px;        /* 角の丸み: 10px */
  padding: 20px;              /* 内側の余白: 20px */
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1); /* 影: 軽い影 */
  display: none;              /* 初期表示: 非表示 */
  animation: fadeIn 0.5s ease; /* アニメーション: フェードイン */
}

.result-header {
  display: flex;              /* 表示: フレックスボックス */
  justify-content: space-between; /* 横方向の配置: 両端揃え */
  align-items: center;        /* 縦方向の配置: 中央揃え */
  margin-bottom: 15px;        /* 下側の余白: 15px */
  padding-bottom: 10px;       /* 下側の内側余白: 10px */
  border-bottom: 1px solid #eee; /* 下線: 1pxの実線、色は薄いグレー */
}

.result-title {
  font-size: 1.2rem;          /* 文字サイズ: 1.2rem */
  color: var(--primary-color); /* 文字色: プライマリカラー */
  font-weight: bold;          /* 文字の太さ: 太字 */
}

.result-content {
  max-height: 400px;          /* 最大高さ: 400px */
  overflow-y: auto;           /* 縦方向のスクロール: 自動 */
  padding: 20px;              /* 内側の余白: 20px */
  background-color: #f9f9f9;  /* 背景色: 薄いグレー */
  border-radius: 5px;         /* 角の丸み: 5px */
}

.result-table {
  width: 100%;                /* 幅: 100% */
  border-collapse: collapse;  /* 境界線の結合: 結合する */
}

.result-table th, .result-table td {
  padding: 8px 12px;          /* 内側の余白: 上下8px、左右12px */
  text-align: left;           /* テキスト配置: 左揃え */
  border-bottom: 1px solid #eee; /* 下線: 1pxの実線、色は薄いグレー */
}

.result-table th {
  background-color: #f0f5ff;  /* 背景色: 薄い青 */
  color: var(--primary-color); /* 文字色: プライマリカラー */
  font-weight: bold;          /* 文字の太さ: 太字 */
}

.result-table tr:hover {
  background-color: #f5f5f5;  /* ホバー時の背景色: 薄いグレー */
}

/* フォントサイズ設定のスタイル */
.font-size-settings {
  padding: 10px;              /* 内側の余白: 10px */
}

.setting-group {
  margin-bottom: 20px;        /* 下側の余白: 20px */
  padding-bottom: 15px;       /* 下側の内側余白: 15px */
  border-bottom: 1px solid #eee; /* 下線: 1pxの実線、色は薄いグレー */
}

.setting-group:last-child {
  border-bottom: none;        /* 最後の要素の下線: なし */
  margin-bottom: 0;           /* 最後の要素の下側の余白: なし */
  padding-bottom: 0;          /* 最後の要素の下側の内側余白: なし */
}

.setting-header {
  display: flex;              /* 表示: フレックスボックス */
  justify-content: space-between; /* 横方向の配置: 両端揃え */
  align-items: center;        /* 縦方向の配置: 中央揃え */
  margin-bottom: 10px;        /* 下側の余白: 10px */
}

.setting-group label {
  display: block;             /* 表示: ブロック要素として */
  margin-bottom: 8px;         /* 下側の余白: 8px */
  font-weight: 500;           /* 文字の太さ: 500 */
  color: #555;                /* 文字色: 濃いグレー */
}

/* フォントサイズ入力フィールドのスタイル */
.form-group {
  margin-bottom: 2.5rem;
}

/* TOCコンテンツセクションのスタイル */
.tool-content {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  max-width: 1000px;
  padding: 2rem;
  position: relative;
}

.tool-header {
  align-items: center;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.tool-header h2 {
  color: var(--primary-color);
  font-size: 1.8rem;
  margin: 0;
}

.close-tool-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.5rem;
  height: 30px;
  line-height: 30px;
  padding: 0;
  text-align: center;
  transition: color 0.3s ease;
  width: 30px;
}

.close-tool-btn:hover {
  color: #333;
}

.tool-container {
  min-height: 300px;
}

.loading {
  align-items: center;
  color: #666;
  display: flex;
  font-size: 1.2rem;
  height: 200px;
  justify-content: center;
  width: 100%;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.position-inputs {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  justify-content: space-between; /* 要素を両端に配置 */
}

.input-group {
  display: flex;
  align-items: center;
  flex: 1;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background-color: white;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 156, 219, 0.2);
}

.remove-btn {
  background-color: #ff6b6b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
  margin-left: 10px;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0; /* 削除ボタンのサイズを固定 */
}

.remove-btn:hover {
  background-color: #ff5252;
}

.add-btn {
  background-color: transparent;
  color: var(--primary-color);
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
}

.add-btn:hover {
  background-color: transparent;
  color: rgba(139, 156, 219, 0.7);
}


.size-input-container {
  display: flex;              /* 表示: フレックスボックス */
  align-items: center;        /* 縦方向の配置: 中央揃え */
  max-width: 150px;           /* 最大幅: 150px */
}

.font-size-input {
  width: 70px;                /* 幅: 70px */
  padding: 8px;               /* 内側の余白: 8px */
  border: 1px solid #ddd;     /* 枠線: 1pxの実線、色は薄いグレー */
  border-radius: 4px;         /* 角の丸み: 4px */
  font-size: 1rem;            /* 文字サイズ: 1rem */
  text-align: center;         /* テキスト配置: 中央揃え */
}

.unit {
  margin-left: 5px;           /* 左側の余白: 5px */
  color: #666;                /* 文字色: 中間グレー */
}

/* レベル追加ボタンのスタイル */
.add-level-container {
  margin: 20px 0;             /* 余白: 上下20px、左右0 */
  text-align: center;         /* テキスト配置: 中央揃え */
}

.add-level-btn {
  background-color: #f0f5ff;  /* 背景色: 薄い青 */
  color: var(--primary-color); /* 文字色: プライマリカラー */
  border: 1px dashed var(--primary-color); /* 枠線: 1pxの破線、色はプライマリカラー */
  border-radius: 4px;         /* 角の丸み: 4px */
  padding: 8px 15px;          /* 内側の余白: 上下8px、左右15px */
  font-size: 0.9rem;          /* 文字サイズ: 0.9rem */
  cursor: pointer;            /* マウスカーソル: ポインター */
  transition: all 0.2s ease;  /* トランジション: すべてのプロパティに0.2秒のイージング */
}

.add-level-btn:hover {
  background-color: #e0e8ff;  /* ホバー時の背景色: やや濃い薄い青 */
}

/* レベル削除ボタンのスタイル */
.level-controls {
  display: flex;              /* 表示: フレックスボックス */
  align-items: center;        /* 縦方向の配置: 中央揃え */
}

.remove-level-btn {
  background-color: transparent; /* 背景色: 透明 */
  color: #999;                /* 文字色: 薄いグレー */
  border: none;               /* 枠線: なし */
  font-size: 1.2rem;          /* 文字サイズ: 1.2rem */
  cursor: pointer;            /* マウスカーソル: ポインター */
  padding: 0 5px;             /* 内側の余白: 上下0、左右5px */
  transition: color 0.2s ease; /* トランジション: 色のみ変化 */
}

.remove-level-btn:hover {
  color: #e74c3c;             /* ホバー時の文字色: 赤 */
}

.remove-level-btn:disabled {
  color: #ccc;                /* 無効時の文字色: 薄いグレー */
  cursor: not-allowed;        /* マウスカーソル: 禁止 */
}

.download-btn {
  background-color: var(--primary-color, #4a6bdf); /* 背景色をプライマリカラーに変更 */
  color: white;               /* 文字色: 白 */
  border: none;               /* 枠線: なし */
  border-radius: 5px;         /* 角の丸み: 5px */
  padding: 8px 15px;          /* 内側の余白: 上下8px、左右15px */
  font-size: 0.9rem;          /* 文字サイズ: 0.9rem */
  cursor: pointer;            /* マウスカーソル: ポインター */
  transition: background-color 0.2s ease; /* トランジション: 背景色のみ変化 */
  box-shadow: 0 2px 5px rgba(74, 107, 223, 0.2); /* 影を追加 */
}

.download-btn:hover {
  background-color: #7a8bc7; /* ホバー時の背景色: プライマリカラーより薄い色 */
}

.download-btn:active {
  background-color: #3a5bcf; /* クリック時の背景色: プライマリカラーより濃い色 */
}

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

/* 太字選択プルダウンのスタイル */
.bold-select {
  margin-left: 8px;
  margin-right: 8px;
  width: auto;
  flex-shrink: 0;
}

.font-style-select {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  color: #555;
  cursor: pointer;
  transition: border-color 0.3s;
  height: 100%;
  box-sizing: border-box;
}

.font-style-select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 156, 219, 0.2);
}

/* ===== 追加: エラーメッセージと成功メッセージのスタイル ===== */
.error-message {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
  border-radius: 4px;
  padding: 10px 15px;
  margin-top: 15px;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

.success-message {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  border-radius: 4px;
  padding: 10px 15px;
  margin-top: 15px;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

.download-area {
  margin-top: 20px;
  text-align: center;
}

.download-btn {
  display: inline-block;
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.download-btn:hover {
  background-color: #45a049;
}

/* ダウンロードアイコンを追加 */
.download-btn::before {
  content: "⬇ ";
  margin-right: 5px;
}

/* ボタンのスタイル調整 */
#generate-btn {
  display: none; /* 初期状態では非表示 */
  margin-top: 15px;
  background-color: var(--primary-color, #4a6bdf);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#generate-btn:hover {
  background-color: #3a5bcf;
  transform: translateY(-2px);
}

.generate-btn {
  background-color: var(--primary-color, #4a6bdf);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.generate-btn:hover {
  background-color: #3a5bcf;
  transform: translateY(-2px);
}

/* 太字チェックボックスのスタイル */
.bold-checkbox {
  display: flex;
  align-items: center;
  margin-left: 10px;
  white-space: nowrap;
}

.bold-checkbox input[type="checkbox"] {
  margin-right: 5px;
}

.bold-checkbox label {
  margin-bottom: 0;
  font-weight: 500;
}

.bold-checkbox span {
  margin-left: 3px;
  color: #666;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  .input-wrapper {
    flex-direction: column;
  }
  
  .input-group {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .bold-checkbox {
    margin-left: 0;
    margin-top: 5px;
  }
}

/* ===== プログレスバーのスタイル ===== */
.progress-container {
  margin-top: 20px;
  margin-bottom: 20px;
}

.progress {
  height: 20px;
  background-color: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color, #4a6bdf);
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  margin-top: 5px;
  font-size: 0.9em;
  color: #666;
}