/*
 * base.css
 *
 * このファイルは、サイト全体で共通して適用される基本的なスタイルを定義します。
 * レイアウト、タイポグラフィ、ボタン、フォームなど、アプリケーションの
 * 見た目の基盤となるスタイルがここに記述されます。
 */

/* ==========================================================================
   汎用スタイル
   ========================================================================== */

.container {
  max-width: 960px; /* コンテンツの最大幅を960pxに制限 */
}

.small-section {
  font-size: 0.85rem;
}

.large-section {
  font-size: 1.15rem;
}

.text-small {
  font-size: 0.9rem;
}

.text-end {
  text-align: right;
}

/* ==========================================================================
   コンポーネントスタイル
   ========================================================================== */

/* フラッシュメッセージ (例: "ログインしました") */
.flash-messages .alert {
  margin-top: 1rem;
}

/* カテゴリフィルター (トップページ) */
.category-filter {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dee2e6;
}
.category-filter span {
  margin-right: 1rem;
  font-weight: bold;
}
.category-filter a {
  margin-right: 0.5rem;
  text-decoration: none;
  padding: 0.3rem 0.7rem;
  border-radius: 15px;
  border: 1px solid #dee2e6;
  color: #0d6efd;
}
.category-filter a.active {
  /* 現在選択中のカテゴリをハイライト */
  background-color: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

/* スレッド操作エリア (検索フォームと新規作成ボタン) */
.thread-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.search-form {
  display: flex;
  gap: 0.5rem;
}
.btn-create-new {
  font-weight: bold;
}

/* スレッド一覧 */
.thread-list .list-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.thread-list .badges {
  display: flex;
  gap: 0.5rem;
}

/* 共通バッジ (タグ、別名、カテゴリ) */
.tag-badge,
.alias-badge,
.category-badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  margin-right: 0.4rem;
  text-decoration: none;
}
.tag-badge {
  background-color: #6c757d; /* Secondary (灰色) */
}
.alias-badge {
  background-color: #198754; /* Success (緑色) */
  color: white;
}
.category-badge {
  background-color: #0d6efd; /* Primary (青色) */
}

/* 共通フォームスタイル */
.form-group {
  margin-bottom: 1rem;
}

/* background */
.contents-background {
  background-color: #5D6F73;
}

/* ==========================================================================
   いいねレベルに応じたスタイル
   ========================================================================== */

/* いいねの数に応じて投稿の見た目を豪華にするためのスタイル */
.like-level-0 {
  font-size: 1.1em;
}
.like-level-1 {
  font-size: 1.2em;
  font-weight: bold;
}
.like-level-2 {
  color: #f0a83c; /* Green */
  font-size: 1.3em;
  font-weight: bold;
}
.like-level-3 {
  color: #fd562c; /* Amber */
  font-size: 1.4em;
  font-weight: bold;
}
.like-level-4 {
  /* 虹色に光り輝くアニメーション */
  font-weight: bolder;
  background: linear-gradient(
    45deg,
    #ff6b6b,
    #f06595,
    #cc5de8,
    #845ef7,
    #5c7cfa
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
  animation: rainbow-glow 3s infinite linear;
  font-size: 1.5em;
  background-size: 400% 400%;
}

/* 虹色アニメーションのキーフレーム定義 */
@keyframes rainbow-glow {
  0% {
    background-position: 0% 50%;
    transform: scale(1);
  }
  50% {
    background-position: 100% 50%;
    transform: scale(1);
  }
  100% {
    background-position: 0% 50%;
    transform: scale(1);
  }
}