body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    text-align: center;
    margin: 0;
    padding: 0;
}
.container {
    margin-top: 50px;
    padding: 0 15px; /* Add side padding to prevent text touching screen edges */
}
h1 {
    color: #00bcd4;
    margin-bottom: 5px;
}

.hero-eyebrow {
    margin: 8px 0 6px;
    color: #ffd54f;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-intro {
    max-width: 780px;
    margin: 0 auto 18px;
    color: #cfd8dc;
    font-size: 1.05rem;
    line-height: 1.6;
}
.video-container {
    margin: 20px auto;
    border: 4px solid #333;
    border-radius: 12px;
    display: block;
    width: min(640px, 100%);
    box-sizing: border-box; /* Include border in width calculation */
    overflow: hidden;
    box-shadow: 0px 0px 20px rgba(0, 188, 212, 0.5);
}
img {
    display: block;
    max-width: 100%;
    height: auto;
}

video {
    display: block;
    max-width: 100%;
    height: auto;
}
.instructions {
    color: #aaaaaa;
    font-size: 1.1em;
}

.camera-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
}

.camera-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-screen-message {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    padding: 12px 18px;
    border-radius: 10px;
    border: 2px solid #ff8a80;
    background: rgba(183, 28, 28, 0.75);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: capitalize;
}

.camera-screen-message-stop {
    box-shadow: 0 0 18px rgba(255, 82, 82, 0.5);
}

.camera-screen-message-hint {
    border-color: #80deea;
    background: rgba(0, 105, 120, 0.78);
    box-shadow: 0 0 18px rgba(0, 188, 212, 0.45);
}
.brightness-panel {
    max-width: 640px;
    margin: 10px auto 0;
    padding: 14px 18px 16px;
    background: #232323;
    border: 1px solid #353535;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    text-align: left;
}

.brightness-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: #f1f1f1;
    font-weight: 600;
}

#brightness-range {
    width: 100%;
    margin: 0;
    accent-color: #00bcd4;
}

.brightness-track {
    position: relative;
    height: 10px;
    margin-top: 10px;
    background: #111;
    border-radius: 999px;
    overflow: hidden;
}

.brightness-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff5252 0%, #ffd54f 50%, #4caf50 100%);
    border-radius: inherit;
    transition: width 0.15s ease;
}

.gesture-status {
    margin-top: 10px;
    color: #cfd8dc;
    font-size: 0.95em;
}

.btn {
    background-color: #f44336; /* Red for Stop */
    color: white;
    padding: 10px 20px;
    margin: 20px auto;
    display: block;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn:hover {
    background-color: #d32f2f;
}
.btn.btn-off {
    background-color: #4CAF50; /* Green for Start */
}
.btn.btn-off:hover {
    background-color: #388E3C;
}

/* Home Page & Navigation Styles */
.project-details {
    background-color: #2a2a2a;
    padding: 20px 30px;
    border-radius: 10px;
    margin: 30px auto;
    max-width: 1000px;
    line-height: 1.6;
    color: #dddddd;
    text-align: left;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.3);
}
a.btn-start {
    text-decoration: none;
    background-color: #00bcd4;
    color: #1a1a1a;
    font-weight: bold;
    width: fit-content;
}
a.btn-start:hover {
    background-color: #008ba3;
}
.back-link {
    color: #00bcd4;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
    font-size: 1.1em;
    transition: color 0.3s;
}
.back-link:hover {
    color: #ffffff;
}

/* Camera Permission Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal {
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    box-shadow: 0px 0px 25px rgba(0, 188, 212, 0.4);
    border: 2px solid #333;
    margin: 15px;
}
.modal p {
    color: #dddddd;
    margin-bottom: 25px;
    line-height: 1.5;
}

.mobile-camera-help {
    text-align: left;
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.4);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.mobile-camera-help p {
    margin: 0 0 8px;
    color: #b2ebf2;
}

.mobile-camera-help ol {
    margin: 0;
    padding-left: 18px;
    color: #e0f7fa;
}

.mobile-camera-help li {
    margin-bottom: 6px;
}

/* Home Page Table Styles */
.project-details table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.project-details table tr {
    border: 1px solid #555;
}

.project-details table th,
.project-details table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #555;
}

.project-details table th {
    background-color: #333;
    font-weight: 600;
    color: #00bcd4;
}

.project-details table tr:nth-child(even) {
    background-color: #232323;
}

.project-details code {
    background-color: #1a1a1a;
    padding: 4px 8px;
    border-radius: 4px;
    color: #80deea;
    font-family: 'Courier New', monospace;
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #00bcd4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive Styles */
@media (max-width: 600px) {
    .container {
        margin-top: 20px;
    }
    h1 {
        font-size: 1.5em;
    }
    .instructions {
        font-size: 1em;
    }
    .btn {
        width: 100%;
        max-width: 300px;
    }
}