.qr-scanner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
}

.camera-selection {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.camera-selection label {
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
}

.camera-selection select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 1em;
    width: 100%;
    max-width: 250px;
    background-color: white;
    cursor: pointer;
}

.header-section #page-title {
    color: white; /* Changed color to white for better contrast with header background */
    margin: 0;
    font-size: 2.2em;
    font-weight: bold;
    text-align: center;
    width: 100%; /* Ensure it takes full width for centering */
}

.main-container .curved-box {
    margin-top: 0; /* Override the large margin from index.html */
}

.video-wrapper {
    position: relative; /* Establish a new positioning context */
    width: 100%; /* Make it responsive */
    max-width: 250px; /* Limit max size */
    aspect-ratio: 1 / 1; /* Maintain square aspect ratio */
    margin-bottom: 20px; /* Move margin from video to wrapper */
    border-radius: 8px; /* Apply border-radius to wrapper */
    overflow: hidden; /* Clip content outside the rounded corners */
}

#qr-video {
    width: 100%; /* Fill the wrapper */
    height: 100%; /* Fill the wrapper */
    object-fit: cover; /* Crop video to fit the square */
    border: 2px solid #ddd; /* Keep border on video */
    border-radius: 8px; /* Keep border-radius on video */
    /* Removed margin-bottom as it's now on the wrapper */
}

#scan-area-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%; /* Percentage of parent (video-wrapper) */
    height: 80%; /* Percentage of parent (video-wrapper) */
    border: 3px dashed #007bff; /* Blue dashed border */
    border-radius: 8px;
    pointer-events: none; /* Allow clicks to pass through to video */
    z-index: 10; /* Ensure it's above the video */
}

#qr-result {
    margin-top: 20px;
    font-size: 1.2em;
    color: #555;
    word-wrap: break-word;
    max-width: 100%;
    padding: 10px;
    background-color: #e9e9e9;
    border-radius: 5px;
}

#start-scan-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

#start-scan-button:hover {
    background-color: #0056b3;
}