@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e0e0e0;
    background-color: #1c1e22; /* Dark base color */
    background-image: url("back01.jpg");
    background-repeat: repeat;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
    padding: 18px 0;
}

.container {
    position: relative;
    text-align: center;
    background: rgb(55, 57, 61);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    width: 90%;
    max-width: 900px;
    height: 120px; /* Reduced height for consistency */
}

h1 {
    color: #ffffff;
    font-size: 2em;
    margin-bottom: 5px; /* Adjusted margin */
    position: relative;
    padding-left: 0;
    padding-right: 0;
    margin-top: -20px; /* Adjusted margin */
    display: flex;
    align-items: center;
    gap: 10px; /* Adjusted gap */
}

h1 > span {
    margin-right: auto;
}

#title-image {
    height: 75px; /* Adjusted height */
    border-radius: 15px;
    order: 2;
    position: relative;
    left: 30px;
    top: 10px;
}

#title-image-right {
    display: none;
}

p {
    font-size: 0.9em;
    color: #d0d0d0;
    text-align: left;
    margin-top: -8px; /* Adjusted margin */
}

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 10px; /* Adjusted margin */
    flex-wrap: wrap;
}

input[type="file"] {
    display: none;
}

.file-label {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 50px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    text-align: center;
}

.file-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
}

#output-container {
    margin-top: 30px;
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background-color: rgb(40, 42, 46);
    padding: 20px;
    border-radius: 15px;
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-right: -40px;
    box-sizing: border-box;
}

.container.loading #output-container {
    margin-top: 10px;
}

#output-container img {
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    padding: 2px;
    max-width: 117px;
    max-height: 192px;
    transition: transform 0.2s ease;
}

#output-container img:hover {
    transform: scale(1.1);
}

.zip-download-button, .save-all-button {
    display: inline-block;
    padding: 10px 20px;
    background-size: 200% auto;
    color: white;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.zip-download-button {
    background-image: linear-gradient(to right, #1D976C 0%, #93F9B9  51%, #1D976C  100%);
    box-shadow: 0 5px 20px rgba(29, 151, 108, 0.5);
}

.zip-download-button:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(29, 151, 108, 0.7);
}

.save-all-button {
    background-image: linear-gradient(to right, #56CCF2 0%, #2F80ED 51%, #56CCF2 100%);
    box-shadow: 0 5px 20px rgba(47, 128, 237, 0.5);
}

.save-all-button:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(47, 128, 237, 0.7);
}

.processing-message {
    margin-top: 20px;
    font-size: 1.2em;
    color: #93F9B9;
}

/* Progress Bar Styles */
.progress-container {
    margin-top: 25px;
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-right: -40px;
    background-color: rgb(40, 42, 46);
    padding: 20px;
    border-radius: 15px;
    box-sizing: border-box;
}

.progress-bar {
    width: 100%;
    background-color: rgba(0,0,0,0.3);
    border-radius: 5px;
    overflow: hidden;
    height: 20px;
}

.progress-bar-inner {
    width: 0%;
    height: 100%;
    background-image: linear-gradient(45deg, #56CCF2, #2F80ED);
    transition: width 0.3s ease-in-out;
    border-radius: 5px;
    background-size: 200% 200%;
    animation: gradient-animation 3s ease infinite;
}

#processing-progress-bar-inner {
    background-image: linear-gradient(45deg, #1D976C, #93F9B9);
}

#download-progress-label {
    font-size: 1.1em;
    margin-bottom: 10px;
    animation: blink-animation 1.5s linear infinite;
}

@keyframes blink-animation {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #2c2f36;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    text-align: left;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

.modal-content h3 {
    margin-top: 0;
    color: #ffffff;
}

.modal-content p {
    line-height: 1.6;
}

.modal-content a {
    color: #56CCF2;
    text-decoration: none;
    transition: color 0.3s ease;
}

.modal-content a:hover {
    color: #93F9B9;
    text-decoration: underline;
}

.modal-buttons {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button.confirm {
    background-color: #007bff;
    color: white;
}

.modal-button.confirm:hover {
    background-color: #0056b3;
}

.modal-button.cancel {
    background-color: #6c757d;
    color: white;
}

.modal-button.cancel:hover {
    background-color: #5a6268;
}

.image-lightbox-content {
    background-color: #1c1e22; /* Darker background for image */
    padding: 15px; /* Less padding */
    max-width: 90vw; /* Max width of viewport */
    max-height: 90vh; /* Max height of viewport */
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensure image fits within bounds */
}

.image-lightbox-close {
    position: absolute;
    top: 5px; /* Closer to top */
    right: 10px; /* Closer to right */
    color: #fff; /* White color for better visibility on dark background */
    font-size: 36px; /* Larger close button */
    cursor: pointer;
    z-index: 1001; /* Ensure it's above the image */
}

.image-lightbox-close:hover {
    color: #aaa;
}

#paypal-button {
    z-index: 1001;
    transition: transform 0.3s ease;
    line-height: 0;
    order: 1;
    position: relative;
    left: 28px;
    top: -7px;
}

#paypal-button img {
    width: 21px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#paypal-button:hover {
    transform: scale(1.05);
}