/* ================================================
   更新通知 Toast - 使用網站統一的 CSS 變數
   ================================================ */

/* Toast 容器 */
.update-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    z-index: 9999;

    /* 使用 CSS 變數 */
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 10px 50px var(--shadow-hover);
    border: 1px solid var(--border-color);

    /* 初始狀態（隱藏） - 從左側滑入 */
    transform: translateX(calc(-100% - 40px));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;

    /* 防止文字選擇 */
    user-select: none;
    -webkit-user-select: none;
}

/* 顯示狀態 */
.update-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Toast 內容 */
.update-toast-content {
    padding: 20px;
}

/* 標題欄 */
.update-toast-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.update-toast-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    padding-right: 10px;
}

/* 關閉按鈕 */
.update-toast-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.update-toast-close:hover {
    background: var(--accent-primary);
    color: var(--bg-secondary);
    transform: scale(1.05);
}

.update-toast-close:active {
    transform: scale(0.95);
}

/* 主體內容 */
.update-toast-body {
    margin-bottom: 16px;
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 12px;
}

.update-toast-version {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

/* 更新亮點列表 */
.update-toast-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
}

.update-toast-highlights li {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 6px;
    padding-left: 4px;
}

.update-toast-highlights li:last-child {
    margin-bottom: 0;
}

/* 底部按鈕區 */
.update-toast-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* 不再提醒按鈕 - 次要樣式 */
.update-toast-btn-dismiss {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
    cursor: pointer;
}

.update-toast-btn-dismiss:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-light);
}

.update-toast-btn-dismiss:active {
    transform: scale(0.98);
}

/* 詳情按鈕 - 使用網站主色調漸層 */
.update-toast-btn-detail {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(74, 105, 133, 0.4);
}

.update-toast-btn-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(74, 105, 133, 0.6);
    filter: brightness(0.9);
}

.update-toast-btn-detail:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(74, 105, 133, 0.3);
}

/* ================================================
   響應式設計
   ================================================ */

@media (max-width: 768px) {
    .update-toast {
        bottom: 16px;
        left: 16px;
        width: 340px;
        max-width: calc(100vw - 32px);
    }

    .update-toast-content {
        padding: 16px;
    }

    .update-toast-title {
        font-size: 16px;
    }

    .update-toast-highlights li {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .update-toast {
        bottom: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }

    .update-toast-content {
        padding: 14px;
    }

    .update-toast-title {
        font-size: 15px;
    }

    .update-toast-version {
        font-size: 12px;
    }

    .update-toast-highlights li {
        font-size: 13px;
    }

    .update-toast-footer {
        gap: 8px;
    }

    .update-toast-btn-dismiss {
        padding: 7px 12px;
        font-size: 12px;
    }

    .update-toast-btn-detail {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ================================================
   深色模式適配（使用 CSS 變數自動處理）
   ================================================ */

/* 深色模式時，調整陰影和邊框 */
[data-theme="dark"] .update-toast {
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .update-toast-close:hover {
    background: var(--accent-secondary);
}

/* ================================================
   無障礙支持
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    .update-toast {
        transition: opacity 0.1s ease;
    }

    .update-toast-close,
    .update-toast-btn-detail {
        transition: none;
    }
}

/* 鍵盤焦點樣式 */
.update-toast-close:focus-visible,
.update-toast-btn-detail:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ================================================
   打印樣式
   ================================================ */

@media print {
    .update-toast {
        display: none;
    }
}
