/* =========================================
   ベース設定 (Dark Utility / Minimalist)
========================================= */
body {
  font-family: 'Space Grotesk', "Helvetica Neue", Arial, sans-serif;
  background-color: #0a0a0a; /* 漆黒に近い無機質なブラック */
  color: #ededed; /* 目に刺さらないオフホワイト */
  margin: 0;
  padding: 0;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ▼ 1. スクロールバーのダーク化 ▼ */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 0; /* 四角くハードに */
}
::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

/* =========================================
   1. ヘッダー (硬派なストリート感)
========================================= */
.site-header {
  background-color: #111111;
  padding: 60px 20px;
  text-align: center;
  border-bottom: 1px solid #333333;
}

.site-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3.8rem;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-transform: uppercase;
}

.site-subtitle {
  font-size: 0.9rem;
  color: #888888;
  margin: 12px 0 0;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* =========================================
   2. メインコンテンツ
========================================= */
.main-content {
  padding: 50px 20px;
  flex: 1;
}

/* ▼ 2. 巨大なメイン検索窓 ▼ */
.main-search-container {
  display: flex;
  justify-content: center;
  margin: 0 auto 30px;
  max-width: 800px;
}
.main-search-container input {
  flex: 1;
  padding: 16px 20px;
  font-size: 1.2rem;
  font-weight: 700;
  border: 2px solid #555555;
  background-color: #000000;
  color: #ffffff;
  border-right: none;
}
.main-search-container input:focus {
  outline: none;
  border-color: #facc15;
}
.main-search-container input::placeholder {
  color: #666666;
  font-weight: 400;
}
.main-search-btn {
  padding: 0 30px;
  font-size: 1.2rem;
  font-weight: 900;
  background-color: #facc15;
  color: #000000;
  border: 2px solid #facc15;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
}
.main-search-btn:hover {
  background-color: #eab308;
  border-color: #eab308;
}

/* 見出しのスタイル (装飾を削ぎ落とし、ボーダーのみ) */
h2 {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 25px;
  color: #ffffff;
  padding-bottom: 8px;
  border-bottom: 1px solid #444444;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =========================================
   ローディングスピナー (ソリッドなデザイン)
========================================= */
.loading-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  color: #000000;
  padding: 15px 30px;
  z-index: 9999;
  border: 1px solid #000;
}

.loading-text {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* =========================================
   コンテナ
========================================= */
.form-container,
.list-container {
  background-color: #141414;
  padding: 30px 40px;
  margin: 0 auto 50px;
  border-radius: 0;
  border: 1px solid #333333;
  box-shadow: none;
  /* ▼ 画面の横幅を大きく使って、横スクロールをなくす ▼ */
  width: 95%;
  max-width: 1920px;
}

.form-container {
  /* 登録フォームは広すぎると不格好なので幅を制限 */
  max-width: 800px;
}

/* =========================================
   フォーム・入力部品 (シャープに)
========================================= */
.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.form-group label {
  width: 150px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #aaaaaa;
}

input[type="text"],
input[type="number"] {
  flex: 1;
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 1px solid #444444;
  border-radius: 0;
  background-color: #000000;
  color: #ffffff;
  transition: border-color 0.1s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #ffffff;
  background-color: #0a0a0a;
}

input::placeholder {
  color: #555555;
}

/* =========================================
   ボタン類 (反転・ソリッド)
========================================= */
.submit-btn {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  padding: 12px 30px;
  font-size: 0.95rem;
  font-weight: 900;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.1s ease;
  letter-spacing: 0.05em;
}

.submit-btn:hover {
  background: #cccccc;
  border-color: #cccccc;
}

.action-btn {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid #555555;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.1s;
}

.action-btn:hover {
  background-color: #ffffff;
  color: #000000;
}

.add-word-toggle-btn {
  border-color: #facc15;
  color: #facc15;
}
.add-word-toggle-btn:hover {
  background-color: #facc15;
  color: #000000;
}

/* =========================================
   チェックボックス
========================================= */
.checkbox-label {
  color: #aaaaaa;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #facc15;
}

/* =========================================
   フィルターコントロールパネル
========================================= */
.control-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.word-count {
  font-size: 1rem;
  font-weight: 700;
  color: #888888;
}

.word-count span {
  color: #facc15; /* ブランドイエロー */
  font-size: 1.5rem;
  margin: 0 6px;
  font-weight: 900;
}

.filter-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  background-color: #0a0a0a;
  padding: 24px;
  border-radius: 0;
  border: 1px solid #333333;
  margin-bottom: 30px;
}

.filter-item {
  display: flex;
  flex-direction: column;
}

.filter-item label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #777777;
  margin-bottom: 8px;
}

.filter-item input {
  padding: 8px 10px;
  font-size: 0.85rem;
}

