/* 診断結果表示用スタイル */
.radar-chart-container {
  position: relative;
  width: 100%;
  height: 350px;
  margin: 0 auto 2rem;
  max-width: 600px;
}

/* チャートの背景色 */
.radar-chart-container canvas {
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

/* 診断履歴一覧のスタイル */
.history-table {
  margin-bottom: 0;
}

.history-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.history-row:hover {
  background-color: rgba(253, 126, 20, 0.05);
}

.history-row td {
  vertical-align: middle;
}

.result-icon {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
      transform: scale(1);
      opacity: 1;
  }
  50% {
      transform: scale(1.05);
      opacity: 0.8;
  }
  100% {
      transform: scale(1);
      opacity: 1;
  }
}

/* PDF出力・印刷ボタン */
.pdf-export {
  margin-bottom: 1.5rem;
}

.pdf-export .btn {
  padding: 0.5rem 1.5rem;
}

/* 診断結果を過去データと比較するセクション用のスタイル */
.comparison-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e0c7b2;
}

.comparison-chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 0 auto 2rem;
  max-width: 600px;
}

/* エクスポートオプション */
.export-options {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.export-options .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
}

.export-options .btn i {
  margin-right: 0.5rem;
}

/* セッション名の編集機能 */
.session-name-edit {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #6c757d;
  transition: color 0.2s ease;
}

.session-name-edit:hover {
  color: #fd7e14;
}

/* セキュリティマーク */
.security-mark {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.8rem;
  color: #6c757d;
  display: flex;
  align-items: center;
}

.security-mark i {
  margin-right: 0.25rem;
}

/* 診断日時ごとにグループ化された履歴リスト */
.history-group {
  margin-bottom: 2rem;
}

.history-group-title {
  font-size: 1rem;
  padding: 0.5rem 1rem;
  background-color: #f8f9fa;
  border-left: 4px solid #fd7e14;
  margin-bottom: 1rem;
}

/* コメントフィールド */
.result-comment {
  margin-top: 2rem;
}

.result-comment textarea {
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid #e0c7b2;
  resize: vertical;
  min-height: 100px;
}

.result-comment textarea:focus {
  border-color: #fd7e14;
  box-shadow: 0 0 0 0.2rem rgba(253, 126, 20, 0.25);
}

/* =================================== */
/* カテゴリスコア表示（新しいスタイル） */
/* =================================== */

/* カテゴリ得点リスト（完了ページ用） */
.results-summary .category-scores-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}

.results-summary .category-scores-list li {
  margin-bottom: 25px;
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
  width: 100%;
}

.results-summary .category-scores-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.results-summary .category-header {
  margin-bottom: 15px;
}

.results-summary .category-name {
  font-size: 1.1em;
  color: #000000 !important;
  display: flex;
  align-items: center;
  margin-bottom: 0;
  font-weight: 600;
}

.results-summary .category-name i {
  margin-right: 8px;
}

.results-summary .score-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  width: 100%;
}

.results-summary .score-label {
  font-weight: 500;
  color: #000000 !important;
  font-size: 0.9em;
  min-width: 45px;
  flex-shrink: 0;
}

.results-summary .score-bar {
  flex: 1;
  height: 24px;
  background: #e9ecef !important;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.results-summary .score-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--width-percentage, 0%);
  border-radius: 12px;
  transition: width 1.2s ease-out;
  transition-delay: calc(var(--index, 0) * 0.1s);
}

.results-summary .score-bar.score-low::before {
  background: #fd7e14 !important;
}

.results-summary .score-bar.score-medium::before {
  background: #20c997 !important;
}

.results-summary .score-bar.score-high::before {
  background: #007bff !important;
}

