/* 留言提及功能樣式 */

.comment-mention-suggestions-container {
    position: relative;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 8px;
    width: 100%;
}

.comment-mention-suggestions-list {
    padding: 8px 0;
}

.comment-mention-suggestion-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.comment-mention-suggestion-item:last-child {
    border-bottom: none;
}

.comment-mention-suggestion-item:hover,
.comment-mention-suggestion-item.active {
    background-color: #f8f9fa;
}

.comment-mention-suggestion-avatar {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    flex-shrink: 0;
}

.comment-mention-suggestion-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-mention-suggestion-info {
    flex: 1;
    min-width: 0;
}

.comment-mention-suggestion-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comment-mention-suggestions-loading,
.comment-mention-suggestions-empty {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.comment-mention-suggestions-loading i {
    margin-right: 8px;
}

/* 留言中的提及連結樣式 - 與貼文標記保持一致 */
.comment-content .user-mention {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    background-color: rgba(0, 123, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-content .user-mention:hover {
    background-color: rgba(0, 123, 255, 0.2);
    text-decoration: none;
    color: #0056b3;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .comment-mention-suggestions-container {
        max-height: 150px;
    }
    
    .comment-mention-suggestion-item {
        padding: 6px 10px;
    }
    
    .comment-mention-suggestion-avatar {
        width: 28px;
        height: 28px;
        margin-right: 8px;
    }
    
    .comment-mention-suggestion-name {
        font-size: 13px;
    }
    
    /* 在詳情頁面模式下的響應式設計 */
    .post-detail-modal-overlay .comment-mention-suggestions-container {
        bottom: 70px; /* 調整為響應式留言區塊的高度 */
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .comment-mention-suggestions-container {
        max-height: 120px;
    }
    
    .comment-mention-suggestion-item {
        padding: 4px 8px;
    }
    
    .comment-mention-suggestion-avatar {
        width: 24px;
        height: 24px;
        margin-right: 6px;
    }
    
    .comment-mention-suggestion-name {
        font-size: 12px;
    }
    
    /* 在詳情頁面模式下的響應式設計 */
    .post-detail-modal-overlay .comment-mention-suggestions-container {
        bottom: 60px; /* 調整為響應式留言區塊的高度 */
        max-height: 120px;
    }
}

/* 確保留言輸入框的相對定位 */
.comment-input-container {
    position: relative;
}

/* 確保建議容器在留言區塊上方正確顯示 */
.add-comment-container {
    position: relative;
}

/* 建議容器在留言區塊上方的樣式優化 */
.comment-mention-suggestions-container {
    position: relative;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    margin-bottom: 12px;
    width: 100%;
}

/* 在詳情頁面模式下，建議列表固定在留言區塊上方 */
.post-detail-modal-overlay .comment-mention-suggestions-container {
    position: fixed;
    bottom: 80px; /* 在固定的留言區塊上方 */
    left: 0;
    right: 0;
    width: 100%;
    background: var(--white);
    border: 1px solid var(--bg-secondary);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10001; /* 比留言區塊的 z-index: 10000 更高 */
    margin-bottom: 0;
    border-radius: 12px 12px 0 0;
    max-height: 200px;
    overflow-y: auto;
}

/* 建議列表項目的樣式優化 */
.comment-mention-suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.comment-mention-suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.comment-mention-suggestion-item:first-child {
    border-radius: 12px 12px 0 0;
}

.comment-mention-suggestion-item:hover,
.comment-mention-suggestion-item.active {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

/* 留言提及建議的動畫效果 */
.comment-mention-suggestions-container {
    animation: fadeInDown 0.2s ease-out;
}

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

