body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    text-align: center;
    margin: 0;
    padding: 15px;
    background-color: #f4f4f4;
}
h1 {
    color: #333;
}
#qr-reader {
    /* width: 300px; */ /* Replaced with responsive width */
    width: 90%;      /* Use percentage for flexibility */
    max-width: 400px; /* Set a max width for larger screens */
    margin: 20px auto;
    border: 1px solid #ccc;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* display: none; // Initially hidden, controlled by JS */
}
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    padding-top: 60px; /* Location of the box */
}
.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 25px;
    border: 1px solid #888;
    width: 90%; /* Responsive width */
    max-width: 500px; /* Max width */
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    border-radius: 8px;
    position: relative;
    animation-name: animatetop;
    animation-duration: 0.4s
}
/* Add Animation */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1; /* Adjust line height for better positioning */
    margin-top: -10px; /* Adjust vertical position */
    margin-right: -5px; /* Adjust horizontal position */
}
.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
.modal-message {
    padding: 10px 0; /* Reduced padding */
    text-align: left; /* Align text left for details */
    font-size: 1.1em;
    word-wrap: break-word; /* Ensure long strings wrap */
}
.modal-message p {
    margin: 8px 0; /* Add some spacing between lines */
}
.modal-message .status {
    font-weight: bold;
    font-size: 1.3em;
    text-align: center; /* Center the main status */
    margin-bottom: 15px;
}
.modal-message.success .status {
    color: green;
}
.modal-message.error .status {
    color: red;
}
.modal-message.warning .status {
    color: rgb(252, 160, 1);
}
.scan-button-group {
    margin-bottom: 20px;
    display: flex; /* Use flexbox for layout */
    flex-wrap: wrap; /* Allow buttons to wrap */
    justify-content: center; /* Center buttons */
    gap: 10px; /* Add space between buttons */
}
.scan-button {
    padding: 12px 24px; /* Slightly larger buttons */
    font-size: 1em;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    transition: background-color 0.3s ease;
}
.scan-button:hover {
    background-color: #0056b3;
}
/* Hide elements visually but keep them accessible */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
/* Style for the instruction text */
#instruction-text {
    margin-top: 20px;
    color: #555;
    display: none; /* Initially hidden */
}
