/* 🎨 Horror Connect - 統合CSSファイル v2.0 */
/* 全8ファイルを統合、重複削除、@apply最適化 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Sans:wght@300;400;500;700&display=swap');

/* ========================================
   🏠 基本設定とリセット
======================================== */

* {
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: white;
  color: #1a1a1a;
  line-height: 1.6;
  font-size: 16px;
}

/* ========================================
   🎯 ヘッダーシステム
======================================== */

.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-bottom: 2px solid #e0e0e0;
  z-index: 1000;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* simple one-off header offset so content never hides under fixed header */
header.fixed-header + * { padding-top: 55px; }

/* ホラー好みページ専用のヘッダーオフセット */
.horror-preferences-container { padding-top: 70px; }

/* create BFCs to stop margin collapse */
.main-container, .content-area, .tab-content, .tab-panel { display: flow-root; }

/* extra safety against first-child margins */
.tab-content > *:first-child, .tab-panel > *:first-child { margin-top: 0 !important; }

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: black;
}

.header-ghost {
  width: 28px;
  height: 28px;
  background-color: black;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: relative;
  flex-shrink: 0;
}

.header-ghost::before,
.header-ghost::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: white;
  border-radius: 50%;
  top: 13px;
}

.header-ghost::before {
  left: 5px;
}

.header-ghost::after {
  right: 5px;
}

.header-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: black;
}

/* ヘッダーユーザー情報 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-profile-link {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
}

.header-profile-link:hover {
  opacity: 0.8;
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user-name {
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.header-logout {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 400;
  background-color: white;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
}

/* ========================================
   📱 ナビゲーションシステム  
======================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  width: 100%;
  height: 60px;
  z-index: 999;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.nav-item {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 12px 4px;
  text-decoration: none;
  color: #555555;
  min-width: 0;
}

.nav-item:hover {
  background-color: #f8f8f8;
}

.nav-item.active {
  color: black;
}

.nav-icon {
  width: 28px;
  height: 28px;
  position: relative;
}

.feed-icon {
  background-color: #555555;
  clip-path: polygon(50% 6%, 12% 32%, 12% 100%, 88% 100%, 88% 32%);
  border-radius: 0 0 3px 3px;
  width: 32px;
  height: 26px;
  top: -1px;
}

.feed-icon::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 9px;
  width: 4px;
  height: 9px;
  background-color: #555555;
  border-radius: 1px;
}

.feed-icon::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background-color: white;
  border-radius: 50%;
}

.nav-item.active .feed-icon,
.nav-item.active .feed-icon::before {
  background-color: black;
}

.match-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-family: inherit;
  font-weight: bold;
  color: currentColor;
}

.match-icon::before {
  content: '♡';
}

.nav-item.active .match-icon {
  color: black;
}

.event-icon {
  background-color: currentColor;
  border-radius: 3px;
  width: 24px;
  height: 24px;
  top: 2px;
}

.event-icon::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 5px;
  width: 3px;
  height: 8px;
  background-color: currentColor;
  border-radius: 2px;
  box-shadow: 8px 0 0 currentColor;
}

.event-icon::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0px,
    transparent 1px,
    white 1px,
    white 3px,
    transparent 3px,
    transparent 4px
  );
  background-size: 4px 2px;
  box-shadow: 0 4px 0 white, 0 8px 0 white;
}

.nav-item.active .event-icon,
.nav-item.active .event-icon::before {
  background-color: black;
}

.board-icon {
  background-color: currentColor;
  border-radius: 2px;
  width: 24px;
  height: 24px;
  top: 2px;
}

.board-icon::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 6px;
  background-color: currentColor;
  border-radius: 2px 2px 0 0;
}

.board-icon::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0px,
    transparent 2px,
    white 2px,
    white 6px,
    transparent 6px,
    transparent 8px
  );
  box-shadow: 0 4px 0 white, 0 8px 0 white;
}

.nav-item.active .board-icon,
.nav-item.active .board-icon::before {
  background-color: black;
}

/* 特異性向上：ナビゲーションの中のブックマークアイコン */
.bottom-nav .nav-item .bookmark-tab-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-family: inherit;
  font-weight: bold;
  color: currentColor;
}

/* 特異性向上：アイコンの内容 */
.bottom-nav .nav-item .bookmark-tab-icon::before {
  content: '★';
  display: inline-block;
}

/* 特異性向上：アクティブ状態 */
.bottom-nav .nav-item.active .bookmark-tab-icon {
  color: black;
}

.profile-tab-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-family: inherit;
  font-weight: bold;
  color: currentColor;
}

.profile-tab-icon::before {
  content: '👤';
}

.nav-item.active .profile-tab-icon {
  color: black;
}

.nav-label {
  font-size: 10px;
  color: #666;
  font-weight: 500;
}

.nav-item.active .nav-label {
  color: black;
}

/* ブックマークアイコン特別設定 */
.bookmark-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-family: inherit;
  font-weight: bold;
  color: currentColor;
}

.bookmark-icon::before {
  content: '★';
  display: inline-block;
}

