body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 800px;
    width: 100%;
}

h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

p {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Hide default file input */
input[type="file"] {
    display: none;
}

/* Style the label as a button */
.custom-file-upload {
    border: 1px solid #ccc;
    display: inline-block;
    padding: 10px 20px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border-radius: 5px;
    transition: background 0.3s;
}

.custom-file-upload:hover {
    background-color: #2980b9;
}

#fileName {
    margin-left: 10px;
    font-style: italic;
}

.workspace {
    margin-top: 20px;
    position: relative;
    width: 100%;
    /* Aspect ratio will be set by canvas */
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000; /* dark background for video area */
    border-radius: 8px;
    overflow: hidden;
}

canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Ensure hidden elements are truly hidden but renderable */
#sourceVideo {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
}

.actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

#recordBtn {
    background-color: #e74c3c; /* Red for recording */
    color: white;
}

#recordBtn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#downloadBtn {
    background-color: #2ecc71; /* Green for download */
    color: white;
}