.results-summary .score-value {
  font-weight: 600;
  font-size: 1em;
  color: #000000 !important;
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* アニメーション効果（カテゴリ得点のみ） */
.results-summary .category-scores-list li {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: calc(var(--index, 0) * 0.1s);
}

@keyframes fadeInUp {
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

/* =================================== */
/* Type2専用チャートスタイル */
/* =================================== */

.nc-charts-container {
  display: block !important;
}

.nc-dimension-chart,
.nc-element-chart {
  display: block !important;
  margin-bottom: 30px !important;
}

.chart-container-custom {
  display: block !important;
  height: 400px !important;
  position: relative !important;
}

.chart-container-custom canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

/* =================================== */
/* レスポンシブ対応 */
/* =================================== */

/* タブレット対応 */
@media screen and (max-width: 991.98px) {
  .history-table th, 
  .history-table td {
      font-size: 0.9rem;
  }
  
  .radar-chart-container {
      height: 320px;
  }
}

/* モバイル対応 */
@media screen and (max-width: 767.98px) {
  .radar-chart-container {
      height: 300px;
  }
  
  .history-table {
      font-size: 0.85rem;
  }
  
  .history-table th:nth-child(2), 
  .history-table td:nth-child(2) {
      max-width: 120px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
  }
  
  .badge {
      font-size: 0.7rem;
  }
  
  /* カテゴリ得点のモバイル対応 */
  .results-summary .category-scores-list li {
      padding: 15px;
      margin-bottom: 20px;
  }
  
  .results-summary .score-bar-container {
      gap: 10px;
  }
  
  .results-summary .score-label {
      min-width: 40px;
      font-size: 0.85em;
  }
  
  .results-summary .score-value {
      font-size: 0.9em;
      min-width: 35px;
  }
  
  .results-summary .category-name {
      font-size: 1em;
  }
}

/* =================================== */
/* 印刷時の最適化 */
/* =================================== */

@media print {
  header, footer, .btn, #breadcrumb-wrapper {
      display: none !important;
  }
  
  .card {
      box-shadow: none !important;
      border: 1px solid #ddd !important;
  }
  
  .result-icon, .pdf-export {
      display: none !important;
  }
  
  body {
      padding-top: 0 !important;
  }
  
  .lead {
      font-size: 1.1rem !important;
  }
  
  h1 {
      font-size: 2rem !important;
  }
  
  .assessment-result-section {
      padding: 0 !important;
  }
  
  .container {
      max-width: 100% !important;
      width: 100% !important;
  }
  
  .radar-chart-container {
      height: 400px;
      page-break-inside: avoid;
  }
  
  .category-scores-list {
      page-break-inside: avoid;
  }
  
  /* 印刷時の棒グラフ色を保持 */
  .results-summary .score-bar.score-low::before {
      background: #fd7e14 !important;
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
  }
  
  .results-summary .score-bar.score-medium::before {
      background: #20c997 !important;
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
  }
  
  .results-summary .score-bar.score-high::before {
      background: #007bff !important;
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
  }
}

/* =================================== */
/* ダークモード対応 */
/* =================================== */

@media (prefers-color-scheme: dark) {
  .radar-chart-container canvas {
      background-color: rgba(255, 255, 255, 0.95);
  }
}

/* =================================== */
/* 診断後のアンケート部分*/
/* =================================== */
.card p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.card h4 {
  font-weight: bold;
}

/* 納得度セクション */
.emotion-check {
  background-color: #fefefe;
  border: 1px solid #e0c7b2;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.emotion-check h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

/* ボタンの配置：グリッドでスマホ対応 */
.emotion-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

/* 各感情ボタンのベース */
.emotion-btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background-color: #fff;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* カラーバリエーション */
.btn-blue {
  color: #0d6efd;
  border-color: #0d6efd;
}
.btn-blue:hover {
  background-color: #e7f1ff;
}

.btn-green {
  color: #198754;
  border-color: #198754;
}
.btn-green:hover {
  background-color: #e6f4ec;
}

.btn-gray {
  color: #6c757d;
  border-color: #6c757d;
}
.btn-gray:hover {
  background-color: #f1f1f1;
}

.btn-orange {
  color: #fd7e14;
  border-color: #fd7e14;
}
.btn-orange:hover {
  background-color: #fff3e0;
}

/* モバイル対応強化 */
@media screen and (max-width: 575.98px) {
  .emotion-btn {
    font-size: 0.85rem;
    padding: 0.5rem;
  }
}

/* 修正ボタンの追加スタイル（共通ボタンと揃える） */
#edit-emotion {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  min-width: 160px;
}