/* モバイル対応 */
@media (max-width: 480px) {
  .bottom-nav {
    height: 55px;
  }
  
  .bookmark-icon {
    width: 24px;
    height: 24px;
    font-size: 20px;
  }
  
  /* 小画面でのブックマーク対応 */
  .bookmarks-container {
    padding: 10px;
  }

  .bookmark-item {
    padding: 12px;
    border-radius: 8px;
  }

  /* 小画面での仕切り線調整 */
  .bookmark-item::before,
  .bookmark-item::after {
    left: 12px;
    right: 12px;
  }

  .bookmark-text {
    font-size: 14px;
  }

  .filter-label {
    width: 100%;
    margin-bottom: 8px;
  }
  
  /* Welcomeページ小画面対応 */
  .page-with-header {
    padding-top: 50px;
  }
  
  .main-title {
    font-size: 1.7rem;
    margin-bottom: 15px;
  }
  
  .description-text {
    font-size: 0.9rem;
    margin-bottom: 20px;
    max-width: 98%;
    padding: 0 3px;
  }
  
  .welcome-input {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  
  .welcome-login-btn,
  .welcome-register-btn {
    padding: 12px 18px;
    font-size: 0.95rem;
  }
  
  /* 登録ページ小画面対応 */
  .register-container {
    padding: 10px 8px;
    min-height: calc(100vh - 55px);
  }
  
  .title {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }
  
  .register-form {
    gap: 15px;
  }
  
  .form-input,
  .register-btn {
    padding: 14px 16px;
    font-size: 0.95rem;
  }
  
  .register-btn {
    font-size: 1rem;
  }
  
  .field-note {
    font-size: 0.7rem;
  }
  
  .login-link {
    font-size: 0.85rem;
  }
}

/* ========================================
   🏗️ メインレイアウトシステム
======================================== */

.main-container {
  /* header offset is handled globally via header.fixed-header + * */
  padding-top: 0; /* ensure no extra top spacing; sibling rule handles it */
  padding-bottom: 70px;
  min-height: calc(100vh - 125px);
  background: white;
}

.content-area {
  padding: 0;
  margin: 0;
}

/* タブシステム */
.tab-header {
  margin: 0 0 4px 0;
  padding: 2px 12px 4px 12px;
  border-bottom: none;
}

.tab-title {
  font-size: 0.95rem;
  font-weight: 400;
  color: black;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

.tab-content {
  height: 100%;
  overflow-y: auto;
  padding: 0 0 60px 0;
  margin: 0;
}

.tab-panel {
  padding: 2px 8px 8px 8px;
  margin: 0;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .main-container {
    /* header offset is handled globally via header.fixed-header + * */
    padding-bottom: 65px;
  }
  
  .tab-header {
    margin: 0 0 3px 0;
    padding: 1px 10px 3px 10px;
  }
  
  .tab-title {
    font-size: 0.9rem;
  }
  
  .tab-panel {
    padding: 1px 6px 6px 6px;
  }
  
  .tab-content {
    padding-bottom: 55px;
  }
}

/* ========================================
   👤 アバターシステム統合
======================================== */

.avatar-container {
  position: relative;
  display: inline-block;
}

.user-avatar, .header-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.header-user-avatar {
  width: 32px;
  height: 32px;
}

.avatar-img, .header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder, .header-avatar-placeholder {
  width: 100%;
  height: 100%;
  background: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.header-avatar-placeholder {
  font-size: 12px;
}

/* プロフィール用大きなアバター */
.profile-avatar-img,
.profile-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  background: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
  font-weight: bold;
}

.edit-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #000;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.edit-avatar-btn:hover {
  background-color: #374151;
}

/* ========================================
   🎬 フィードシステム統合  
======================================== */

/* フィード投稿 */
.feed-posts {
  background: white;
}

.feed-post {
  border-bottom: 1px solid #ddd;
  margin-bottom: 2px;
  padding: 4px 12px;
  background: white;
}

.feed-post:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.post-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-author {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 10px;
}

.post-time {
  font-size: 12px;
  color: #666;
}

.post-content {
  margin: 0 0 4px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a1a;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 投稿作成フォーム */
.post-composer {
  background: white;
  padding: 4px 16px;
  margin-bottom: 0;
}

.composer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  justify-content: space-between;
}

.user-info {
  flex: 1;
}

.user-info .display-name {
  font-weight: bold;
  color: #1a1a1a;
  font-size: 14px;
  text-align: left;
}

.composer-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-input {
  min-height: 50px;
  padding: 4px 11px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  line-height: 1.4;
  font-family: inherit;
  resize: vertical;
}

.post-input:focus {
  outline: none;
  border-color: #333;
  background: white;
}

.composer-actions {
  display: flex;
  gap: 13px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
}

/* アクションボタン */
.action-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #666;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.action-btn:active, .action-btn:focus {
  background: none;
  outline: none;
}

/* 画像関連 */
.image-attach-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}

.image-attach-btn:hover {
  color: #333;
}

.image-preview {
  position: relative;
  max-width: 200px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.preview-img {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: cover;
  display: block;
}

.remove-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-image-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* 投稿ボタン */
.post-submit-btn {
  background: none;
  color: #333;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-width: 50px;
}

.post-submit-btn:hover:not(:disabled) {
  color: #000;
}

.post-submit-btn:disabled {
  color: #ccc;
  cursor: not-allowed;
}

/* ブックマーク */
.bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.bookmark-star {
  color: #555;
  background: transparent;
  font-size: 16px;
}

.bookmark-btn.bookmarked .bookmark-star,
.bookmark-btn:hover .bookmark-star {
  color: #000;
}

/* ========================================
   📋 掲示板システム統合 - 907アーカイブから復旧
======================================== */

.board-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 20px 100px 20px;
  background: #fff;
  min-height: 100vh;
  color: #000;
}

/* 掲示板一覧 */
.board-list {
  display: grid;
  gap: 0;
  color: #000;
}

.board-item {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 1px solid #e5e5e5;
}

.board-item:hover {
  background: transparent;
}

.board-item h4 {
  margin: 0 0 8px 0;
  color: #000;
  font-size: 16px;
}

.board-item p {
  margin: 0 0 12px 0;
  color: #000;
  font-size: 14px;
  line-height: 1.4;
}

.board-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #000;
}

#board-list-view {
  background: #fff;
}

/* 掲示板作成トグル */
.board-creator-toggle-row {
  border: 0;
}

.board-creator-toggle-row::before,
.board-creator-toggle-row::after {
  content: "";
  display: block;
  height: 1px;
  background: #e5e5e5;
}

.board-creator-toggle-btn {
  width: 100%;
  text-align: center;
  padding: 6px 0;
  background: transparent;
  border: 0;
  font-size: 15px;
  color: #000;
  font-weight: 400;
  cursor: pointer;
}

.board-container .board-creator-toggle-row {
  border: 0;
}

#board-creator-form {
  display: none;
  padding: 8px 6px;
  margin: 8px 0;
  background: #f9f9f9;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  border-top: none;
}

#board-creator-form textarea,
#board-creator-form input[type="text"] {
  padding: 12px;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
}

#board-creator-form .board-creator-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5em;
  margin-top: 8px;
}

/* 掲示板詳細 */
.board-detail {
  display: none;
}

.board-detail.active {
  display: block;
}

.board-detail-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.board-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-detail .board-detail-title {
  margin: 0;
  color: #111;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.2;
  flex: 1 1 auto;
}

.board-bookmark-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: inherit;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.board-bookmark-btn:hover {
  background: transparent;
}

.board-bookmark-btn.bookmarked {
  color: inherit;
}

.board-delete-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  color: #dc3545;
}

