/* Universal box-sizing for predictable layout */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    width: 100%; /* Ensure html takes full width */
    height: 100%; /* Ensure html takes full height */
    margin: 0;
    padding: 0;
    /* box-sizing is now covered by the universal selector */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Ensures the page takes full viewport height */
    width: 100%; /* Changed from 100vw back to 100% - generally safer with padding */
    margin: 0;
    background-color: #f0f2f5; /* Light gray background */
    color: #333;
    padding: 20px; /* This padding will now correctly show the background color on all sides */
    /* box-sizing is now covered by the universal selector */
}

.container {
    background-color: #fff;
    padding: 30px 40px; /* Top/bottom: 30px, Left/right: 40px */
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 450px; /* Limit width for better readability on larger screens */
    width: 100%; /* Ensures it fills available space within body's padding */
    /* box-sizing is now covered by the universal selector */
}

.header-section {
    margin-bottom: 25px;
}

.centerImage {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 15%;
    margin-right: 15px;
}

.app-name {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    letter-spacing: -1px;
}

.title {
    font-size: 1.5em;
    color: #2c3e50;
    margin-top: 10px;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 25px;
}

/* Base button styles - common to both */
button {
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    margin: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    min-width: 180px;
    /* box-sizing is now covered by the universal selector */
}

/* Style for the Upload File button */
#uploadFileBtn {
    background-color: #007bff;
}

#uploadFileBtn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Style for the Take Photo button */
#takePhotoBtn {
    background-color: #FFA000;
}

#takePhotoBtn:hover {
    background-color: #E68A00;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

.preview-img {
    max-width: 100%;
    max-height: 250px;
    margin-top: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: block;
    margin-left: auto;
    margin-right: auto;
    /* box-sizing is now covered by the universal selector */
}

#progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 25px;
    height: 15px;
    overflow: hidden;
    /* box-sizing is now covered by the universal selector */
}

#progress-bar {
    height: 100%;
    width: 0%;
    background-color: #28a745;
    border-radius: 5px;
    transition: width 0.3s ease-in-out;

    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 30px 30px;
    animation: moveStripes 1s linear infinite paused;
    /* box-sizing is now covered by the universal selector */
}

.is-uploading #progress-bar {
    animation-play-state: running;
}

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

#status {
    margin-top: 20px;
    font-size: 1.1em;
    color: #666;
    min-height: 20px;
    /* box-sizing is now covered by the universal selector */
}

/* --- Footer Link Styles --- */
.footer-links {
    margin-top: 30px;
    font-size: 0.9em;
    /* box-sizing is now covered by the universal selector */
}

.footer-links a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #0056b3;
    text-decoration: underline;
}
/* --- End Footer Link Styles --- */


@media (max-width: 600px) {
    .container {
        padding: 20px 25px; /* Adjust padding for small screens */
    }

    button {
        padding: 16px 20px;
        font-size: 1em;
        margin: 25px auto; /* Center buttons horizontally */
        min-width: unset;
        width: calc(100% - 16px); /* Full width minus side margins */
        display: block; /* Make buttons block level to stack on small screens */
    }

    .app-name {
        font-size: 2em;
    }

    .title {
        font-size: 1.2em;
    }
}