/* コメント機能のスタイル */
.comment_section {
  margin: 30px 0;
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.comment_title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  color: #333;
}

/* コメント一覧 */
.comment_list {
  margin-top: 20px;
  margin-bottom: 30px;
}

.comment_item {
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 5px;
}

.comment_item:last-child {
  border-bottom: none;
}

.comment_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment_author {
  font-weight: bold;
  color: #059ddf;
  margin-right: 10px;
}

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

.comment_content, .parent_comment_content {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
  word-break: break-word;
  white-space: pre-wrap;
  display: block;
}

/* 改行を強制的に表示 */
.comment_content br, .parent_comment_content br {
  display: block;
  content: "";
  margin-top: 0.5em;
}

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

.comment_reply_btn,
.comment_edit_btn,
.comment_delete_btn {
  font-size: 12px;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  margin-right: 5px;
}

.comment_reply_btn:hover,
.comment_edit_btn:hover,
.comment_delete_btn:hover {
  color: #059ddf;
}

/* 返信ボタンの無効化スタイル */
.comment_reply_btn.disabled,
.comment_delete_btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 階層構造 */
.comment_children {
  margin-left: 20px;
  padding-left: 15px;
  border-left: 2px solid #f0f0f0;
}

.comment_reply {
  border-left: 3px solid #ddd;
}

/* レベル別のインデント */
.comment_level_1 { margin-left: 20px; }
.comment_level_2 { margin-left: 40px; }
.comment_level_3 { margin-left: 60px; }
.comment_level_4 { margin-left: 80px; }
.comment_level_5 { margin-left: 100px; }

/* コメント投稿フォーム */
.comment_form_container {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-top: 30px;
}

/* 親コメントプレビュー */
.parent_comment_preview, #parent-comment-preview {
  background-color: #f0f0f0;
  padding: 10px 15px;
  border-radius: 5px;
  margin-bottom: 15px;
  position: relative;
  border-left: 3px solid #ccc;
}

.cancel_reply_btn {
  font-size: 12px;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.comment_form textarea, #comment-content {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  resize: vertical;
  font-size: 14px;
  margin-bottom: 10px;
}

.comment_form_actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char_count, #char-count {
  font-size: 12px;
  color: #999;
}

#char-count.error {
  color: red;
}

.comment_form_buttons {
  display: flex;
  gap: 10px;
}

.cancel_edit_btn, #cancel-edit-btn {
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  color: #666;
  padding: 8px 15px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
}

.submit_comment_btn, #submit-comment-btn {
  background-color: #059ddf;
  border: none;
  color: white;
  padding: 8px 15px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
}

.cancel_edit_btn:hover, #cancel-edit-btn:hover {
  background-color: #e0e0e0;
}

.submit_comment_btn:hover, #submit-comment-btn:hover {
  background-color: #0489c3;
}

.login_message {
  text-align: center;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 5px;
  margin-top: 20px;
}

.login_message a {
  color: #059ddf;
  text-decoration: underline;
}

/* ツールチップスタイル */
[title] {
  position: relative;
  cursor: help;
}

[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
}

/* デバッグ情報 */
#debug-info {
  position: fixed;
  bottom: 0;
  right: 0;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px;
  max-width: 500px;
  max-height: 300px;
  overflow: auto;
  z-index: 9999;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
  .comment_section {
    padding: 15px;
  }
  
  .comment_children {
    margin-left: 10px;
    padding-left: 10px;
  }
  
  .comment_level_1 { margin-left: 10px; }
  .comment_level_2 { margin-left: 20px; }
  .comment_level_3 { margin-left: 30px; }
  .comment_level_4 { margin-left: 40px; }
  .comment_level_5 { margin-left: 50px; }
  
  .comment_form_container {
    padding: 15px;
  }
}

/* tweet__personの画像サイズ制御 */
.tweet__person {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.tweet__person > li {
  list-style-type: none;
}

.tweet__person > li:first-child img {
  width: 100%;
  max-width: 80px;
  height: auto;
  object-fit: cover;
  /* border-radius: 50%; */
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
  .tweet__person > li:first-child img {
    max-width: 60px;
  }
} 