/* ========================================
   掲示板カード共通スタイル
   首页とリストページで共用
   ======================================== */

/* フィードタイトル行 */
.board-feed-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.board-feed-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

/* 投稿作成ボタン */
.btn-create-post {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #009de0 0%, #0077b6 100%);
    border: none;
    border-radius: 24px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 157, 224, 0.3);
}

.btn-create-post:hover {
    background: linear-gradient(135deg, #0088c7 0%, #005a8c 100%);
    box-shadow: 0 4px 12px rgba(0, 157, 224, 0.4);
    transform: translateY(-1px);
}

.btn-create-post svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-create-post span {
    white-space: nowrap;
}

/* フィードリスト */
.board-feed-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feed-item {
    margin-bottom: 20px;
}

/* フィードカード */
.feed-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.feed-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feed-card-inner {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 投稿者情報エリア */
.feed-card-author {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.author-link {
    text-decoration: none;
    flex-shrink: 0;
}

.author-avatar {
    width: 100px;
    height: 100px;
    position: relative;
}

.author-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f0f0f0;
    z-index: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    position: relative;
    z-index: 1;
}

.author-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.author-name-link {
    text-decoration: none;
    color: inherit;
}

.author-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.author-name .nickname {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.verified-badge svg {
    width: 16px;
    height: 16px;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.member-level {
    display: inline-block;
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.post-time {
    font-size: 13px;
    color: #999;
}

/* コンテンツエリア */
.feed-card-content {
    position: relative;
}

.feed-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.feed-card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.4;
}

.feed-card-text {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
}

/* 画像エリア */
.feed-card-image {
    margin-top: 15px;
    max-width: 300px;
}

.feed-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

/* カテゴリタグ */
.feed-card-category {
    margin-top: 10px;
}

.category-label {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.category-label:hover {
    background: #e0e0e0;
    color: #0692cc;
}

/* インタラクションエリア */
.feed-card-interactions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    position: relative; /* ポップアップの基準位置 */
}

/* リアクションボタン */
.feed-reactions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative; /* ポップアップの基準位置 */
}

.feed-reaction-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #666;
}

.feed-reaction-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

/* active状態（点击过的按钮） */
.feed-reaction-btn.active {
    background: #fff3e0;
    border: 1px solid #ff9800;
    color: #ff9800;
}

.feed-reaction-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feed-reaction-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.feed-reaction-btn .emoji-icon {
    font-size: 18px;
    line-height: 1;
}

.feed-reaction-btn .reaction-count {
    font-weight: 500;
    color: #333;
}

/* テキストリアクションボタン */
.feed-reaction-btn.text-reaction-btn {
    padding: 6px 12px;
}

.feed-reaction-btn .reaction-text-icon {
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
}

/* カウントが0の場合は非表示 */
.feed-reaction-btn.hidden-count .reaction-count {
    display: none;
}

.feed-reaction-btn.hidden-count {
    opacity: 0.6;
}

.add-reaction-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #999;
}

.add-reaction-btn:hover {
    background: #f5f5f5;
    color: #666;
}

.add-reaction-btn svg {
    width: 22px;
    height: 22px;
}

/* リアクション選択ポップアップ */
.reaction-picker-popup {
    position: absolute;
    z-index: 99999;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 12px;
    width: 400px;
    max-height: 300px;
    overflow-y: auto;
    display: block;
    visibility: visible;
    opacity: 1;
}

.reaction-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    align-items: center;
}

.reaction-picker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 50px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
}

.reaction-picker-item:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}

.reaction-picker-item .emoji-large {
    font-size: 28px;
    line-height: 1;
    display: block;
}

.reaction-picker-item.text-reaction {
    min-width: auto;
    padding: 6px 10px;
}

.reaction-picker-item .reaction-text {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.2;
    text-align: center;
}

/* スクロールバーのスタイル */
.reaction-picker-popup::-webkit-scrollbar {
    width: 6px;
}

.reaction-picker-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.reaction-picker-popup::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.reaction-picker-popup::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* コメントプレビュー */
.feed-comments-preview {
    margin-top: 8px;
}

.comments-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #666;
    font-size: 13px;
}

.comment-avatars {
    display: flex;
    align-items: center;
    gap: -8px;
}

.comment-avatar-item {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    overflow: hidden;
    background: #f0f0f0;
    margin-left: -8px;
}

.comment-avatar-item:first-child {
    margin-left: 0;
}

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

.comment-count-text {
    font-weight: 500;
    color: #333;
}

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .board-feed-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .author-avatar {
        width: 60px;
        height: 60px;
    }
    
    .feed-card-image {
        max-width: 100%;
    }
    
    .btn-create-post {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   管理员徽章样式（首页卡片用）
   ======================================== */

/* 头像容器需要相对定位 */
.author-avatar {
    position: relative !important;
}

/* 管理员徽章（头像右下角） */
.admin-badge-avatar {
    position: absolute;
    bottom: -2px;
    right: -2px;
    display: inline-block;
    padding: 2px 6px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    line-height: 1.3;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* 确保头像容器允许徽章溢出显示 */
.feed-card .author-avatar {
    overflow: visible !important;
}