/**
 * Tweet This - 樣式檔案
 * 為引文分享按鈕和文字選取提示框提供樣式
 */

/* Blockquote 中的 Tweet 按鈕 */
.tweet-this-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tweet-this-btn:hover {
    background: #1d9bf0;
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(29, 155, 240, 0.3);
}

.tweet-this-btn:active {
    transform: scale(0.95);
}

.tweet-this-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 當 hover 在 blockquote 上時顯示按鈕 */
blockquote:hover .tweet-this-btn {
    opacity: 1;
    transform: translateY(0);
}

/* 確保 blockquote 有足夠的空間放置按鈕 */
.gh-content blockquote {
    padding-bottom: 3.5rem;
    margin-bottom: 2rem;
}

/* 文字選取提示框 */
.tweet-selection-tooltip {
    z-index: 9999;
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
}

.tweet-selection-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.tweet-selection-btn:hover {
    background: #1d9bf0;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(29, 155, 240, 0.4);
}

.tweet-selection-btn:active {
    transform: scale(0.98);
}

.tweet-selection-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .tweet-this-btn {
        bottom: 0.5rem;
        right: 0.5rem;
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .tweet-this-btn svg {
        width: 16px;
        height: 16px;
    }

    .gh-content blockquote {
        padding-bottom: 3rem;
    }

    /* 在手機上始終顯示按鈕 */
    .tweet-this-btn {
        opacity: 1;
    }
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    .tweet-this-btn {
        background: #1d9bf0;
    }

    .tweet-this-btn:hover {
        background: #1a8cd8;
    }

    .tweet-selection-btn {
        background: #1d9bf0;
    }

    .tweet-selection-btn:hover {
        background: #1a8cd8;
    }
}

/* 列印時隱藏按鈕 */
@media print {
    .tweet-this-btn,
    .tweet-selection-tooltip {
        display: none !important;
    }
}

/* 無障礙焦點樣式 */
.tweet-this-btn:focus,
.tweet-selection-btn:focus {
    outline: 2px solid #1d9bf0;
    outline-offset: 2px;
}

/* 為沒有指標設備的用戶提供更好的體驗 */
@media (hover: none) {
    .tweet-this-btn {
        opacity: 1;
    }
}