.board-delete-btn:hover {
  background: rgba(220, 53, 69, 0.1);
  transform: scale(1.1);
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

.board-header h2 {
  margin: 0;
  color: #333;
  font-size: 20px;
}

.back-button {
  background: none;
  border: none;
  color: #000;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.board-detail-header .back-button {
  align-self: flex-start;
  margin: 0;
}

.back-button:hover {
  text-decoration: underline;
}

/* 投稿入力エリア */
.post-input-area {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.post-input-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-input-form textarea {
  border-color: #ced4da;
  min-height: 80px;
}

.post-input-form input[type="file"] {
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

.post-input-form button {
  padding: 10px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  align-self: flex-start;
}

.post-input-form button:hover {
  background: #1e7e34;
}

/* 投稿リスト */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.post-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: #999;
}

.post-content {
  margin-bottom: 10px;
  color: #333;
  line-height: 1.5;
}

.post-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-top: 10px;
}

/* 投稿コンポーザー（展開時） */
#board-post-input {
  display: none;
  padding: 8px 6px;
  margin: 8px 0;
  background: #f9f9f9;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  border-top: none;
}

#board-post-input textarea {
  padding: 12px;
  line-height: 1.4;
}

#board-post-input .post-input-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5em;
  margin-top: 8px;
}

/* ボタンスタイル（テキストリンク） */
#board-post-image-btn {
  background: none;
  border: none;
  padding: 0;
  color: #000;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

#board-post-image-btn:hover {
  text-decoration: underline;
}

#board-post-submit-btn {
  background: transparent;
  color: #000;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

#board-post-submit-btn:hover {
  text-decoration: underline;
}

#board-image-btn {
  background: none;
  border: none;
  padding: 0;
  color: #000;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

#board-image-btn:hover {
  text-decoration: underline;
}

#board-create-btn {
  background: transparent;
  color: #000;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

#board-create-btn:hover {
  text-decoration: underline;
}

/* 投稿コンポーザートグル */
.composer-toggle-row {
  border: 0;
}

.composer-toggle-row::before,
.composer-toggle-row::after {
  content: "";
  display: block;
  height: 1px;
  background: #e5e5e5;
}

.composer-toggle-btn {
  width: 100%;
  text-align: center;
  padding: 8px 0;
  background: transparent;
  border: 0;
  font-size: 17px;
  color: #000;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.composer-toggle-btn:hover {
  background-color: #f5f5f5;
}

/* 投稿リストの区切り線 */
.board-posts .board-post-item {
  padding: 12px 0;
  border-top: 1px solid #e5e5e5;
}

.board-posts .board-post-item:first-child {
  border-top: none;
}

.board-posts .board-post-item:last-child {
  border-bottom: 1px solid #e5e5e5;
}

.board-posts .composer-toggle-row + .board-post-item {
  border-top: none;
}

.board-posts #board-post-input + .board-post-item {
  border-top: none;
}

/* ブックマーク機能 */
.board-post-item .post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.board-post-item .post-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-post-item .post-author-link {
  color: #000;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.board-post-item .post-header .post-author-link:hover {
  color: #333;
  text-decoration: underline;
}

.board-post-item .post-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.board-post-item .action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.board-post-item .action-btn:hover {
  background: transparent;
  color: inherit;
}

.board-post-item .bookmark-btn {
  position: relative;
}

.board-post-item .bookmark-btn .bookmark-icon {
  font-size: 14px;
  color: #666;
  transition: color 0.2s ease;
}

.board-post-item .bookmark-btn.bookmarked .bookmark-icon {
  color: #ffc107;
}

.board-post-item .bookmark-btn:hover .bookmark-icon {
  color: #ffc107;
}

/* 投稿番号とアンカーリンク */
.board-post-item .post-header .post-number {
  font-weight: bold;
  color: #000;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  min-width: 20px;
  text-align: center;
}

.anchor-link {
  color: #111;
  text-decoration: none;
  font-weight: bold;
  padding: 1px 3px;
  border-radius: 3px;
  background: #f2f2f2;
  cursor: pointer;
}

.anchor-link:hover {
  background: transparent;
  text-decoration: none;
}

.board-post-item.highlighted {
  background: #f2f2f2;
  border-left: 4px solid #999;
  animation: highlightFade 2s ease-out;
}

@keyframes highlightFade {
  0% { 
    background: #f2f2f2;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.15);
  }
  100% { 
    background: transparent;
    box-shadow: none;
  }
}

/* ========================================
   🎪 イベントシステム統合  
======================================== */

/* イベントモーダル */
.event-modal {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.8) 80%, transparent 100%);
  padding-bottom: 0;
}

.event-modal-close {
  position: absolute;
  top: 60px;
  right: 24px;
  background: white;
  border: 2px solid #ddd;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.event-modal-content {
  margin-top: 80px;
  margin-bottom: 20px;
}



/* 個別イベント詳細ページ */
.event-detail-page {
  background: white;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 40px 20px 100px 20px;
  border-radius: 0;
  min-height: 100vh;
}

.event-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #000;
}

.event-back-btn {
  background: none;
  border: 1px solid #333;
  color: #333;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.event-back-btn:hover {
  background: #000;
  color: white;
}

.event-detail-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  color: #000;
}

/* 週表示カレンダー */
.week-calendar-container {
  margin-bottom: 24px;
}

.week-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #000;
  color: white;
  border-radius: 8px 8px 0 0;
}
/* Prevent style conflicts with month calendar nav buttons */
.week-selector .calendar-nav-btn {
  padding: 6px 12px;
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.week-selector .calendar-nav-btn:hover:not([disabled]) {
  background: #fff;
  color: #000;
}
.week-selector .calendar-nav-btn[disabled] { opacity: .35; cursor: not-allowed; }

.week-calendar-container .week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: white;
  border: 2px solid #000;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: visible;
  position: relative;
  /* 複数日イベント用に自動行生成を有効化 */
  grid-auto-rows: auto;
  min-height: 200px;
  /* 必要に応じて高さを拡張 */
}

/* 複数日イベントを曜日行の直下に収める専用行 */
.week-calendar-container .week-multiday-row {
  grid-column: 1 / -1;
  position: relative;
  border-bottom: 1px solid #e0e0e0;
  padding: 2px 8px 4px 8px;
  min-height: 0; /* JSでセット */
}

.week-calendar-container .calendar-weekday {
  height: 40px;
  line-height: 40px;
  padding: 0 8px;
  background: #f5f5f5;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* 曜日表示が行をまたがないよう固定高さと中央配置を確保 */
}

