/* General Body & Theme */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 800px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    color: #ffffff;
    margin-bottom: 20px;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
}

/* Introduction Page */
.intro p {
    font-size: 1.2em;
    line-height: 1.6;
    max-width: 600px;
    margin: 20px auto;
}

/* Buttons */
.button, .button-secondary {
    display: inline-block;
    padding: 15px 30px;
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.button-secondary {
    background-color: #6c757d;
}

.button-secondary:hover {
    background-color: #5a6268;
}

/* Detection Page */
.detection-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.video-container {
    position: relative;
    width: 640px;
    height: 480px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
}

#webcam {
    width: 100%;
    height: 100%;
    transform: scaleX(-1); /* Mirror view */
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1); /* Mirror view */
}

#status-box {
    background-color: #1e1e1e;
    padding: 20px 30px;
    border-radius: 8px;
    border: 1px solid #333;
    width: 80%;
    max-width: 640px;
}

#status-box p {
    margin: 0;
    color: #aaa;
}

#status-box #label {
    font-size: 2em;
    font-weight: bold;
    margin: 5px 0 10px 0;
}

.instructions {
    color: #ccc;
    font-style: italic;
}

footer {
    margin-top: 40px;
    color: #888;
}

/* Label Colors */
.status-awake { color: #28a745; }
.status-drowsy { color: #dc3545; }
.status-noface { color: #ffc107; }
.status-uncertain { color: #fd7e14; }