/* ===========================
   Custom Toast 美化提示系統
   =========================== */

/* Toast 基礎樣式 */
.custom-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    min-width: 280px;
    max-width: 90%;
    padding: 20px 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.custom-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Toast 圖標 */
.custom-toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Toast 訊息 */
.custom-toast-message {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary, #1a1a1a);
    white-space: pre-line;
}

/* Toast 類型樣式 */
.custom-toast-success .custom-toast-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.custom-toast-error .custom-toast-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.custom-toast-info .custom-toast-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.custom-toast-warning .custom-toast-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

/* ===========================
   Custom Modal 確認對話框
   =========================== */

/* Modal 遮罩 */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
}

.custom-modal-overlay.hiding {
    opacity: 0;
}

/* Modal 主體 */
.custom-modal {
    background: white;
    border-radius: 20px;
    padding: 32px 24px 24px;
    min-width: 320px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-modal-overlay.show .custom-modal {
    transform: scale(1);
}

/* Modal 圖標 */
.custom-modal-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

/* Modal 訊息 */
.custom-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary, #1a1a1a);
    text-align: center;
    margin-bottom: 24px;
    white-space: pre-line;
}

/* Modal 按鈕區 */
.custom-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.custom-modal-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.custom-modal-btn-cancel:hover {
    background: #e8e8e8;
}

.custom-modal-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.custom-modal-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.custom-modal-btn-confirm:active {
    transform: translateY(0);
}

/* 響應式調整 */
@media (max-width: 480px) {
    .custom-toast {
        min-width: auto;
        width: 90%;
    }

    .custom-modal {
        min-width: auto;
        width: 90%;
        padding: 24px 20px 20px;
    }

    .custom-modal-actions {
        flex-direction: column-reverse;
    }

    .custom-modal-btn {
        width: 100%;
    }
}

/* ===========================
   Simple Tooltip 單字翻譯提示
   =========================== */

.simple-tooltip {
    position: fixed;
    background: #1a1a1a;
    color: white;
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    min-width: 60px;
    max-width: 200px;
    text-align: center;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
}

.simple-tooltip.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}