* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 2.2rem;
    font-weight: bold;
    position: relative;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: 100%;
    overflow-y: auto;
    scroll-behavior: auto;
}

.section {
    display: none;
    width: 100%;
}

.section.active {
    display: block;
}

h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: bold;
}


.form-group {
    margin-bottom: 30px;
    width: 100%;
}

label {
    display: block;
    font-weight: bold;
    font-size: 2rem;
}

input, textarea {
    width: 100%;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 2rem;
    background-color: white;
}

/* Disable autocomplete styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    transition: background-color 5000s ease-in-out 0s;
    -webkit-text-fill-color: inherit !important;
}

/* Disable browser's autocomplete highlight */
.no-autocomplete input,
.no-autocomplete textarea,
.no-autocomplete select,
input.no-autocomplete,
textarea.no-autocomplete,
select.no-autocomplete {
    background-color: transparent !important;
}

/* Additional autocomplete prevention */
input[name="employee_name_not_cc"] {
    /* Force browsers to respect autocomplete settings */
    background-image: none !important;
    transition: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

/* Override Chrome's autofill background color */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-animation-name: autofill-fix;
    -webkit-animation-duration: 0s;
    -webkit-animation-delay: 1000s;
}

@-webkit-keyframes autofill-fix {
    from {
        background-color: transparent;
    }
    to {
        background-color: transparent;
    }
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.round-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 25px 0;
    font-size: 2.4rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sr-btn {
    background: #2ecc71;
}

.btn {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 20px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-row {
    display: flex;
    gap: 15px;
}

.btn-row .btn {
    flex: 1;
}

.success-btn {
    background: #2ecc71;
}

#video-container {
    position: relative;
    width: 100%;
    height: 45vh;
    overflow: hidden;
    border-radius: 12px;
    margin: 15px 0;
    background-color: #000;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#qr-canvas {
    display: none;
}

#scan-region {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    border: 4px solid rgba(46, 204, 113, 0.7);
    box-sizing: border-box;
    pointer-events: none;
}

.scanner-status {
    text-align: center;
    background: #f8f8f8;
    border-radius: 12px;
    font-size: 1.6rem;
    font-weight: bold;
}

.progress-bar {
    height: 12px;
    background-color: #f0f0f0;
    border-radius: 6px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #2ecc71;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 1.6rem;
    margin-top: 5px;
    color: #7f8c8d;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 25px; /* Provide overall padding */
    width: 100%;
    max-width: 400px; /* Constrain width */
    margin: auto; /* Center block horizontally and vertically in the flex container */
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    /* --- Use Flexbox for centering --- */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    align-items: center; /* Center content horizontally */
    text-align: center; /* Center text within block elements */
    min-height: 150px; /* Give it a minimum height to look substantial */
}


.completion-message {
    font-size: 1.8rem; /* Slightly smaller is often clearer */
    margin-top: 0; /* Remove default top margin */
    margin-bottom: 25px; /* Control space above the button */
    line-height: 1.5; /* Adjust line spacing */
    width: 100%; /* Ensure it takes full width for centering */
}

#complete-modal .btn {
    margin-top: 0; /* Remove any inherited top margin */
    width: auto; /* Allow button to size based on content and padding */
    min-width: 120px; /* Set a minimum width */
    padding: 12px 30px; /* Adjust padding */
    flex-shrink: 0; /* Prevent button from shrinking */
}



/* Items container styling */
#items-container {
    margin-bottom: 20px;
    display: block !important; /* Force display on all devices */
    width: 100%;
}

.item-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 15px;
    padding: 0 10px;
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 10px;
}

.item-name {
    font-size: 1.7rem;
    font-weight: bold;
    flex: 1;
    min-width: 150px;
    display: block;
    padding: 8px 10px;
    background-color: #e8f4fc;
    border-radius: 6px;
    margin-bottom: 5px;
    color: #2c3e50;
}

.item-issue {
    font-size: 1.4rem;
    color: #e74c3c;
    margin-top: 5px;
    margin-bottom: 5px;
    background-color: #ffebee;
    padding: 8px;
    border-radius: 6px;
}

.input-wrap {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    margin-right: 15px;
}

.input-container {
    display: grid;
    flex: 1;
    text-align: center;
    background-color: #ffffff;
    border-radius: 6px;
    padding: 8px 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}


.input-label {
    font-size: 1.4rem;
    white-space: nowrap;
}

/* Add a class to all input containers to move item name above controls */
.item-card {
    position: relative;
}

/* Make item name bold and clear */
.item-name {
    font-weight: bold;
    font-size: 1.7rem;
    margin-bottom: 10px;
    display: block;
}

/* Style for uniform labels */
.input-label {
    font-weight: normal;
}

.temp-input, .humidity-input {
    padding: 8px;
    font-size: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 5px;
    text-align: center;
    place-self: center;
}


.item-notes textarea {
    min-height: 80px;
    font-size: 1.4rem;
    padding: 10px;
    width: 100%;
}

