@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ============================================
   Comment2 Plugin - Sample Stylesheet
   ============================================ */

/* Comment2 */
.comment2 {
  margin: 2rem 0;
}

.comment2-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.comment2-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
}

.comment2-display-toggle {
  display: flex;
  gap: 0.25rem;
}

.comment2-btn-toggle {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-family: inherit;
  border: 1px solid #ccc;
  background: #fff;
  color: #666;
  cursor: pointer;
  border-radius: 3px;
}

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

.comment2-btn-toggle.is-active {
  background: #337ab7;
  border-color: #337ab7;
  color: #fff;
}

/* コメントアイテム */
.comment2-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.comment2-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.comment2-avatar {
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}

.comment2-username {
  font-size: 0.85rem;
  color: #666;
}

.comment2-time {
  font-size: 0.85rem;
  color: #999;
}

/* コンテンツ（アバター中心の縦ボーダー） */
.comment2-content {
  margin-left: 11px;
  padding-left: 19px;
  border-left: 2px solid #ddd;
}

.comment2-body {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.comment2-body a {
  color: #6b9fd4;
  text-decoration: none;
}

.comment2-body a:hover {
  color: #4a7fb5;
  text-decoration: underline;
}

/* アクション */
.comment2-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* 汎用ボタン */
.comment2-btn {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-family: inherit;
  border: 1px solid #ccc;
  background: #fff;
  color: #666;
  cursor: pointer;
  border-radius: 4px;
}

.comment2-btn:hover {
  background: #f5f5f5;
}

.comment2-btn-sm {
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
}

/* アイコンボタン */
.comment2-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  color: #999;
  font-size: 0;
}

.comment2-btn-icon:hover {
  background: #f0f0f0;
  color: #555;
}

.comment2-btn-icon .material-symbols-outlined {
  font-size: 20px;
}

.comment2-btn-icon-danger:hover {
  color: #d9534f;
  background: #fdf2f2;
}

.comment2-btn-icon-success {
  color: #5cb85c;
}

.comment2-btn-icon-success:hover {
  color: #449d44;
  background: #f0fdf0;
}

/* ステータスフォーム */
.comment2-status-form {
  display: inline;
}

/* いいねボタン */
.comment2-like-wrapper {
  display: inline-flex;
  align-items: center;
}

.comment2-btn-like {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  color: #999;
  font-size: 0;
}

.comment2-btn-like:hover {
  background: #fdf2f2;
  color: #e0245e;
}

.comment2-btn-like.liked {
  color: #e0245e;
}

.comment2-btn-like .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0;
}

.comment2-btn-like.liked .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

.comment2-like-count {
  font-size: 0.8rem;
  color: inherit;
}

/* インラインフォーム（いいね・削除） */
.comment2-like-form,
.comment2-delete-form {
  display: inline;
}

/* 編集フォーム */
.comment2-edit-form {
  margin-top: 0.5rem;
}

/* 返信（子コメント） */
.comment2-reply {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.comment2-reply:last-child {
  border-bottom: none;
}

/* 返信数 */
.comment2-reply-count {
  font-size: 0.85rem;
  color: #337ab7;
  margin: 0.5rem 0 0;
  cursor: pointer;
}

.comment2-reply-count:hover {
  text-decoration: underline;
  color: #286090;
}

/* 非公開バッジ */
.comment2-badge-closed {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  background: #f2dede;
  color: #a94442;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.comment2-item:has(.comment2-badge-closed) {
  opacity: 0.6;
  border-left: 3px solid #d9534f;
}

/* 返信読み込みボタン */
.comment2-load-replies {
  display: inline-block;
  color: #337ab7;
  background: transparent;
  border: none;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  margin-top: 0.5rem;
}

.comment2-load-replies:hover {
  text-decoration: underline;
  color: #286090;
}

/* 返信合計 */
.comment2-reply-total {
  font-size: 0.8rem;
  color: #999;
  margin: 0.5rem 0 0;
}

/* もっとコメントを表示 */
.comment2-more-comments {
  text-align: center;
  margin: 1rem 0;
}

.comment2-load-more {
  color: #337ab7;
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.comment2-load-more:hover {
  text-decoration: underline;
  color: #286090;
}

/* コメントフォーム */
.comment2-form {
  margin-bottom: 1.5rem;
}

.comment2-form-heading {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.comment2-form-group {
  margin-bottom: 0.5rem;
}

.comment2-textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.6;
  field-sizing: content;
  min-height: calc(5lh + 1rem + 2px);
  max-height: 20em;
  overflow-y: auto;
}

.comment2-textarea:focus {
  outline: none;
  border-color: #66afe9;
  box-shadow: 0 0 0 2px rgba(102, 175, 233, 0.3);
}

.comment2-form-actions {
  margin-top: 0.25rem;
}

.comment2-btn-submit {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: #337ab7;
  border: 1px solid #337ab7;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}

.comment2-btn-submit:hover {
  background: #286090;
}

/* エラーメッセージ */
.comment2-error {
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  background: #f2dede;
  color: #a94442;
  border: 1px solid #ebccd1;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* 返信フォーム（インライン） */
.comment2-reply-form {
  margin-top: 0.75rem;
}

.comment2-textarea-reply {
  min-height: calc(3lh + 1rem + 2px);
}

.comment2-reply-form-actions {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.comment2-btn-cancel {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #666;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}

.comment2-btn-cancel:hover {
  background: #f5f5f5;
}

/* 送信中の状態 */
form.htmx-request .comment2-btn-submit {
  opacity: 0.6;
  pointer-events: none;
}

form.htmx-request .comment2-textarea {
  opacity: 0.6;
  pointer-events: none;
}
