/* Fade-in animation for the form */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide-in animation for the popup */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Basic styling for the form */
#downloadForm {
    padding: 20px;
    background-color: #f4f4f4;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    max-width: 400px;
    margin: auto;
}

#downloadForm.fade-in {
    animation: fadeIn 0.2s ease-in-out forwards;
}

#downloadForm h3 {
    text-align: center;
    color: #333;
}

#downloadForm label {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

#downloadForm input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

#downloadForm input[type="number"] {
    -moz-appearance: textfield;
}

/* Submit button in the form */
#downloadForm button {
    display: inline-block;
    margin: 10px 5px;
    background-color: #008CBA;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#downloadForm button:hover {
    background-color: #007B9E;
    transform: scale(1.05);
}

/* Loading spinner */
#loadingSpinner {
    display: none;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #008CBA;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: auto;
}

/* Download Button */
#downloadBtn {
    display: inline-block;
    margin-top: 20px;
    background-color: #008CBA;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#downloadBtn:hover {
    background-color: #007B9E;
    transform: scale(1.05);
}

/* Popup Modal */
#thankYouPopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#thankYouPopup.slide-in .popupContent {
    animation: slideIn 0.2s ease-in-out forwards;
}

#thankYouPopup .popupContent {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 400px;
    position: relative;
}

#thankYouPopup .popupContent {
    color: #4CAF50;
    font-size: 24px;
}

#popupTitleSorry {
    color: #f00;
}

#thankYouPopup .popupContent.error {
    color: #FF2D00;
}

#thankYouPopup .popupContent p {
    font-size: 16px;
    color: #333;
}

#thankYouPopup .popupContent p.error {
    color: #FF2D00;
}

#thankYouPopup .popupContent .file-selection {
    margin-bottom: 15px;
    text-align: left;
}

#thankYouPopup .popupContent .file-selection p {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

#thankYouPopup .popupContent .file-checkbox {
    display: block;
    margin: 10px 0;
    font-size: 14px;
    color: #333;
}

#thankYouPopup .popupContent .file-checkbox input[type="checkbox"] {
    margin-right: 10px;
    vertical-align: middle;
}

#thankYouPopup .popupContent #filePreview {
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

#thankYouPopup .popupContent #filePreview .preview-item {
    margin-bottom: 15px;
}

#thankYouPopup .popupContent #filePreview img,
#thankYouPopup .popupContent #filePreview iframe {
    max-width: 100%;
    border-radius: 5px;
}

#thankYouPopup .popupContent #filePreview p {
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
}

#thankYouPopup .popupContent #filePreview img {
    width: 64px;
    height: 64px;
}

#thankYouPopup .closeBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #D3D3D3;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    line-height: 0;
    transition: transform 0.2s ease;
}

#thankYouPopup .closeBtn:hover {
    transform: scale(1.1);
}

#thankYouPopup .closeBtn svg {
    width: 20px;
    height: 20px;
    fill: #FFFFFF;
}

#thankYouPopup .closeBtn:hover svg {
    fill: #FF2D00;
}

#thankYouPopup #finalDownloadBtn,
#thankYouPopup #downloadAllBtn {
    display: inline-block;
    margin: 10px 5px;
    background-color: #008CBA;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#thankYouPopup #finalDownloadBtn:hover,
#thankYouPopup #downloadAllBtn:hover {
    background-color: #007B9E;
    transform: scale(1.05);
}