body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f4f4f9;
}

main {
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
}

h1 {
    color: #333;
    margin-bottom: 24px;
}

/* The container for the scanner UI generated by the library */
#reader {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

/* Style the video feed */
#reader video {
    width: 100% !important; /* Important to override inline styles */
    height: auto !important;
    border-radius: 6px;
}

/* Style the buttons and links generated by the library */
#reader button, #reader a {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

/* Result display */
#result {
    margin-top: 20px;
    padding: 15px;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    word-wrap: break-word;
    font-size: 1.1em;
    color: #495057;
    display: none; /* Initially hidden */
}

#result .scanned-text {
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 5px;
    margin-bottom: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

#result .submit-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    background-color: #28a745; /* Green */
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

#result .submit-btn:disabled {
    background-color: #6c757d; /* Gray when disabled */
    cursor: not-allowed;
}