body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f0f2f5;
    margin: 0;
    color: #333;
}

header, footer {
    width: 100%;
    background-color: #007BFF; /* Primary blue */
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 2px rgba(10, 10, 10, 0.1);
    z-index: 1000; /* Ensure header/footer are on top */
}

header {
    position: fixed;
    top: 0;
    left: 0;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
}

.container {
    background: white;
    padding: 2.5rem; /* Increased padding */
    border-radius: 12px; /* Slightly more rounded corners */
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); /* Stronger shadow */
    text-align: center;
    margin-top: 80px; /* Adjust based on header height */
    margin-bottom: 80px; /* Adjust based on footer height */
    min-height: 350px; /* A minimum height to ensure proper spacing */
    width: 90%;
    max-width: 600px; /* Max width for better responsiveness */
    box-sizing: border-box; /* Include padding in width calculation */
}

h1 {
    color: #2c3e50; /* Darker heading color */
    margin-bottom: 0.5rem;
}
p {
    color: #555;
    margin-bottom: 1.5rem;
}
#upload-form {
    margin-top: 1.5rem;
}
#file-input {
    display: none;
}
.custom-file-upload {
    border: 2px dashed #a7b7c7; /* Softer dashed border */
    padding: 1.5rem 2rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block; /* To allow padding/sizing */
    color: #666;
    font-weight: 500;
}
.custom-file-upload:hover {
    background-color: #eef2f6; /* Lighter hover background */
    border-color: #007BFF; /* Primary color on hover */
    color: #007BFF;
}
#result-container {
    margin-top: 2.5rem; /* More space above results */
}
#result-image {
    max-width: 100%;
    height: auto; /* Maintain aspect ratio */
    border: 1px solid #ddd;
    border-radius: 8px;
    display: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* --- New/Improved Download Button Styling --- */
#download-btn {
    background: linear-gradient(135deg, #007BFF 0%, #0056b3 100%); /* Blue gradient */
    color: white;
    padding: 12px 25px; /* More generous padding */
    border: none;
    border-radius: 50px; /* Pill-shaped button */
    cursor: pointer;
    margin-top: 1.5rem; /* More space below image */
    display: none;
    font-size: 1.1rem; /* Slightly larger text */
    font-weight: 600; /* Bolder text */
    letter-spacing: 0.5px; /* Small letter spacing */
    transition: all 0.3s ease; /* Smooth transitions */
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3); /* Soft blue shadow */
    text-decoration: none; /* Remove underline from anchor */
    display: inline-flex; /* For icon and text alignment */
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between icon and text */
}

#download-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%); /* Darker gradient on hover */
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.4); /* Stronger shadow on hover */
    transform: translateY(-2px); /* Slight lift effect */
}

#download-btn:active {
    transform: translateY(0); /* Press effect */
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

#loading-message {
    margin-top: 1.5rem;
    color: #555;
    display: none;
    font-style: italic;
}