/* float-bar.css */
/* Float bar container */
.float-bar-container {
    position: fixed;
    bottom: var(--float-bar-bottom);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000; /* Make sure at top layer*/
    display: flex;
    gap: 12px;
    flex-direction: row !important;
    background-color: rgba(245, 245, 245, 0.8);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Float bar buttons */
.float-bar-container > * {
    font-size: 32px;
    cursor: pointer;
    display: none;
    margin: 0 5px !important; /* 添加水平間距 */
    transition: transform 0.2s, color 0.2s; /* 平滑過渡效果 */
    align-items: center;
    justify-content: center;
}

/* Mouse hover for right bar buttons */
.float-bar-container > *:hover {
    transform: scale(1.05);
    transition: transform 0.1s;
}

.float-bar-container a {
    text-decoration: none;
    color: inherit;
    display: flex;  /* 確保 <a> 標籤不會影響圖標顯示 */
}

.float-bar-container a:hover {
    text-decoration: none;
}

#ic-selector-button {
    color: #691010;
}

#video-center-button {
    display: block;
    color: #2980B9;
}

#download-button {
    color: #7e0707;
}

#forum-button {
    display: flex;
}

#forum-button img {
    height: 32px;
    padding-right: 5px;
    display: block;
}

#copy-content-button {
    display: block;
    color: #2980B9;
}

#official-webset-button {
    color: #2980B9;
    display: flex;
}

#ai-chat-button {
    display: flex;
}

#ai-chat-button img {
    height: 32px;
    display: block; /* 避免圖片產生額外底部空間 */
    border-radius: 8px;
}

/* Share button + popup panel (mirrors top build share feature) */
.float-bar-container > .doc-share-wrapper {
    display: flex;
    position: relative;
    align-items: center;
}
/* Don't scale the whole wrapper (and its panel) on hover; scale only the icon */
.float-bar-container > .doc-share-wrapper:hover {
    transform: none;
}
#share-button {
    color: #2980B9;
    transition: transform 0.1s;
}
.doc-share-wrapper:hover #share-button {
    transform: scale(1.05);
}
/* The pop-up panel, anchored above the share icon */
.doc-share-panel {
    display: none;
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    cursor: default;
}
.doc-share-wrapper.active .doc-share-panel,
.doc-share-wrapper:hover .doc-share-panel {
    display: block;
}
/* Invisible bridge spanning the gap so hover survives moving from icon to panel */
.doc-share-panel::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 18px; /* >= the 14px gap below the panel */
    background: transparent;
}
#doc-share-qrcode canvas {
    width: 128px;
    height: 128px;
    display: block;
    margin: 0 auto;
}
.doc-share-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 10px 0;
}
.doc-share-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.doc-share-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #0068B6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}
.doc-share-action i {
    font-size: 16px;
}
.doc-share-action:hover {
    opacity: 0.7;
    color: #fff;
    transform: none;
}
/* Toast notification for copy feedback */
#doc-share-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 2147483648;
}

@media (max-width: 768px) {
    .float-bar-container {
        bottom: 10px; /* 在小螢幕上距離底部更近 */
        width: 90%; /* 限制最大寬度 */
        justify-content: center; /* 確保按鈕在容器中居中 */
    }

    .float-bar-container > * {
        font-size: 20px; /* 在小螢幕上進一步縮小圖標 */
    }

    #ai-chat-button img {
        height: 20px;
        border-radius: 4px;
    }

    #forum-button img {
        height: 20px;
    }
}