/* GLOBAL SETTINGS */
* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif; /* Sharp, utilitarian font */
}

body {
    background-color: #ffffff;
    color: #000000;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* APP CONTAINER */
#capture-area {
    width: 100%;
    max-width: 1200px; /* Keeps it tight and readable on large monitors */
    background: #ffffff;
    padding: 10px;
}

/* RED HEADER */
#app-header-container {
    border: 5px solid #000000;
    padding: 15px;
    margin-bottom: 15px;
}

#app-title {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
    color: #000000;
    text-align: left;
    text-transform: uppercase;
}

/* DATE AND TIME ROW */
.split-header-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 15px; /* Space between the two halves */
}

.header-half {
    border: 4px solid #000000;
    flex: 1; /* Makes both halves exactly 50% width */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #ffffff;
}

.dt-text {
    font-size: 24px;
}

.sn-half {
    justify-content: flex-start;
    gap: 20px;
}

.sn-title {
    font-size: 20px;
    font-weight: bold;
    color: #666666;
}

.sn-value {
    font-size: 28px;
    font-weight: bold;
    color: #000000;
}

/* NEW SETTINGS MODAL STYLES FOR RADIO/CHECKBOX */
.row-group {
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.row-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.row-group input[type="radio"] {
    transform: scale(1.5);
    margin: 0;
}

/* OPERATOR AND STATUS ROW */
.info-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.operator-text {
    font-size: 20px;
    text-transform: uppercase;
}

#status-box {
    border: 4px solid #000000;
    padding: 10px 40px;
    font-size: 28px;
    font-weight: bold;
    min-width: 200px;
    text-align: center;
}

/* Status Colors (JS will toggle these classes) */
.status-neutral { background-color: #cccccc; color: #000000; }
.status-pass { background-color: #00b300; color: #ffffff; }
.status-fail { background-color: #e60000; color: #ffffff; }

/* VIEWPORT LAYOUT */
.viewports-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.viewport-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.swap-col {
    padding: 0 15px;
    display: flex;
    align-items: center;
    margin-top: 45px; /* Pushes button down to align with video boxes */
}

/* WEBCAM BOXES */
.viewport-box {
    border: 4px solid #000000;
    background-color: #ffffff;
}

.viewport-header {
    border-bottom: 3px solid #000000;
    text-align: center;
    font-size: 20px;
    padding: 8px;
    font-weight: bold;
}

.video-container {
    width: 100%;
    aspect-ratio: 4/3; /* Standard webcam ratio */
    background-color: #f2f2f2;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.no-camera-text {
    position: absolute;
    font-weight: bold;
    font-size: 20px;
    color: #666666;
    z-index: 1;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2; /* Hides the 'No Camera' text when video is active */
    display: none; /* JS will change to block when active */
}

/* DROPDOWNS */
.util-select {
    border: 3px solid #000000;
    font-size: 20px;
    padding: 5px;
    font-weight: bold;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.hidden {
    display: none;
}

/* BUTTONS */
.swap-btn {
    border: 4px solid #000000;
    background: #ffffff;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 15px;
}

.swap-btn:active { background: #e6e6e6; }

.footer-controls {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
}

.pill-btn {
    border: 4px solid #000000;
    background: #ffffff;
    font-size: 24px;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 50px; /* Creates the rounded shape from your wireframe */
    cursor: pointer;
}

.pill-btn:active { background: #e6e6e6; }

/* MODALS (Popups for Shift Start & Settings) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #ffffff;
    border: 5px solid #000000;
    padding: 30px;
    width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    
    max-height: 90vh; /* Keeps the box from exceeding 90% of the screen height */
    overflow-y: auto; /* Adds a vertical scrollbar automatically */
}

.modal-content h2 {
    margin: 0;
    text-align: center;
    border-bottom: 3px solid #000;
    padding-bottom: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
    font-size: 16px;
}

.form-group input {
    border: 3px solid #000000;
    padding: 10px;
    font-size: 18px;
    text-transform: uppercase;
}

.action-btn {
    background: #000000;
    color: #ffffff;
    border: 3px solid #000000;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.action-btn.outline {
    background: #ffffff;
    color: #000000;
}

.action-btn:active { opacity: 0.8; }