/*
--------------------------------------------------
  ShinyCom 全站共用彈窗樣式
  用於 AlertMessage() 自訂訊息彈窗
--------------------------------------------------
*/
.custom-dialog-mask {
    position: fixed;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.custom-dialog-mask.show {
    opacity: 1;
    pointer-events: auto;
}
.custom-dialog-box {
    position: fixed;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    background: #fefefe;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    padding: 16px 24px;
    z-index: 9999;
    min-width: 240px;
    min-height: 136px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}
.custom-dialog-box.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.custom-dialog-content {
    font-size: 16px;
    margin-bottom: 24px;
    color: #555;
    word-break: break-all;
}
.custom-dialog-btn {
    padding: 8px 24px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    background: #007bff;
    color: #fff;
    cursor: pointer;
    outline: none !important;
}
.custom-dialog-btn:hover {
    background: #0056b3;
}
/* 用於 AlertMessage() 自訂訊息彈窗*/

/**
 * Popover氣泡訊息提示
 */
     /* 移除數字輸入框的上下箭頭 */
 input[type="number"]::-webkit-outer-spin-button,
 input[type="number"]::-webkit-inner-spin-button {
     -webkit-appearance: none;
     margin: 0;
 }
input[type="number"] {
    -moz-appearance: textfield;
    appearance: none;
}
input.value-changing,
input.value-corrected,
input.flash-correction {
    box-sizing: border-box !important;
}
/* 🔧 Bootstrap .form-control 反制樣式 */
.form-control.value-changing,
.form-control.value-corrected,
.form-control.flash-correction {
    /* 覆蓋Bootstrap的transition，避免動畫衝突 */
    transition: all 0.5s ease !important;
    /* 確保border計算正確 */
    box-sizing: border-box !important;
    /* 防止Bootstrap padding影響我們的視覺效果 */
    background-clip: padding-box !important;
}
/* 確保popover在Bootstrap環境下正確顯示 */
.popover-error {
    /* 覆蓋可能的Bootstrap重置樣式 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    box-sizing: border-box !important;
}
.popover-error {
    position: absolute !important;
    max-width: 240px !important;
    background: rgb(185 45 59 / 85%) !important;
    color: #fff !important;
    padding: 6px 14px 7px !important;
    border-radius: 4px !important;
    font-size: .9rem !important;
    line-height: 1.35 !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    will-change: opacity, transform !important;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, .28), 0 2px 6px -1px rgba(0, 0, 0, .18) !important;
    cursor: pointer !important;
    display: block !important;
    visibility: visible !important;
}
.popover-error::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    bottom: -8px !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 8px solid transparent !important;
    border-right: 8px solid transparent !important;
    border-top: 8px solid rgb(185 45 59 / 85%) !important;
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .25)) !important;
}

@media (prefers-reduced-motion: reduce) {
    .popover-error {
        transition: none !important;
        opacity: 1 !important;
    }
}

*[class*="value-changing"],
input[class*="value-changing"],
.value-changing {
    background: linear-gradient(90deg, #fff3cd, #ffeaa7) !important;
    border: 2px solid #ffc107 !important;
    color: #dc3545 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25) !important;
    transition: all 0.5s ease !important;
}

*[class*="value-corrected"],
input[class*="value-corrected"],
.value-corrected {
    background: linear-gradient(90deg, #d1ecf1, #bee5eb) !important;
    border: 2px solid #17a2b8 !important;
    color: #0c5460 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25) !important;
    transition: all 0.5s ease !important;
}

@keyframes flash-correction {
    0% {
        background-color: transparent;
        color: #dc3545 !important;
        font-weight: 700;
        text-shadow: none;
        transform: scale(1);
    }

    25% {
        background-color: #fff3cd;
        color: #dc3545 !important;
        font-weight: 700;
        text-shadow: none;
        transform: scale(1.02);
    }

    50% {
        background-color: #d1ecf1;
        color: #17a2b8 !important;
        font-weight: 700;
        text-shadow: none;
        transform: scale(1.02);
    }

    75% {
        background-color: #d4edda;
        color: #28a745 !important;
        font-weight: 700;
        text-shadow: none;
        transform: scale(1.01);
    }

    100% {
        background-color: transparent;
        color: inherit !important;
        font-weight: normal;
        text-shadow: none;
        transform: scale(1);
    }
}

.flash-correction {
    animation: flash-correction 0.8s ease-in-out;
    border: 2px solid #28a745 !important;
}
/*  Popover氣泡訊息提示*/