/* C_017 下載功能增強樣式 */

/* 下載狀態樣式 */
.download-card {
    position: relative;
    transition: all 0.3s ease;
    width: 100%;
    height: auto;
}

.download-card.downloading {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.download-card.downloading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: inherit;
    z-index: 1;
}

/* 下載進度指示器 */
.download-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast 通知樣式 */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.4;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

.toast.warning {
    background: #ff6700; /* 橘色主題 */
}

.toast.info {
    background: #2196F3;
}

/* 全域下載提示 */
.download-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2196F3;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
    font-size: 14px;
    font-weight: 500;
}

.download-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.download-notification .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

.download-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

/* 響應式調整 - 配合 1024px 斷點 */
@media (min-width: 1024px) {
    .download-notification {
        bottom: 30px;
        padding: 16px 32px;
        font-size: 16px;
    }
    
    .download-progress {
        padding: 12px;
    }
    
    .spinner {
        width: 24px;
        height: 24px;
    }
    
    .toast {
        max-width: 400px;
        padding: 16px 24px;
        font-size: 16px;
    }
    
    #toast-container {
        top: 30px;
        right: 30px;
    }
}

/* 特別針對服務契約頁面的調整 */
.service-agreement-lists .download-card-wrapper {
    position: relative;
}

/* 確保在 type-bg 環境下的層級正確 */
.type-bg .download-notification {
    z-index: 9998;
}

.type-bg #toast-container {
    z-index: 9999;
}