/**
 * Toast Notification System Styles
 * 輕量級通知系統樣式
 */

/* Toast 容器 */
.toast-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

/* 桌面版：右上角 */
@media (min-width: 640px) {
    .toast-container {
        top: 1rem;
        right: 1rem;
        max-width: 400px;
    }
}

/* 行動版：頂部中央 */
@media (max-width: 639px) {
    .toast-container {
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
    }
}

/* Toast 卡片 */
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
    color: white;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* Toast 圖示 */
.toast-icon {
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Toast 訊息 */
.toast-message {
    flex: 1;
    word-break: break-word;
}

/* Toast 關閉按鈕 */
.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* 淡出動畫 */
.toast.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* 滑入動畫 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 淡出動畫 */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 行動版動畫調整 */
@media (max-width: 639px) {
    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }

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

/* 響應式字體調整 */
@media (max-width: 639px) {
    .toast {
        font-size: 0.8125rem;
        padding: 0.875rem;
    }

    .toast-icon {
        font-size: 1.125rem;
    }
}
