﻿/* ============================================================
   dep_zyokyo.css
   重複削除ツール専用スタイル（中央揃え・レイアウト）

   作成日: 2026-07-10
   最終更新: 2026-07-10

   役割:
   - ページ全体の中央揃え
   - 入力・出力エリアのレイアウト調整
   - ナビゲーション・ボタン・警告エリアのスタイリング
   - レスポンシブ対応（モバイルフレンドリー）

   依存:
   - /css/common/base.css （共通変数・リセット・ダークモード）
   ============================================================ */

/* ============================================================
   1. 全体レイアウト（中央揃え）
   ============================================================ */

/* ヘッダー・フッターは中央寄せ */
header,
footer {
  text-align: center;
}

/* メインコンテンツ：最大幅を制限し、自動的に中央寄せ */
main {
  max-width: min(95%, 1200px);
  margin: 0 auto;
  padding: 20px 16px;
}

/* ============================================================
   2. ナビゲーション
   ============================================================ */

nav ul.nav-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

nav ul.nav-menu li {
  display: inline;
}

nav ul.nav-menu a {
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

nav ul.nav-menu a:hover {
  background-color: var(--c-surface, #f0f4f8);
  text-decoration: underline;
}

/* ============================================================
   3. 入力・出力エリア（2カラムレイアウト）
   ============================================================ */

.input-output-wrapper {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.input-output-wrapper section {
  flex: 1 1 300px;
  max-width: 500px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
}

/* テキストエリアは左揃えを維持（読みやすさのため） */
textarea {
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  padding: 10px;
  border-radius: var(--radius, 4px);
  border: 1px solid var(--c-border, #ccc);
  background-color: var(--input-bg-color, #fff);
  color: var(--input-text-color, #333);
  resize: vertical;
}

textarea[readonly] {
  background-color: var(--result-bg-color, #f9f9f9);
  opacity: 0.9;
}

/* ============================================================
   4. ボタン
   ============================================================ */

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.action-btn {
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.1s ease;
  min-width: 120px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius, 4px);
  font-size: 0.9em;
  font-weight: bold;
  color: #fff;
  background-color: var(--c-btn-main, #007bff);
}

.action-btn:hover:not(:disabled) {
  filter: brightness(0.88);
  transform: translateY(-1px);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-sub {
  background-color: var(--c-btn-sub, #757575);
}

.btn-copy {
  background-color: var(--c-btn-copy, #43a047);
}

.btn-danger {
  background-color: var(--c-btn-danger, #c62828);
}

/* コピー完了時のフィードバック */
.copy-btn.success {
  background-color: #2e7d32 !important;
  transition: background-color 0.3s;
}

/* ============================================================
   5. 警告・エラーエリア
   ============================================================ */

.similar-warning {
  max-width: 900px;
  margin: 20px auto;
  padding: 16px 20px;
  border-radius: var(--radius, 8px);
  text-align: left;
  background: var(--c-warn-bg, #fff8e1);
  border: 1px solid var(--c-warn-border, #ffe082);
  color: var(--c-warn-text, #5d4037);
}

.similar-warning ul {
  margin: 8px 0 12px 20px;
  padding-left: 8px;
}

.similar-warning li {
  margin-bottom: 4px;
}

.error {
  color: var(--c-error, #d32f2f);
  font-weight: bold;
  font-size: 0.9em;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: var(--radius, 4px);
  background-color: rgba(211, 47, 47, 0.08);
}

/* ============================================================
   6. ログエリア
   ============================================================ */

.log-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.log-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 16px;
  border: 1px solid var(--c-border, #ddd);
  border-radius: var(--radius, 4px);
  background-color: var(--c-surface2, #fafafa);
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.9em;
  font-family: 'Consolas', 'Monaco', monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

/* スクロールバー（WebKit） */
.log-list::-webkit-scrollbar {
  width: 6px;
}
.log-list::-webkit-scrollbar-track {
  background: var(--scrollbar-track-color, #f0f0f0);
  border-radius: 3px;
}
.log-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-color, #007bff);
  border-radius: 3px;
}
.log-list::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover-color, #0056b3);
}

/* ============================================================
   7. その他ユーティリティ
   ============================================================ */

.help-text {
  font-size: 0.9em;
  color: var(--help-text-color, #666);
  margin: 6px 0 10px 0;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ============================================================
   8. レスポンシブ対応（モバイルファースト）
   ============================================================ */

@media (max-width: 768px) {
  main {
    padding: 12px 8px;
  }

  .input-output-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .input-output-wrapper section {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .controls {
    justify-content: center;
  }

  .action-btn {
    min-width: 100px;
    padding: 8px 14px;
    font-size: 0.85em;
  }

  .log-list {
    max-height: 300px;
    font-size: 0.82em;
  }

  nav ul.nav-menu {
    gap: 8px 12px;
  }
}

/* 超小型画面（スマホ縦） */
@media (max-width: 480px) {
  .action-btn {
    min-width: 80px;
    padding: 6px 12px;
    font-size: 0.8em;
  }

  .similar-warning {
    padding: 12px 14px;
    font-size: 0.9em;
  }

  textarea {
    font-size: 0.85em;
    padding: 8px;
  }
}

/* ============================================================
   9. プリント用（任意）
   ============================================================ */

@media print {
  .controls,
  .log-controls,
  .copy-btn {
    display: none;
  }

  .similar-warning {
    border: 1px solid #999;
    background: #f9f9f9;
  }

  textarea {
    border: 1px solid #999;
  }
}
