/* ====== SORA Dashboard 完全CSS統一版（2025-05-01） ====== */

/* ---------- 基本レイアウト ---------- */
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  padding: 10px 20px;
  border-bottom: 1px solid #dee2e6;
}

.logo {
  font-weight: bold;
  font-size: 20px;
}

.user-info {
  font-size: 14px;
}

.container {
  display: flex;
}

.sidebar {
  width: 240px;
  background-color: #ffffff;
  border-right: 1px solid #dee2e6;
  padding: 20px;
}

.main-content {
  flex-grow: 1;
  padding: 20px;
  max-width: calc(100% - 260px);
  box-sizing: border-box;
  overflow-x: auto;
}
/* ---------- セクション共通 ---------- */
.input-section,
.results-section,
.compare-section,
.canvas-section {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ---------- 入力フィールド ---------- */
.input-map-wrapper {
  display: flex;
  gap: 20px;
}

.input-fields {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-fields input,
.input-fields select,
.input-fields textarea {
  height: 40px;
  font-size: 16px;
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

.input-fields textarea {
  height: 100px;
  resize: vertical;
}

.file-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-upload-wrapper span {
  font-size: 14px;
  color: #6c757d;
}

.mini-map {
  flex: 1;
  min-width: 250px;
  min-height: 200px;
  background-color: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  cursor: pointer;
  border-radius: 8px;
}

/* ---------- カードレイアウト ---------- */
#coreMasterContainer .card {
  background-color: white;
  border-left: 8px solid #ccc;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: 0.2s;
  width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* タイトル */
#coreMasterContainer .card h3 {
  margin-top: 0.5rem;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}

#coreMasterContainer .card .label {
  font-size: 13px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
  color: white;
  white-space: nowrap;         /* 改行を防ぐ */
  overflow: hidden;            /* はみ出しを防ぐ */
  text-overflow: ellipsis;     /* 必要に応じて「…」 */
  max-width: 100%;
  text-align: center;
  line-height: 1.2;            /* ← ✅これが足りないと折り返される場合あり */
}



/* 各視点に応じた色ラベル */
.label.finance,
.viewpoint-tag.finance { background-color: #c62828; }
.label.customer,
.viewpoint-tag.customer { background-color: #1565c0; }
.label.process,
.viewpoint-tag.process { background-color: #2e7d32;  }
.label.learning,
.viewpoint-tag.learning { background-color: #f9a825; }

/* ✅ 注釈（視点の下） */
#coreMasterContainer .note {
  font-size: 9px !important;
  font-style: italic;
  color: #555;
  margin-top: 4px;
  margin-bottom: 6px;
  line-height: 1.3;
}

/* ✅ ボタン配置 */
#coreMasterContainer .button-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 1rem;
}

#coreMasterContainer .button-area button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-sizing: border-box; /* ✅ これが幅ズレ対策のポイント */
}

#coreMasterContainer .card .detail-button,
#coreMasterContainer .card .add-priority-button {
  width: 100% !important;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: block;
  text-align: center;
}


#coreMasterContainer .detail-button {
  background-color: #28a745;
  color: white;
}

#coreMasterContainer .detail-button:hover {
  background-color: #218838;
}

#coreMasterContainer .add-priority-button {
  background-color: #0d6efd;
  color: white;
}

#coreMasterContainer .add-priority-button:hover {
  background-color: #0b5ed7;
}
#coreMasterContainer .label,
#coreMasterContainer .viewpoint-tag {
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 6px;
  color: white;
  display: inline-block;       /* ✅ 横幅に合わせる */
  max-width: fit-content;      /* ✅ 最小限に収める */
  text-align: center;
  margin-bottom: 6px;
}

.viewpoint-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 4px;
  white-space: nowrap;
}

/* ✅ 注釈（視点の下） */
#coreMasterContainer .card .note,
#coreMasterContainer .card .card-note {
  font-size: 10px;
  font-style: italic;
  color: #555;
  margin-bottom: 8px;
  margin-top: 4px;
}