.week-calendar-container .week-day {
  height: auto;
  padding: 4px 6px;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: visible;
  /* 上部空白を最小化してコンパクト表示 */
}

.week-calendar-container .week-day-header {
  flex-shrink: 0;
  margin-bottom: 2px;
  padding: 2px 0;
  min-height: 24px; /* デイト番号行の最低高で見出し領域を確保 */
  position: relative;
  z-index: 200; /* 日付が帯より上にくる安全策 */
}

.week-calendar-container .week-day-number {
  font-weight: bold;
  font-size: 14px;
  color: #333;
  line-height: 1.2;
}

.week-calendar-container .week-events {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0;
}

.week-calendar-container .week-day:hover {
  background: #f8f8f8;
}

.week-calendar-container .week-day.selected {
  background: #eee;
  /* 選択時の枠線は削除 */
}

.week-calendar-container .week-day.today {
  /* 当日の黒塗りつぶしは削除 - 通常の背景色を維持 */
}

/* 複数日イベントの視認性向上 - 黒背景白字ボタンスタイル */
.week-event {
  background: #000;
  color: white;
  padding: 4px 8px;
  margin: 2px 0;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  text-decoration: none;
  border: none;
  outline: none;
  min-height: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
}

.week-event:hover {
  background: #333;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.week-event-name {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 6px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.week-event-location {
  flex: 0 0 auto;
  font-weight: bold;
  color: white;
  display: inline-block;
  margin-left: 4px;
}

