/* Download Loading Popup Styles */
.download-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: auto; /* ให้คลิกได้ */
}

.download-loading-popup {
    background: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    position: relative;
    pointer-events: auto; /* ให้คลิกได้ */
}

/* ป้องกันการ scroll ของ body เมื่อ popup แสดง */
body.popup-open {
    overflow: hidden;
}



.download-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #de5c8b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.download-loading-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.download-loading-subtext {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.download-loading-progress {
    width: 100%;
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.download-loading-progress-bar {
    height: 100%;
    background-color: #de5c8b;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.download-loading-cancel {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-left: auto; /* ย้ายไปทางขวา */
    display: block; /* ให้เป็น block element */
}

.download-loading-cancel:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Success state */
.download-loading-success {
    color: #28a745;
}

.download-loading-success .download-loading-spinner {
    border-top-color: #28a745;
    animation: none;
}

.download-loading-success .download-loading-spinner::after {
    content: "✓";
    font-size: 30px;
    color: #28a745;
    line-height: 60px;
    text-align: center;
    display: block;
}

/* Error state */
.download-loading-error {
    color: #dc3545;
}

.download-loading-error .download-loading-spinner {
    border-top-color: #dc3545;
    animation: none;
}

.download-loading-error .download-loading-spinner::after {
    content: "✗";
    font-size: 30px;
    color: #dc3545;
    line-height: 60px;
    text-align: center;
    display: block;
} 