/* 各視点の色背景 */
.viewpoint-finance  { background-color: #c62828; }
.viewpoint-customer { background-color: #1565c0; }
.viewpoint-process  { background-color: #2e7d32; color: #fff; }
.viewpoint-learning { background-color: #f9a825; }

/* ---------- ボタンスタイル ---------- */
button {
  background-color: #007bff;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 8px;
}

button:hover {
  background-color: #0056b3;
}

#toggleNexcoBtn {
  background-color: #007bff;
  color: white;
}

#toggleNexcoBtn:hover {
  background-color: #0056b3;
}

.button-wrapper {
  display: flex;
  gap: 10px;
}

.button-wrapper button {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  font-weight: bold;
}

#generateBtn { background-color: #007bff; }
#generateBtn:hover { background-color: #0056b3; }

#analyzeBtn { background-color: #28a745; }
#analyzeBtn:hover { background-color: #1e7e34; }

.remove-btn {
  background-color: #dc3545;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

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

.detail-button,
.add-priority-button {
  width: 80%;
  padding: 10px 12px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin: 6px auto 0;
  display: block;
}

.detail-button {
  background-color: #28a745;
}
.detail-button:hover {
  background-color: #218838;
}

.add-priority-button {
  background-color: #0d6efd;
}
.add-priority-button:hover {
  background-color: #0b5ed7;
}

/* ---------- 戦略リスト（グリッド4列） ---------- */
#coreMasterContainer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ---------- レスポンシブ対応 ---------- */
#compareListContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  }
}
@media (max-width: 768px) {
  #coreMasterContainer {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  #coreMasterContainer {
    grid-template-columns: 1fr;
  }
}

/* ---------- 優先リスト ---------- */
/* ✅ 優先リストを戦略リストと同じデザインに統一 */
#compareListContainer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px;
}

@media (max-width: 768px) {
  #compareListContainer {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  #compareListContainer {
    grid-template-columns: 1fr;
  }
}

/* ✅ 優先リストのカードデザイン（戦略カードと統一） */
#compareListContainer .card {
  background-color: white;
  border-left: 8px solid #ccc;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

#compareListContainer .card h3 {
  margin-top: 0.5rem;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}

#compareListContainer .button-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 1rem;
}

#compareListContainer .button-area button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

#compareListContainer .detail-button {
  background-color: #28a745;
  color: white;
}
#compareListContainer .detail-button:hover {
  background-color: #218838;
}

#compareListContainer .openMindMapBtn {
  background-color: #0d6efd;
  color: white;
}
#compareListContainer .openMindMapBtn:hover {
  background-color: #0b5ed7;
}
#compareListContainer .card {
  width: 300px;
  max-width: 100%;
}

.label,
.viewpoint-tag {
  font-size: 0.75rem;
  padding: 4px 8px;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin: 0 auto 8px;
  display: inline-block;
}

/* ---------- アコーディオン ---------- */
.accordion-content {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-start;
}
.accordion-content .card {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* ---------- キャンバス ---------- */
#canvasResult {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 16px;
  min-height: 200px;
  background-color: #f7f7f7;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 16px;
  overflow-y: auto;
  color: #000000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ---------- NEXCO 表示 ---------- */
#nexcoInfoBox {
  display: none !important;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
  background-color: #f8f9fa;
}

#nexcoInfoBox.open {
  display: block !important;
  max-height: 1000px !important;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
}

/* ---------- ハイライト効果 ---------- */
.highlight {
  animation: blink 1.5s ease-in-out;
  border: 2px solid #0d6efd;
  border-radius: 8px;
}

