/* ベーススタイル */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  color: #212529;
  line-height: 1.6;
}

header {
  background: #343a40;
  color: white;
  padding: 1.2rem 1.5rem;
  text-align: center;
}

.header-content {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

.title-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.3rem;
  position: relative;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
}

.help-button {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-grow: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: auto;
  aspect-ratio: 1;
  box-sizing: border-box;
  padding: 0;
  line-height: 1;
}

.help-button:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.subtitle {
  margin-top: 0.3rem;
  font-size: 1rem;
  opacity: 0.8;
}

/* タブナビゲーション */
.tab-nav {
  display: flex;
  justify-content: center;
  background: #dee2e6;
  padding: 0.5rem;
  flex-wrap: wrap;
}

.tab-button {
  background: #ffffff;
  color: #212529;
  border: 1px solid #ced4da;
  padding: 0.5rem 1rem;
  margin: 0.3rem;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 5px;
  transition: all 0.2s ease-in-out;
}

.tab-button:hover {
  background: #e9ecef;
  color: #212529;
}

.tab-button.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* メインセクション */
main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.tab-content {
  display: none;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab-content.active {
  display: block;
}

/* 入力・出力 */
input[type="text"] {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

button {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background: #007bff;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: #0056b3;
}

pre {
  background: #f1f3f5;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

/* 構造ビュー専用のスタイル */
#git-tree {
  padding: 1rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.4;
  white-space: pre-wrap;
}

#git-tree code {
  background: #2d2d2d;
  padding: 2px 4px;
  border-radius: 3px;
  color: #9cdcfe;
}

/* クリック可能なハッシュのスタイル */
.hash-clickable {
  color: #4fc3f7 !important;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.hash-clickable:hover {
  color: #29b6f6 !important;
  background: rgba(79, 195, 247, 0.1);
  padding: 1px 2px;
  border-radius: 2px;
}

/* アコーディオンのスタイル */
.accordion-header {
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background: #454545 !important;
}

.accordion-content {
  transition: max-height 0.3s ease-out;
}

/* シミュレーター説明のスタイル */
.simulator-notice {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.simulator-notice h3 {
  margin-top: 0;
  color: #495057;
  font-size: 1.1em;
}

.simulator-notice p {
  margin-bottom: 15px;
  color: #6c757d;
}

/* サンプルボタンのスタイル */
.sample-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 15px 0;
}

.sample-button {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 8px;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.sample-button:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.sample-button:active {
  transform: translateY(0);
}

.hash-preview {
  font-family: monospace;
  font-size: 12px;
  opacity: 0.8;
  display: block;
  margin-top: 4px;
}

.other-hash-note {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 12px;
  margin-top: 15px;
  font-size: 0.9em;
  color: #856404;
}

/* 入力セクションのスタイル */
.input-section {
  margin-top: 20px;
  margin-bottom: 20px;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.button-group button {
  flex: 0 0 auto;
}

.clear-button {
  background: #dc3545 !important;
  color: white;
}

.clear-button:hover {
  background: #c82333 !important;
}

/* トーストメッセージのスタイル */
.copy-toast {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* ファイル・フォルダーのツールチップスタイル */
.file-tooltip {
  cursor: help;
  border-bottom: 1px dotted #666;
}

.file-tooltip:hover {
  color: #4fc3f7;
  border-bottom-color: #4fc3f7;
}

/* フォルダの展開/折りたたみスタイル */
.tree-node {
  margin: 0;
}

.folder-toggle {
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.folder-toggle:hover {
  opacity: 0.8;
}

.toggle-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  color: #888;
  transition: transform 0.2s ease;
}

.folder-children {
  overflow: hidden;
}

/* フォルダーアイコンのホバー効果 */
.folder-toggle:hover .toggle-icon {
  color: #4fc3f7;
}

/* 統計情報パネルのスタイル */
.statistics-panel {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #dee2e6;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.statistics-panel h3 {
  margin: 0 0 15px 0;
  color: #495057;
  font-size: 1.2em;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.stat-item {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-value {
  font-size: 1.8em;
  font-weight: bold;
  margin-bottom: 5px;
  color: #495057;
}

.stat-label {
  font-size: 0.9em;
  font-weight: bold;
  color: #6c757d;
  margin-bottom: 3px;
}

.stat-detail {
  font-size: 0.8em;
  color: #868e96;
}

.stat-item.risk-high {
  border-color: #ff3333;
  background: linear-gradient(135deg, #fff5f5, #ffe6e6);
}

.stat-item.risk-high .stat-value {
  color: #ff3333;
}

.stat-item.risk-medium {
  border-color: #ff8800;
  background: linear-gradient(135deg, #fff8f0, #ffedd5);
}

.stat-item.risk-medium .stat-value {
  color: #ff8800;
}

.stat-item.risk-low {
  border-color: #22aa22;
  background: linear-gradient(135deg, #f0fff4, #d4edda);
}

.stat-item.risk-low .stat-value {
  color: #22aa22;
}

.risk-summary {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  font-size: 0.95em;
  color: #856404;
}

/* 構造比較のスタイル */
.comparison-controls {
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.comparison-controls h3 {
  margin: 0 0 15px 0;
  color: #495057;
  font-size: 1.1em;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.preset-button {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 15px 20px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.preset-button:hover {
  background: linear-gradient(135deg, #218838, #1e7e34);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.preset-button:active {
  transform: translateY(0);
}

.comparison-view {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  margin-bottom: 20px;
  min-height: 400px;
}

.comparison-side {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  overflow: auto;
}

.comparison-side h4 {
  margin: 0 0 15px 0;
  padding: 10px;
  background: #e9ecef;
  border-radius: 4px;
  text-align: center;
  color: #495057;
  font-size: 1em;
}

.comparison-tree {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 6px;
  padding: 15px;
  min-height: 300px;
  overflow-x: auto;
  line-height: 1.4;
  white-space: pre-wrap;
}

.comparison-divider {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-badge {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 15px 20px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.2em;
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.comparison-report {
  background: linear-gradient(135deg, #fff, #f8f9fa);
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.comparison-report h3 {
  margin: 0 0 15px 0;
  color: #495057;
  font-size: 1.2em;
}

.diff-item {
  padding: 8px 12px;
  border-radius: 4px;
  margin: 5px 0;
  font-family: monospace;
  font-size: 0.9em;
}

.diff-added {
  background: #d4edda;
  border-left: 4px solid #28a745;
  color: #155724;
}

.diff-removed {
  background: #f8d7da;
  border-left: 4px solid #dc3545;
  color: #721c24;
}

.diff-changed {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  color: #856404;
}

.diff-same {
  background: #f8f9fa;
  border-left: 4px solid #6c757d;
  color: #495057;
  opacity: 0.7;
}

.report-summary {
  background: #e9ecef;
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
}

.report-summary strong {
  color: #495057;
}

.recommendation {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.recommendation h4 {
  margin: 0 0 10px 0;
  color: #0c5460;
}

/* 比較分析表のスタイル */
.comparison-table-container {
  margin: 20px 0;
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.95em;
}

.comparison-table th {
  background: linear-gradient(135deg, #495057, #6c757d);
  color: white;
  padding: 15px 12px;
  text-align: left;
  font-weight: bold;
  border-bottom: 2px solid #dee2e6;
}

.comparison-table th:first-child {
  width: 35%;
  min-width: 180px;
}

.comparison-table th:nth-child(2),
.comparison-table th:nth-child(3) {
  width: 32.5%;
  text-align: center;
}

.comparison-table td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
}

.comparison-table td:first-child {
  background: #f8f9fa;
  font-weight: 500;
  color: #495057;
}

.risk-cell,
.count-cell {
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
}

.risk-cell.higher-risk {
  background: linear-gradient(135deg, #ffe6e6, #ffcccc);
  color: #dc3545;
  border-left: 4px solid #dc3545;
}

.risk-cell.lower-risk {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #28a745;
  border-left: 4px solid #28a745;
}

.count-cell {
  color: #6c757d;
  background: #f8f9fa;
}

.summary-row {
  border-top: 2px solid #dee2e6;
}

.summary-row td {
  background: linear-gradient(135deg, #e9ecef, #f8f9fa) !important;
  font-weight: bold;
}

.summary-row .risk-cell.total.higher-risk {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb) !important;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.summary-row .risk-cell.total.lower-risk {
  background: linear-gradient(135deg, #d1ecf1, #bee5eb) !important;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.summary-row .count-cell.total {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7) !important;
  color: #856404;
}

/* ホバー効果 */
.comparison-table tbody tr:hover {
  background: rgba(0, 123, 255, 0.05);
}

.comparison-table tbody tr:hover td:first-child {
  background: rgba(0, 123, 255, 0.1) !important;
}

/* 比較説明のスタイル */
.comparison-description {
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border: 2px solid #90caf9;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.comparison-description h3 {
  margin: 0 0 12px 0;
  color: #1565c0;
  font-size: 1.1em;
}

.comparison-description p {
  margin: 0;
  color: #424242;
  line-height: 1.6;
  font-size: 0.95em;
}

/* CTFヒントタブのスタイル */
.ctf-categories {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.ctf-category {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ctf-category h3 {
  margin: 0 0 20px 0;
  color: #495057;
  font-size: 1.3em;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 10px;
}

/* 基本手順のステップ */
.ctf-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ctf-step {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.step-number {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1em;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.step-content {
  flex: 1;
}

.step-content h4 {
  margin: 0 0 8px 0;
  color: #495057;
  font-size: 1.1em;
}

.step-content p {
  margin: 8px 0 0 0;
  color: #6c757d;
  font-size: 0.95em;
  line-height: 1.5;
}

/* コードブロック */
.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px 15px;
  border-radius: 6px;
  margin: 10px 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.4;
  overflow-x: auto;
  border-left: 4px solid #007bff;
}

.code-block code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* ツールリスト */
.tool-list, .pattern-list, .technique-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.tool-item, .pattern-item, .technique-item {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-item:hover, .pattern-item:hover, .technique-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tool-item h4, .pattern-item h4, .technique-item h4 {
  margin: 0 0 10px 0;
  color: #495057;
  font-size: 1.1em;
}

.tool-item p, .pattern-item p, .technique-item p {
  margin: 10px 0 0 0;
  color: #6c757d;
  font-size: 0.95em;
  line-height: 1.5;
}

/* パターン説明 */
.pattern-description {
  margin-top: 10px;
}

.pattern-description p {
  margin: 5px 0;
}

.pattern-description strong {
  color: #495057;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .ctf-step {
    flex-direction: column;
    gap: 10px;
  }
  
  .step-number {
    align-self: flex-start;
  }
  
  .code-block {
    font-size: 0.8em;
  }
}

/* リーク検査タブのスタイル */
.leak-controls {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 2px solid #ffc107;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 25px;
}

.leak-input-section {
  margin-bottom: 20px;
}

.leak-input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #495057;
}

.url-input-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#target-url {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-family: monospace;
}

.preset-urls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-url-btn {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-url-btn:hover {
  background: linear-gradient(135deg, #138496, #117a8b);
  transform: translateY(-1px);
}

.scan-options {
  margin-bottom: 20px;
}

.scan-options h4 {
  margin: 0 0 12px 0;
  color: #495057;
}

.option-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.option-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  color: #495057;
  cursor: pointer;
}

.option-checkboxes input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* スピード設定 */
.speed-options {
  margin-bottom: 20px;
}

.speed-options h4 {
  margin: 0 0 12px 0;
  color: #495057;
}

.speed-controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.speed-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: #fff;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 10px 15px;
  transition: all 0.2s ease;
  min-width: 100px;
}

.speed-option:hover {
  border-color: #007bff;
  background: #f8f9fa;
  transform: translateY(-1px);
}

.speed-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #007bff;
}

.speed-option input[type="radio"]:checked + .speed-label {
  color: #007bff;
  font-weight: bold;
}

.speed-option:has(input:checked) {
  border-color: #007bff;
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.speed-label {
  font-weight: normal;
  color: #495057;
  transition: all 0.2s ease;
}

.speed-label small {
  color: #6c757d;
  font-size: 0.8em;
}

.scan-button {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.1em;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.scan-button:hover {
  background: linear-gradient(135deg, #c82333, #a71e2a);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 53, 69, 0.4);
}

.leak-result-container {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  min-height: 200px;
}

.initial-message h3 {
  margin: 0 0 15px 0;
  color: #495057;
}

.warning-box {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
}

.warning-box strong {
  color: #721c24;
}

.warning-box p {
  margin: 8px 0 0 0;
  color: #721c24;
}

/* .git漏洩の仕組みフロー */
.leak-education {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  padding: 25px;
}

.leak-education h3 {
  margin: 0 0 20px 0;
  color: #495057;
  text-align: center;
}

.leak-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #dee2e6;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flow-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.flow-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.flow-content {
  flex: 1;
}

.flow-content h4 {
  margin: 0 0 8px 0;
  color: #495057;
  font-size: 1.1em;
}

.flow-content p {
  margin: 0;
  color: #6c757d;
  line-height: 1.5;
}

.flow-content code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
}

.flow-arrow {
  font-size: 1.5em;
  color: #6c757d;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* プログレスバーのスタイル */
.scan-progress-container {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #007bff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.progress-header h4 {
  margin: 0;
  color: #495057;
  font-size: 1.1em;
}

.progress-info {
  display: flex;
  gap: 15px;
  align-items: center;
}

#progress-text {
  color: #6c757d;
  font-size: 0.9em;
}

#progress-percentage {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9em;
  min-width: 45px;
  text-align: center;
}

.progress-bar-container {
  background: #e9ecef;
  border-radius: 25px;
  height: 20px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(45deg, #007bff, #0056b3, #004085);
  background-size: 30px 30px;
  animation: progress-animation 1s linear infinite;
  border-radius: 25px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.1) 10px,
    rgba(255, 255, 255, 0.1) 20px
  );
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-animation {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 30px 0;
  }
}

@keyframes progress-stripes {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 0;
  }
}

.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9em;
  margin-bottom: 15px;
}

#current-step {
  color: #495057;
  font-weight: 500;
}

#step-counter {
  color: #6c757d;
  background: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #dee2e6;
}

/* スキャン制御ボタン */
.scan-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.skip-button {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.skip-button:hover {
  background: linear-gradient(135deg, #218838, #1e7e34);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.control-button {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.control-button:hover {
  background: linear-gradient(135deg, #545b62, #343a40);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* 一時停止時のスタイル */
.progress-bar.paused {
  animation-play-state: paused;
}

.progress-bar.paused::after {
  animation-play-state: paused;
}

/* スキャン結果の追加スタイル */
.scan-progress {
  margin-bottom: 20px;
}

.scan-step {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease;
}

.scan-step:hover {
  transform: translateX(5px);
}

.step-icon {
  font-size: 1.2em;
  flex-shrink: 0;
}

.step-text {
  flex: 1;
}

.scan-summary {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #dee2e6;
  border-radius: 10px;
  padding: 25px;
  margin-top: 20px;
}

.scan-summary h3 {
  margin: 0 0 20px 0;
  color: #495057;
  text-align: center;
}

.risk-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.risk-stat {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.risk-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.risk-number {
  font-size: 2em;
  font-weight: bold;
  color: #dc3545;
  margin-bottom: 5px;
}

.risk-label {
  color: #6c757d;
  font-size: 0.9em;
}

.found-risks, .impact-analysis, .recommendation {
  margin: 20px 0;
  background: white;
  border-radius: 8px;
  padding: 20px;
  border-left: 4px solid #007bff;
}

.found-risks h4, .impact-analysis h4, .recommendation h4 {
  margin: 0 0 15px 0;
  color: #495057;
}

.impact-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.impact-item {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 12px;
  font-size: 0.9em;
  transition: transform 0.2s ease;
}

.impact-item:hover {
  transform: translateY(-1px);
}

.recommendation {
  border-left-color: #28a745;
}

.recommendation ol {
  margin: 0;
  padding-left: 20px;
}

.recommendation li {
  margin: 8px 0;
  line-height: 1.5;
}

.simulation-notice {
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border: 2px solid #2196f3;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
  text-align: center;
}

.simulation-notice p {
  margin: 0;
  color: #1565c0;
}

.error-message {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.error-message h3 {
  margin: 0 0 10px 0;
  color: #721c24;
}

.error-message p {
  margin: 5px 0;
  color: #721c24;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .preset-urls {
    flex-direction: column;
  }
  
  .option-checkboxes {
    grid-template-columns: 1fr;
  }
  
  .flow-step {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .risk-summary-grid {
    grid-template-columns: 1fr;
  }
  
  .impact-items {
    grid-template-columns: 1fr;
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .comparison-view {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .comparison-divider {
    order: 2;
  }
  
  .vs-badge {
    transform: rotate(90deg);
    padding: 10px 15px;
  }
  
  .preset-buttons {
    grid-template-columns: 1fr;
  }
}

/* リーク検査結果のスタイル */
#leak-result {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  min-height: 100px;
}

#leak-result code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

/* オブジェクト出力のスタイル */
#object-output {
  margin-top: 1rem;
  min-height: 100px;
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1rem;
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

/* フッター */
footer {
  background: #f1f3f5;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.95rem;
  color: #6c757d;
}

.footer a {
  color: #007bff;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ヘルプモーダルのスタイル */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.modal-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 2px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px 12px 0 0;
}

.modal-header h2 {
  margin: 0;
  color: #495057;
  font-size: 1.4em;
}

.close-button {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  max-width: 30px;
  max-height: 30px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-grow: 0;
  aspect-ratio: 1;
  line-height: 1;
  box-sizing: border-box;
  padding: 0;
}

.close-button:hover {
  background: #c82333;
  transform: scale(1.1);
}

.modal-content {
  padding: 25px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
  scrollbar-width: thin;
  scrollbar-color: #ccc #f1f1f1;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.help-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9ecef;
}

.help-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.help-section h3 {
  color: #007bff;
  margin: 0 0 15px 0;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-section p {
  margin: 10px 0;
  line-height: 1.6;
  color: #495057;
}

.help-section ul {
  margin: 10px 0;
  padding-left: 20px;
}

.help-section li {
  margin: 8px 0;
  line-height: 1.5;
  color: #495057;
}

.help-section strong {
  color: #343a40;
}

.help-section code {
  background: #f8f9fa;
  color: #e83e8c;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.faq-item {
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 6px 6px 0;
}

.faq-item h4 {
  margin: 0 0 10px 0;
  color: #007bff;
  font-size: 1em;
}

.faq-item p {
  margin: 0;
  color: #495057;
}

.help-section a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.help-section a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 10px;
  }
  
  .modal-container {
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h2 {
    font-size: 1.2em;
  }
  
  .modal-content {
    padding: 20px;
    max-height: calc(95vh - 100px);
  }
  
  .header-content {
    padding: 0 15px;
  }
  
  .help-button {
    right: 0;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 10px;
  }
  
  .help-button {
    right: 0;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    max-width: 26px;
    max-height: 26px;
    font-size: 0.75rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
}
