/* CMM 全域 Loading 樣式 */

/* Loading 覆蓋層 */
.cmm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cmm-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Loading 動畫容器 */
.cmm-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Loading Spinner */
.cmm-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #C39F57;
    border-radius: 50%;
    animation: cmm-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes cmm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading 文字 */
.cmm-loading-text {
    color: #C39F57;
    font-size: 16px;
    font-weight: bold;
    font-family: "Noto Sans TC", sans-serif;
}

/* Logo 樣式 */
.cmm-loading-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    opacity: 0.8;
}

/* 進度條樣式 */
.cmm-loading-progress {
    width: 200px;
    height: 4px;
    background: #f3f3f3;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
}

.cmm-loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #C39F57 0%, #f0d084 100%);
    width: 0%;
    animation: cmm-progress 2s ease-in-out infinite;
}

@keyframes cmm-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 頁面內容初始隱藏 */
.cmm-page-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.cmm-page-content.loaded {
    opacity: 1;
    visibility: visible;
}

/* 響應式設計 */
@media screen and (max-width: 480px) {
    .cmm-loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .cmm-loading-text {
        font-size: 14px;
    }
    
    .cmm-loading-logo {
        width: 50px;
        height: 50px;
    }
    
    .cmm-loading-progress {
        width: 150px;
    }
}