body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    /* Darker background */
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #fff;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
}

/* --- Left Panel: Controls --- */
.controls-panel {
    flex: 0 0 40%;
    /* 40% width */
    background-color: #0f0f0f;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    box-sizing: border-box;
    overflow-y: auto;
}

h1 {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 800;
    /* Extra bold */
}

/* Accordion */
.effects-accordion {
    margin-bottom: 20px;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.effects-accordion summary {
    padding: 15px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    /* Hide default arrow */
    background-color: #222;
    transition: background-color 0.2s;
}

.effects-accordion summary:hover {
    background-color: #2a2a2a;
}

.effects-accordion summary::-webkit-details-marker {
    display: none;
    /* Hide default arrow for Safari */
}

.effects-accordion[open] summary {
    border-bottom: 1px solid #333;
}

.effects-accordion[open] summary i {
    transform: rotate(180deg);
}

.effects-accordion summary i {
    font-size: 12px;
    transition: transform 0.3s;
}

/* Sliders */
.sliders-container {
    padding: 15px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
    color: #aeaeae;
    font-weight: 600;
}

input[type=range] {
    width: 100%;
    /* Standard reset for styling ranges */
    -webkit-appearance: none;
    background: transparent;
}

/* Thumb styling */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    margin-top: -6px;
    /* center it */
}

/* Track styling */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #444;
    border-radius: 2px;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #fff;
    /* White buttons */
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #e0e0e0;
}

/* Specialized styling for stop button to match mockup grey-ish/blue-ish tint? 
   Actually mockup shows grey detection button and white download button. 
   I'll stick to uniform style for now or slight variation if needed. */
#toggle-btn {
    background-color: #d1d5db;
    /* Light grey */
}

/* Status Indicator */
.status-indicator {
    padding: 10px;
    background-color: #064e3b;
    /* Dark Green bg */
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #a7f3d0;
    /* Light green text */
}

.status-indicator.paused {
    background-color: #7f1d1d;
    /* Dark Red */
    color: #fecaca;
}

.dot {
    height: 10px;
    width: 10px;
    background-color: #fff;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

/* Video Container */
#video-container {
    position: relative;
    width: 100%;
    /* Maintain aspect ratio or fill available space? 
       Let's fill available vertical space with 'object-fit: cover' logic if possible, 
       but video elements are tricky. */
    flex-grow: 1;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The actual video element injected by p5 */
#video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Cover the container */
    display: block;
}

/* Bounding Box Layer */
#bounding-boxes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through if needed */
}

.bounding-box {
    position: absolute;
    border: 2px solid #ffff00;
    /* Yellow border */
    background-color: rgba(255, 255, 0, 0);
    /* box-sizing: border-box included via normalization usually, but explicit here: */
    box-sizing: border-box;
}

.bounding-box-label {
    position: absolute;
    top: -20px;
    /* Position above box */
    left: -2px;
    /* Align with border */
    background-color: #ffff00;
    color: #000;
    font-size: 12px;
    padding: 2px 4px;
    font-weight: bold;
}


/* --- Right Panel: Poster --- */
.poster-panel {
    flex: 0 0 60%;
    /* 60% width */
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    /* optional decorative background pattern? */
}

#canvas-container {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    /* Canvas size is controlled by JS, here we just center it */
}

/* Responsive tweak for smaller screens */
@media (max-width: 800px) {
    .app-container {
        flex-direction: column;
        overflow-y: auto;
        /* Enable scroll on mobile */
    }

    .controls-panel,
    .poster-panel {
        flex: 0 0 auto;
        width: 100%;
    }
}