/**
 * BlockUI CSS - 全頁遮罩與訊息框樣式
 */

/* 全頁遮罩 */
.blockui-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
}

/* 訊息框 */
.blockui-box {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    z-index: 9999;
    display: none;
    text-align: center;
    min-width: 200px;
    opacity: 0.5;
    font-size: xx-large;
}

.blockui-box span {
    vertical-align: middle;
}

.blockui-box--info {
    background: #000;
}

.blockui-box--loading {
    background: #000;
}

.blockui-box--success {
    background: #def8ac;
    color: #2a9e00;
}

/* ===== CSS 動畫圖示共用 ===== */
.blockui-icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    vertical-align: middle;
    margin-right: 8px;
    position: relative;
}

/* ===== 成功勾勾動畫 ===== */
.blockui-icon--success {
    border-radius: 50%;
    border: 3px solid #2a9e00;
    background: #def8ac;
}
.blockui-icon--success::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 0px;
    width: 11px;
    height: 19px;
    border: solid #2a9e00;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
    animation: checkmark-draw 0.4s ease-out forwards;
}
@keyframes checkmark-draw {
    0% {
        height: 0;
        width: 0;
        opacity: 0;
    }
    40% {
        height: 0;
        width: 12px;
        opacity: 1;
    }
    100% {
        height: 19px;
        width: 11px;
        opacity: 1;
    }
}

/* ===== 失敗叉叉動畫 ===== */
.blockui-icon--error {
    border-radius: 50%;
    border: 3px solid #e74c3c;
    background: #fdecea;
}
.blockui-icon--error::before,
.blockui-icon--error::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 4px;
    background: #e74c3c;
    border-radius: 2px;
}
.blockui-icon--error::before {
    transform: translate(-50%, -50%) rotate(45deg) scaleX(0);
    animation: cross-draw 0.3s 0.1s ease-out forwards;
}
.blockui-icon--error::after {
    transform: translate(-50%, -50%) rotate(-45deg) scaleX(0);
    animation: cross-draw 0.3s 0.25s ease-out forwards;
}
@keyframes cross-draw {
    0% {
        transform: translate(-50%, -50%) rotate(inherit) scaleX(0);
    }
    100% {
        transform: translate(-50%, -50%) rotate(inherit) scaleX(1);
    }
}
/* 修正叉叉旋轉角度 */
.blockui-icon--error::before {
    animation: cross-draw-1 0.3s 0.1s ease-out forwards;
}
.blockui-icon--error::after {
    animation: cross-draw-2 0.3s 0.25s ease-out forwards;
}
@keyframes cross-draw-1 {
    0% { transform: translate(-50%, -50%) rotate(45deg) scaleX(0); }
    100% { transform: translate(-50%, -50%) rotate(45deg) scaleX(1); }
}
@keyframes cross-draw-2 {
    0% { transform: translate(-50%, -50%) rotate(-45deg) scaleX(0); }
    100% { transform: translate(-50%, -50%) rotate(-45deg) scaleX(1); }
}

/* ===== Loading 旋轉動畫 ===== */
.blockui-icon--loading {
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