@keyframes blink {
  0% { background-color: #e6f7ff; }
  50% { background-color: #cfe8ff; }
  100% { background-color: #e6f7ff; }
}

/* ---------- フッター ---------- */
footer {
  text-align: center;
  font-size: 12px;
  color: #6c757d;
  padding: 15px 0;
  border-top: 1px solid #dee2e6;
}

/* ---------- 追記 ---------- */
.label-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 8px;
}

.label-block .label {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  color: white;
  display: inline-block;
}

.label-block .viewpoint-note {
  font-size: 10px;
  font-style: italic;
  color: #555;
  line-height: 1.4;
}
/* ---------- モーダル ---------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fff;
  width: 90%;
  max-width: 1000px;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.hidden {
  display: none;
}

.close-button {
  margin-top: 16px;
  padding: 10px 20px;
  background-color: #666;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
/* --- 既存のスタイル群 --- */
#mindmapContainer {
  width: 100% !important;
  height: 100% !important;
  min-height: 600px !important;
}
.mind-elixir .root {
  max-width: 300px;
  white-space: normal !important;
  word-break: break-word;
  font-size: 16px;
  padding: 6px 10px;
}
/* === MindMap用モーダル強化スタイル2 === */
#closeMapModal {
  position: absolute;
  bottom: 16px;
  right: 20px;
  background-color: #007BFF;  /* ブルー */
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease;
}

#closeMapModal:hover {
  background-color: #0056b3;
}
.modal-save-btn {
  position: absolute;
  top: 12px;
  right: 100px;
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.modal-btn {
  padding: 10px 20px;
  font-size: 14px;
  min-width: 140px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

#saveMindMapBtn.modal-btn {
  background-color: #4CAF50;
  color: white;
}

#saveMindMapBtn.modal-btn:hover {
  background-color: #388e3c;
}

#closeMapModal.modal-btn {
  background-color: #6c757d;
  color: white;
}

#closeMapModal.modal-btn:hover {
  background-color: #5a6268;
}
/* === MindMap用モーダル強化スタイル === */
#mapModal .modal-content {
  width: 92vw !important;       /* 横幅をさらに広げる */
  height: 80vh !important;
  max-width: 1000px !important; /* 上限を復活させるのも可 */
  padding: 1rem;
  background-color: #fff;
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#mindmapContainer {
  width: 100% !important;
  height: 100% !important;
  min-height: 600px !important;
}

.mind-elixir .root {
  max-width: 300px;
  white-space: normal !important;
  word-break: break-word;
  font-size: 16px;
  padding: 6px 10px;
}

/* === MindMap用モーダル強化スタイル2（保存・閉じるボタン） === */
#closeMapModal {
  position: absolute;
  bottom: 16px;
  right: 20px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease;
}

#closeMapModal:hover {
  background-color: #0056b3;
}

.modal-save-btn {
  position: absolute;
  top: 12px;
  right: 100px;
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.modal-btn {
  padding: 10px 20px;
  font-size: 14px;
  min-width: 140px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

#saveMindMapBtn.modal-btn {
  background-color: #4CAF50;
  color: white;
}

#saveMindMapBtn.modal-btn:hover {
  background-color: #388e3c;
}

#closeMapModal.modal-btn {
  background-color: #6c757d;
  color: white;
}

#closeMapModal.modal-btn:hover {
  background-color: #5a6268;
}
/* モーダル全体の高さを固定して、中身だけスクロールさせる準備 */
#mapModal .modal-content {
  display: flex;
  flex-direction: column;
  height: 80vh;
  overflow: hidden;
}

/* 実際にマインドマップの内容をスクロールできるようにする */
#mapModal .modal-body {
  overflow-y: auto;
  flex-grow: 1;
}
#mapModal pre {
  overflow-y: auto;
  white-space: pre-wrap;
  max-width: 70ch;
  margin: 0 auto;
}
.sidebar h2 {
  font-size: 1rem; /* 通常は1.25remか1.5remくらいになっている */
  font-weight: bold;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar h2::before {
  content: "🕒";
  font-size: 1.1rem;
}
/* 親要素：ロゴ全体の配置用（すでに .logo クラスがある前提） */
.logo {
  display: flex;
  align-items: center;
  padding: 8px 16px;         /* 上下左右の余白（好みで調整OK） */
  background-color: white;  /* 任意。背景が白でない場合に */
}

/* ロゴ画像そのもののスタイル */
#dashboardLogo {
  height: 60px;              /* 推奨：45〜55pxが自然。必要に応じて調整可 */
  max-width: 100%;           /* 画面横幅が狭い場合でもはみ出さないように */
  display: block;
  object-fit: contain;       /* 縦横比を維持して中身が切れないように */
}