/* 複数日にまたがるイベント用の追加スタイル */
.week-event.multi-day {
  margin-left: -8px;
  margin-right: -8px;
  border-radius: 0;
  background: linear-gradient(90deg, #000 0%, #333 100%);
  position: relative;
}

.week-event.multi-day:first-child {
  border-radius: 4px 0 0 4px;
  margin-left: 0;
}

.week-event.multi-day:last-child {
  border-radius: 0 4px 4px 0;
  margin-right: 0;
}

.week-event.multi-day.single-span {
  border-radius: 4px;
  margin-left: 0;
  margin-right: 0;
}

/* 複数日イベントの各部分の詳細スタイル */
.week-event.multi-day.first-day {
  border-radius: 4px 0 0 4px;
  margin-left: 0;
  margin-right: -8px;
}

.week-event.multi-day.middle-day {
  border-radius: 0;
  margin-left: -8px;
  margin-right: -8px;
}

.week-event.multi-day.last-day {
  border-radius: 0 4px 4px 0;
  margin-left: -8px;
  margin-right: 0;
}

/* 複数日イベントのホバー効果 */
.week-event.multi-day:hover {
  background: linear-gradient(90deg, #333 0%, #555 100%);
  z-index: 10;
  position: relative;
}

/* 複数日にまたがるイベント用の新しいスタイル */
.week-event.multi-day-spanning {
  background: #000;
  color: white;
  padding: 6px 12px;
  margin: 0;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  border: 2px solid #333;
  position: absolute;
  z-index: 100;
  min-height: 24px;
  box-sizing: border-box;
  /* 複数日にまたがる表示のための絶対位置指定 */
  pointer-events: auto;
}

.week-event.multi-day-spanning:hover {
  background: #333;
  border-color: #555;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  z-index: 30;
}

.week-event.multi-day-spanning .week-event-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  margin-right: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.week-event.multi-day-spanning .week-event-location {
  flex: 0 0 auto;
  font-weight: bold;
  color: white;
  display: inline-block;
  margin-left: 6px;
}

/* 単日イベント用のスタイル調整 */
.week-event.single-day {
  background: #000;
  color: white;
  padding: 4px 8px;
  margin: 2px 0;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  min-height: 20px;
}

/* 選択日イベント表示のスタイル */
.selected-day-events {
  background: white;
  border: 2px solid #000;
  border-radius: 8px;
  margin-top: 16px;
  overflow: hidden;
}

.selected-day-header {
  background: #000;
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selected-day-title {
  font-size: 16px;
  font-weight: bold;
}

.selected-day-date {
  font-size: 14px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
}

.selected-day-list {
  padding: 16px;
}

.no-selected-events {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 20px;
}

.selected-event-item {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.selected-event-item:hover {
  background: #f0f0f0;
  border-color: #ccc;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selected-event-item:last-child {
  margin-bottom: 0;
}

.selected-event-location {
  display: inline-block;
  background: #000;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 8px;
}

.selected-event-location.web {
  background: #000;
}

.selected-event-name {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.4;
}

.selected-event-period {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.selected-event-creator {
  font-size: 12px;
  color: #888;
}

/* ========================================
   🔍 検索システム統合
======================================== */

.feed-search-area {
  background: white;
  padding: 2px 16px 4px 16px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0;
  text-align: right;
}

.search-container {
  position: relative;
}

.search-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  position: relative;
  max-width: 100%;
}

.search-input {
  flex: 1;
  min-width: 0; /* flexアイテムの縮小を許可 */
  padding: 8px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: #333;
}

.search-clear-btn {
  background: #666;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  min-width: 30px; /* 最小幅を固定 */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* 縮小を防ぐ */
}

.search-clear-btn:hover {
  background: #888;
}

.search-options {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

.search-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.search-period {
  display: flex;
  align-items: center;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  cursor: pointer;
}

.filter-option input[type="radio"] {
  margin: 0;
}

.filter-option select {
  padding: 4px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.search-results-info {
  background: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 4px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: #000;
}

.search-results-info .results-count {
  font-weight: 600;
}

.search-results-info .clear-search {
  color: #666;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 8px;
}

.search-results-info .clear-search:hover {
  color: #333;
}

.search-result-reply {
  background: #f0f8ff;
  border: 1px solid #b3d9ff;
  margin-bottom: 16px;
}

/* 検索オプショントグルボタン */
.search-options-toggle-btn {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #666;
  font-weight: normal;
  padding: 6px 8px;
  margin: 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.search-options-toggle-btn:hover {
  background-color: #f5f5f5;
}

.search-options-toggle-btn:active {
  background-color: #e8e8e8;
}

/* モバイル対応 - 検索フォーム */
@media (max-width: 768px) {
  .search-input-group {
    gap: 3px;
    padding: 0 5px;
  }
  
  .search-input {
    font-size: 16px; /* iOSのズーム防止 */
    padding: 8px 10px;
    min-width: 0;
    flex: 1 1 auto;
  }
  
  .search-options-toggle-btn {
    min-width: 34px !important;
    height: 34px !important;
    padding: 6px !important;
    font-size: 16px !important;
  }
  
  .search-clear-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 11px;
  }
  
  .search-filters {
    gap: 12px;
  }
  
  .filter-option {
    font-size: 13px;
  }
  
  .feed-search-area {
    padding: 2px 8px 4px 8px;
  }
}

.reply-badge {
  margin-bottom: 8px;
}

.reply-badge span {
  background: #007acc;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.parent-post-info {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.parent-post-info .text-xs {
  color: #666;
  margin-bottom: 4px;
}

.parent-post-info .text-sm {
  color: #333;
  line-height: 1.4;
}

.view-full-post-btn {
  background: none;
  border: none;
  color: #007acc;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.view-full-post-btn:hover {
  text-decoration: underline;
}

/* ========================================
   🔖 ブックマークシステム統合
======================================== */

/* メインコンテナ */
.bookmarks-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* フィルターセクション */
.bookmark-filters {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid #ddd;
  background: white;
  color: #666;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: #f0f0f0;
  border-color: #999;
}

.filter-btn.active {
  background: #000;
  color: white;
  border-color: #000;
}

/* ブックマークリスト */
.bookmarks-list {
  display: flex;
  flex-direction: column;
  gap: 0; /* gap を0に変更して仕切り線で間隔を管理 */
}

/* 個別ブックマーク */
.bookmark-item {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}

/* 上下仕切り線 */
.bookmark-item::before,
.bookmark-item::after {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(to right, transparent 0%, #e0e0e0 20%, #e0e0e0 80%, transparent 100%);
  z-index: 1;
}

/* 上仕切り線 */
.bookmark-item::before {
  top: 0;
}

/* 下仕切り線 */
.bookmark-item::after {
  bottom: 0;
}

/* 最初のアイテムの上仕切り線を非表示 */
.bookmark-item:first-child::before {
  display: none;
}

/* 最後のアイテムの下仕切り線を非表示 */
.bookmark-item:last-child::after {
  display: none;
}

/* アイテム間のマージン調整 */
.bookmark-item + .bookmark-item {
  margin-top: 15px;
}

.bookmark-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

/* ホバー時の仕切り線調整 */
.bookmark-item:hover::before,
.bookmark-item:hover::after {
  background: linear-gradient(to right, transparent 0%, #ccc 20%, #ccc 80%, transparent 100%);
}

/* ブックマークヘッダー - 新レイアウト */
.bookmark-header {
  position: relative;
  margin-bottom: 12px;
}

/* リンクボタン - 右上配置 */
.bookmark-link-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: 1px solid #ddd;
  color: #666;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  z-index: 1;
}

.bookmark-link-btn:hover {
  background: #000;
  color: white;
  border-color: #000;
}

/* メタ情報行 */
.bookmark-meta-line {
  padding-right: 40px; /* リンクボタン分のスペース確保 */
}

.bookmark-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ページ名バッジ */
.bookmark-type-badge {
  background: #000;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: bold;
  white-space: nowrap;
}

.bookmark-author {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.bookmark-time {
  color: #999;
  font-size: 12px;
}

/* ブックマークコンテンツ */
.bookmark-content {
  color: #333;
  line-height: 1.6;
  margin-top: 8px;
}

.bookmark-text {
  margin-bottom: 10px;
  word-wrap: break-word;
}

.bookmark-image {
  margin: 10px 0;
}

.bookmark-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* イベントブックマーク専用スタイル */
.event-bookmark .bookmark-type-badge {
  background: #000;
  color: #fff;
  border: 1px solid #000;
}

/* フィードブックマーク専用スタイル */
.bookmark-item:not(.event-bookmark):not(.board-bookmark) .bookmark-type-badge {
  background: #666;
  color: #fff;
  border: 1px solid #666;
}

/* 掲示板ブックマーク専用スタイル */
.board-bookmark .bookmark-type-badge {
  background: #fff;
  color: #000;
  border: 1px solid #000;
}

.event-bookmark-title {
  font-size: 16px;
  font-weight: bold;
  color: #000;
  margin: 10px 0;
}

.event-bookmark-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  background: #f8f8f8;
  border-radius: 8px;
}

.event-bookmark-dates,
.event-bookmark-location {
  font-size: 14px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-bookmark-remarks {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-top: 10px;
  padding: 10px;
  background: #fafafa;
  border-left: 3px solid #ddd;
}

/* 参考リンク */
.bookmark-reference-link {
  margin-top: 10px;
}

.reference-link {
  color: #666;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  background: #f0f0f0;
  border-radius: 6px;
  display: inline-block;
  transition: all 0.2s ease;
}

.reference-link:hover {
  background: #e0e0e0;
  color: #333;
}

/* 空状態表示 */
.empty-bookmarks {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-message {
  font-size: 16px;
  margin-bottom: 8px;
  color: #666;
}

.empty-sub {
  font-size: 13px;
  color: #999;
}

/* エラー表示 */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ブックマーク解除ボタン */
.bookmark-remove-container {
  text-align: right;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.bookmark-remove-btn {
  color: #000000;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bookmark-remove-btn:hover {
  text-decoration: underline;
  color: #333333;
}

.bookmark-remove-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ローディング */
.bookmark-loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top: 3px solid #666;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   🎨 プロフィールシステム統合
======================================== */

.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.profile-header {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  display: flex;
  gap: 30px;
  align-items: center;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-bio {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.profile-stats {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
}

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

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.stat-label {
  font-size: 13px;
  color: #999;
  margin-top: 2px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

/* プロフィールアクションボタン（旧リンクスタイル） */
.profile-action-link-old {
  color: black;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  margin-right: 25px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  background: none;
  padding: 0;
}

.profile-action-link-old:hover {
  text-decoration: underline;
}

/* 新プロフィールアクションボタン */
.profile-action-btn {
  display: inline-block;
  padding: 6px 14px;
  margin-right: 10px;
  margin-bottom: 5px;
  font-size: 13.5px;
  font-weight: 500;
  color: #333;
  background-color: #fff;
  border: 1.5px solid #333;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.profile-action-btn:hover {
  background-color: #f5f5f5;
  text-decoration: none;
  border-color: #333;
  color: #333;
}

.profile-action-btn:active {
  background-color: #e8e8e8;
}

/* Discord公開ボタン専用 */
.profile-action-btn.discord-btn {
  background-color: #fff;
  color: #333;
  border-color: #666;
}

.profile-action-btn.discord-btn:hover {
  background-color: #f5f5f5;
  border-color: #666;
}

/* フォロー解除ボタン専用 */
.profile-action-btn.follow-btn {
  background-color: #fff;
  color: #333;
  border-color: #999;
}

.profile-action-btn.follow-btn:hover {
  background-color: #f5f5f5;
  border-color: #999;
}

/* ブロックボタン専用 */
.profile-action-btn.block-btn {
  background-color: #fff;
  color: #333;
  border-color: #000;
}

.profile-action-btn.block-btn:hover {
  background-color: #f5f5f5;
  border-color: #000;
}

/* ブロック解除ボタン専用 */
.profile-action-btn.unblock {
  background-color: #333;
  color: #fff;
  border-color: #333;
}

.profile-action-btn.unblock:hover {
  background-color: #555;
  border-color: #555;
  color: #fff;
}

/* モバイル対応 - プロフィールアクションボタン */
@media (max-width: 768px) {
  .profile-action-btn {
    font-size: 13px;
    padding: 5px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
  }
}

/* ========================================
   🏠 Welcomeページシステム統合
======================================== */

/* ページレイアウト */
.page-with-header {
  min-height: 100vh;
  /* header offset is handled globally via header.fixed-header + * */
  padding-top: 0;
}

.welcome-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: white;
  padding: 20px 20px 40px 20px;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
}

/* メインタイトル */
.main-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  margin-top: 0;
  color: black;
  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
}

/* 説明テキスト */
.description-text {
  font-size: 1rem;
  margin-bottom: 30px;
  font-weight: 400;
  line-height: 1.5;
  font-family: 'Noto Sans JP', sans-serif;
  color: #666;
  max-width: 85%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding: 0 8px;
}

.desktop-only {
  display: none;
}

/* ログインフォーム */
.welcome-login-form {
  width: 100%;
  max-width: 350px;
  margin: 0 auto 20px auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-sizing: border-box;
}

.welcome-input-group {
  width: 100%;
}

.welcome-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
}

.welcome-input:focus {
  border-color: black;
  box-shadow: 0 0 0 1px black;
}

.welcome-login-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 500;
  background-color: black;
  color: white;
  border: 2px solid black;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
  outline: none;
}

.welcome-login-btn:hover {
  background-color: #333;
  border-color: #333;
}

.welcome-login-btn:active {
  background-color: #555;
  transform: translateY(1px);
}

/* 登録セクション */
.welcome-register {
  margin-top: 10px;
  width: 100%;
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.welcome-register-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 500;
  background-color: white;
  color: black;
  border: 2px solid black;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
  box-sizing: border-box;
}

.welcome-register-btn:hover {
  background-color: #f8f8f8;
  border-color: black;
  text-decoration: none;
  transform: translateY(-1px);
}

.welcome-register-btn:active {
  background-color: #eee;
  transform: translateY(1px);
}

/* パスワードリセット セクション */
.welcome-password-reset {
  margin-top: 20px;
  text-align: center;
  width: 100%;
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.password-reset-link {
  color: #333;
  font-size: 0.9rem;
  text-decoration: none;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  transition: color 0.2s ease;
}

.password-reset-link:hover {
  color: #666;
  text-decoration: underline;
}

.password-reset-link:active {
  color: #999;
}

/* エラーメッセージ */
.welcome-error-message {
  color: #d32f2f;
  font-size: 0.9rem;
  margin-bottom: 20px;
  padding: 12px;
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  font-family: 'Noto Sans JP', sans-serif;
  width: 100%;
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  text-align: center;
}

/* デスクトップ対応 */
@media (min-width: 768px) {
  .welcome-page {
    padding: 100px 20px 40px 20px;
  }
  
  .desktop-only {
    display: inline;
  }
}

/* ========================================
   🎯 プロフィール設定ページシステム
======================================== */

.authenticated-body {
  min-height: 100vh;
  background: white;
}

.profile-setup-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
}

.profile-setup-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
  color: black;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-input, .profile-select, .profile-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  box-sizing: border-box;
}

.profile-input:focus, .profile-select:focus, .profile-textarea:focus {
  border-color: #333;
  outline: none;
}

.profile-textarea {
  resize: vertical;
  min-height: 80px;
}

.profile-edit-actions {
  margin-top: 20px;
  text-align: center;
}

.next-btn {
  background: black;
  color: white;
  border: none;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.next-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

.next-btn:active {
  transform: translateY(1px);
}

/* ========================================
   📝 初回登録ページシステム統合
======================================== */

/* 登録コンテナ */
.register-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 5% 20px 20px;
  text-align: center;
  width: 95%;
  max-width: 500px;
  margin: 0 auto;
  box-sizing: border-box;
  min-height: calc(100vh - 65px);
}

/* タイトル */
.title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 30px;
  letter-spacing: 0.5px;
  font-family: 'Noto Sans', sans-serif;
  color: black;
}

/* 登録フォーム */
.register-form {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

/* フォームグループ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

/* フォームラベル */
.form-label {
  font-size: 1rem;
  font-weight: 500;
  color: black;
  font-family: 'Noto Sans JP', sans-serif;
}

/* フォーム入力 - 登録ページ（Welcomeページスタイル） */
.form-input,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
  background: white;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* イベント作成用セレクトボックス（別スタイル維持） */
.prefecture-select {
  min-height: 50px;
  padding: 4px 11px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  transition: all 0.2s ease;
  box-sizing: border-box;
  width: 100%;
}

.form-input:focus,
.form-textarea:focus {
  border-color: black;
  box-shadow: 0 0 0 1px black;
}

.prefecture-select:focus {
  outline: none;
  border-color: #333;
  background: white;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #999;
}

/* 登録ボタン・送信ボタン - 共通スタイル */
.register-btn,
.form-submit-btn {
  width: 100%;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  background-color: #333;
  color: white;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.register-btn:hover:not(:disabled),
.form-submit-btn:hover:not(:disabled) {
  background-color: #000;
  border-color: #000;
}

.register-btn:active:not(:disabled),
.form-submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.register-btn:disabled,
.form-submit-btn:disabled {
  background-color: #666;
  color: #ccc;
  border-color: #666;
  cursor: not-allowed;
  transform: none;
}

/* エラーメッセージ */
.error-message {
  color: #d32f2f;
  font-size: 14px;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 4px;
  font-family: 'Noto Sans JP', sans-serif;
  display: none;
}

/* フィールドノート */
.field-note {
  font-size: 0.75rem;
  color: #666;
  font-family: 'Noto Sans JP', sans-serif;
  text-align: left;
  margin-top: 4px;
  width: 100%;
}

/* ログインリンク */
.login-link {
  margin-top: 20px;
  font-size: 0.9rem;
  color: #666;
  font-family: 'Noto Sans JP', sans-serif;
}

.login-link a {
  color: black;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.login-link a:hover {
  color: #333;
}

/* ========================================
   🎯 ボタンシステム統合
======================================== */

.btn, .button {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background-color: #000;
  color: white;
}

.btn-primary:hover {
  background-color: #374151;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-edit {
  background-color: #000;
  color: white;
}

.btn-edit:hover {
  background-color: #374151;
}

.btn-follow {
  background-color: #6b7280;
  color: white;
}

.btn-unfollow {
  background-color: #dc2626;
  color: white;
}

.btn-block {
  background-color: #dc2626;
  color: white;
}

/* ========================================
   📱 レスポンシブ対応
======================================== */

@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }
  
  .profile-stats {
    gap: 20px;
  }
  
  /* ブックマークページ対応 */
  .bookmarks-container {
    padding: 15px;
  }

  .bookmark-item {
    padding: 15px;
  }

  /* モバイルでの仕切り線調整 */
  .bookmark-item::before,
  .bookmark-item::after {
    left: 15px;
    right: 15px;
  }

  .bookmark-filters {
    padding: 12px;
  }

  .filter-btn {
    padding: 5px 12px;
    font-size: 12px;
  }

  .bookmark-header {
    position: relative;
    margin-bottom: 12px;
  }

  .bookmark-link-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 6px;
    font-size: 12px;
  }

  .bookmark-meta-line {
    padding-right: 35px; /* モバイルでは少し小さく */
  }

  .bookmark-meta {
    width: 100%;
  }

  .bookmark-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  /* Welcomeページ中画面対応 */
  .main-title {
    font-size: 1.9rem;
    margin-bottom: 18px;
  }
  
  .description-text {
    font-size: 0.95rem;
    margin-bottom: 25px;
    max-width: 92%;
    padding: 0 6px;
  }
  
  .welcome-login-form,
  .welcome-register {
    max-width: 100%;
  }
  
  .welcome-input {
    padding: 12px 16px;
  }
  
  .welcome-login-btn,
  .welcome-register-btn {
    padding: 14px 20px;
    font-size: 1rem;
  }
  
  .week-calendar-container .week-day {
    min-height: 80px;
    padding: 4px;
  }
  
  .week-calendar-container .week-day-number {
    font-size: 12px;
  }
  
  /* 登録ページ中画面対応 */
  .register-container {
    padding: 15px 10px;
    min-height: calc(100vh - 60px);
  }
  
  .title {
    font-size: 1.6rem;
    margin-bottom: 25px;
  }
  
  .register-form {
    max-width: 100%;
    gap: 18px;
  }
  
  .form-input,
  .register-btn {
    padding: 16px 20px;
  }
  
  .register-btn {
    font-size: 1rem;
  }
}

/* ========================================
   🚨 ユーティリティクラス  
======================================== */

.hidden {
  display: none;
}

.loading-placeholder,
.no-posts,
.error-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
}

.error-message {
  color: #d32f2f;
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ダークモード対応準備 */
@media (prefers-color-scheme: dark) {
  /* 将来のダークモード実装用 */
}

/* 印刷対応 */
@media print {
  .fixed-header,
  .bottom-nav {
    display: none;
  }
  
  .main-container {
    margin-top: 0;
    padding-bottom: 0;
  }
}

/* ========================================
   イベント機能スタイル（event.css統合）
======================================== */

/* ========================================
   イベント機能 - モノクロUIデザイン
   期間限定ホラー展示・グッズ販売情報共有
======================================== */

/* カラーパレット */
:root {
  --event-black: #000000;
  --event-white: #ffffff;
  --event-gray-900: #111111;
  --event-gray-800: #222222;
  --event-gray-700: #333333;
  --event-gray-600: #666666;
  --event-gray-500: #999999;
  --event-gray-400: #cccccc;
  --event-gray-300: #dddddd;
  --event-gray-200: #eeeeee;
  --event-gray-100: #f8f8f8;
  --event-border: #e0e0e0;
  --event-shadow: rgba(0, 0, 0, 0.1);
}

/* ========================================
   イベント作成セクション
======================================== */
.event-creator-section {
  margin-bottom: 32px;
}

/* 折りたたみボタン */
.event-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--event-white);
  color: var(--event-black);
  border: 2px solid var(--event-black);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.event-toggle-btn:hover {
  background: var(--event-gray-100);
}

.event-toggle-btn .toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.event-toggle-btn.active .toggle-icon {
  transform: rotate(180deg);
}

/* イベント作成フォーム */
.event-creator-form {
  display: none;
  background: var(--event-white);
  border: 2px solid var(--event-gray-900);
  border-radius: 8px;
  padding: 24px;
  margin-top: 16px;
  animation: slideDown 0.3s ease;
}

.event-creator-form.active {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--event-gray-900);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label .required {
  color: var(--event-black);
}

.form-input,
.form-textarea {
  padding: 12px 16px;
  border: 2px solid var(--event-gray-300);
  border-radius: 6px;
  font-size: 15px;
  background: var(--event-white);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--event-black);
  background: var(--event-gray-100);
}

/* チェックボックスと日付入力のスタイル */
input[type="checkbox"] {
  accent-color: var(--event-black);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0);
  cursor: pointer;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-submit-btn {
  padding: 14px 28px;
  background: var(--event-black);
  color: var(--event-white);
  border: 2px solid var(--event-black);
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-submit-btn:hover {
  background: var(--event-white);
  color: var(--event-black);
}

.form-submit-btn:disabled {
  background: var(--event-gray-400);
  border-color: var(--event-gray-400);
  color: var(--event-gray-600);
  cursor: not-allowed;
}

/* ========================================
   月表示カレンダースタイルは削除されました
   週表示カレンダーのみを使用します
======================================== */

/* ========================================
   イベント詳細モーダル
======================================== */
.event-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
}

.event-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.event-modal-content {
  background: var(--event-white);
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  margin: 40px auto;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* モーダルヘッダー */
.event-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 2px solid var(--event-gray-200);
}

.event-modal-title {
  flex: 1;
}

.event-modal-title h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--event-black);
}

.event-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--event-gray-600);
}

.event-modal-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  color: var(--event-gray-600);
  transition: all 0.2s ease;
}