/* =========================================
   データテーブル (ラインのみで構成)
========================================= */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  max-height: 750px;
  overflow-y: auto;
  border: 1px solid #333333;
  border-radius: 0;
  background-color: #111111;
}

table.word-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.85rem;
}

table.word-table thead th {
  background-color: #000000;
  color: #aaaaaa;
  font-weight: 700;
  text-align: left;
  padding: 12px 10px;
  border-bottom: 2px solid #555555;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

table.word-table thead th:hover {
  color: #ffffff;
}

table.word-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #222222;
  color: #dddddd;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

table.word-table tbody tr:hover {
  background-color: #1a1a1a;
}

/* セルホバー */
.clickable-cell {
  transition: color 0.1s;
}
.clickable-cell:hover {
  color: #ffffff;
  text-decoration: underline;
  cursor: pointer;
}

/* 単語名のリンク化（Wikiへの遷移） */
.word-name-cell {
  font-weight: 900;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.1s;
}
.word-name-cell:hover {
  color: #facc15;
  text-decoration: underline;
}

/* 強調文字 */
.highlight-text {
  color: #facc15;
  font-family: monospace;
  font-weight: bold;
}

/* ▽ 横幅指定 ▽ */
.col-word           { width: 140px; }
.col-yomi           { width: 140px; }
.col-vowels         { width: 110px; }
.col-jabara-vowels  { width: 90px;  }
.col-consonants     { width: 130px; }
.col-jabara-cons    { width: 110px; }
.col-syllables      { width: 90px;  }
.col-rhythm         { width: 90px;  }
.col-start-end      { width: 50px;  }
.col-char-type      { width: 60px;  }
.col-mora           { width: 60px;  }
.col-accent         { width: 50px;  }
.col-tags           { width: 170px; }
.col-action         { width: 155px; }

.btn-edit,
.btn-delete {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 0;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.1s;
}

.btn-edit {
  background-color: transparent;
  border-color: #888888;
  color: #eeeeee;
}
.btn-edit:hover {
  background-color: #ffffff;
  color: #000000;
}

.btn-delete {
  background-color: transparent;
  border-color: #cc0000;
  color: #ff6666;
}
.btn-delete:hover {
  background-color: #cc0000;
  color: #ffffff;
}

/* =========================================
   タグ・ピル (ソリッドボックス)
========================================= */
.tag-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px solid #444444;
  border-radius: 0;
  background-color: #000000;
  padding: 6px 10px;
  min-height: 40px;
}

.tag-filter-container input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  flex: 1;
  min-width: 140px;
  padding: 0 !important;
  color: #ffffff;
}

.filter-tag-pill {
  background-color: #ffffff;
  color: #000000;
  padding: 4px 10px;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-tag-pill .remove-tag {
  cursor: pointer;
  color: #666666;
  font-weight: 900;
}
.filter-tag-pill .remove-tag:hover {
  color: #ff0000;
}

.table-tag {
  background: #222222;
  border: 1px solid #444444;
  padding: 2px 6px;
  border-radius: 0;
  font-size: 0.75em;
  font-weight: 600;
  margin-right: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  display: inline-block;
}
.table-tag:hover {
  background: #ffffff;
  color: #000000;
}

/* =========================================
   ページネーション
========================================= */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
  /* ▼ ページネーションとテーブルの間に余白を作る ▼ */
  margin-bottom: 25px;
  padding-top: 20px;
  border-top: 1px solid #333333;
}

.page-btn {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid #555555;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 0;
  cursor: pointer;
}
.page-btn:hover:not(:disabled) {
  background-color: #ffffff;
  color: #000000;
}
.page-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.9rem;
  color: #888888;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-input {
  background-color: #000000;
  color: #ffffff;
  border: 1px solid #555555;
  border-radius: 0;
  padding: 4px 8px;
  font-size: 0.9rem;
  font-weight: bold;
  width: 50px;
  text-align: center;
}

/* =========================================
   3. フッター
========================================= */
.site-footer {
  margin-top: 60px;
  padding: 60px 20px 40px;
  border-top: 1px solid #333333;
  text-align: center;
  background-color: #0a0a0a;
}

.footer-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 30px;
  letter-spacing: 0.15em;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 50px;
}

.footer-nav a {
  color: #888888;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-block;
}
.footer-nav a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.copyright {
  color: #555555;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.1em;
}

/* ポップアップメニュー */
.sort-popup-menu {
  position: absolute;
  background-color: #111111;
  border: 1px solid #555555;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  min-width: 130px;
  z-index: 1000;
  user-select: none;
}
.sort-popup-item {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #dddddd;
  cursor: pointer;
  border-bottom: 1px solid #222222;
}
.sort-popup-item:last-child {
  border-bottom: none;
}
.sort-popup-item:hover {
  background-color: #ffffff;
  color: #000000;
}