.event-modal-close:hover {
  background: var(--event-gray-100);
  color: var(--event-black);
}

/* モーダルボディ */
.event-modal-body {
  padding: 24px;
}

.event-description {
  margin-bottom: 24px;
}

.event-description h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--event-gray-900);
}

.event-description-content {
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--event-gray-700);
}

.event-reference {
  margin: 16px 0;
  padding: 12px;
  background: var(--event-gray-100);
  border-radius: 6px;
}

.event-reference-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--event-gray-700);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.event-reference-link:hover {
  color: var(--event-black);
}

/* アクションボタン */
.event-modal-actions {
  display: flex;
  gap: 12px;
  padding: 0 24px 24px;
  border-top: 1px solid var(--event-gray-200);
  margin-top: 24px;
  padding-top: 16px;
}

.event-action-btn {
  padding: 10px 20px;
  border: 2px solid var(--event-black);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-action-btn.primary {
  background: var(--event-black);
  color: var(--event-white);
}

.event-action-btn.primary:hover {
  background: var(--event-gray-800);
}

.event-action-btn.secondary {
  background: var(--event-white);
  color: var(--event-black);
}

.event-action-btn.secondary:hover {
  background: var(--event-gray-100);
}

.event-action-btn.bookmarked {
  background: var(--event-gray-700);
  color: var(--event-white);
}

.event-action-btn.danger {
  border-color: var(--event-gray-700);
  color: var(--event-gray-700);
}

.event-action-btn.danger:hover {
  background: var(--event-gray-700);
  color: var(--event-white);
}

/* ========================================
   コメントセクション
======================================== */
.event-comments-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--event-gray-200);
}

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

.comments-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--event-gray-900);
}

.comments-count {
  padding: 4px 12px;
  background: var(--event-gray-900);
  color: var(--event-white);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

/* コメント投稿フォーム */
.comment-form {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--event-gray-100);
  border-radius: 8px;
}

.comment-textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--event-gray-300);
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--event-black);
  background: var(--event-white);
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.comment-image-input {
  display: none;
}

.comment-image-label {
  padding: 8px 16px;
  background: var(--event-white);
  border: 2px solid var(--event-gray-300);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-image-label:hover {
  border-color: var(--event-black);
  background: var(--event-gray-100);
}

.comment-submit-btn {
  padding: 10px 24px;
  background: var(--event-black);
  color: var(--event-white);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-submit-btn:hover {
  background: var(--event-gray-800);
}

.comment-submit-btn:disabled {
  background: var(--event-gray-400);
  color: var(--event-gray-600);
  cursor: not-allowed;
}

/* コメントリスト */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  padding: 16px;
  background: var(--event-white);
  border: 1px solid var(--event-gray-300);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.comment-item:hover {
  border-color: var(--event-gray-600);
  box-shadow: 0 2px 8px var(--event-shadow);
}

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

.comment-user {
  font-size: 14px;
  font-weight: 600;
  color: var(--event-gray-900);
}

.comment-time {
  font-size: 12px;
  color: var(--event-gray-500);
}

.comment-content {
  line-height: 1.6;
  color: var(--event-gray-700);
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.comment-image {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-image:hover {
  opacity: 0.9;
}

.comment-delete-btn {
  padding: 4px 12px;
  background: transparent;
  color: var(--event-gray-500);
  border: 1px solid var(--event-gray-300);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.comment-delete-btn:hover {
  background: var(--event-gray-700);
  color: var(--event-white);
  border-color: var(--event-gray-700);
}

.no-comments {
  text-align: center;
  padding: 40px;
  color: var(--event-gray-500);
  font-size: 14px;
}

/* ========================================
   レスポンシブデザイン
======================================== */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .event-modal-content {
    margin: 20px auto;
    border-radius: 8px;
  }
  
  .event-modal-header {
    padding: 20px;
    flex-direction: column;
    gap: 12px;
  }
  
  .event-modal-close {
    align-self: flex-end;
    position: absolute;
    top: 20px;
    right: 20px;
  }
  
  .event-modal-meta {
    flex-direction: column;
    gap: 8px;
  }
  
  .event-modal-actions {
    flex-direction: column;
  }
  
  .event-action-btn {
    width: 100%;
    justify-content: center;
  }
  
  .comment-form-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .comment-image-label,
  .comment-submit-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   ローディング・エラー表示
======================================== */
.event-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--event-gray-600);
}

.event-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--event-gray-300);
  border-top-color: var(--event-black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.event-error {
  padding: 20px;
  background: var(--event-gray-100);
  border: 2px solid var(--event-gray-300);
  border-radius: 8px;
  text-align: center;
  color: var(--event-gray-700);
}

/* ========================================
   下部ナビゲーション対応
======================================== */
.event-modal-content {
  margin-bottom: 80px; /* 下部ナビゲーション分の余白 */
}

@media (max-width: 768px) {
  .event-modal-content {
    margin-bottom: 100px; /* モバイルでは余白を増やす */
  }
}

/* ========================================
   掲示板 - 最下部スクロールボタン
======================================== */
.scroll-to-bottom-btn {
  position: fixed !important;
  bottom: 30px !important;
  right: 30px !important;
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  background-color: #4A90E2 !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3) !important;
  font-size: 24px !important;
  font-weight: bold !important;
  color: #ffffff !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  transition: all 0.3s ease !important;
  opacity: 0.9 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.scroll-to-bottom-btn:hover {
  background-color: #357ABD !important;
  transform: scale(1.1) !important;
  opacity: 1 !important;
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4) !important;
}

.scroll-to-bottom-btn:active {
  transform: scale(0.95) !important;
}

/* アニメーション効果 */
@keyframes pulse {
  0% {
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.5);
  }
  100% {
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
  }
}

.scroll-to-bottom-btn.pulse {
  animation: pulse 2s infinite;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .scroll-to-bottom-btn {
    bottom: 80px !important; /* ナビゲーションバーの上に表示 */
    right: 20px !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 20px !important;
  }
}