body {
    margin: 0;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: sans-serif;
}

.camera-ui {
    width: 100%;
    height: 100%;
    background-color: transparent;
    display: flex;
    flex-direction: column;
}

/* --- Top Bar --- */
.top-bar {
    height: 60px;
    background: black;
    display: flex;
    align-items: center;
    justify-content: end;
    padding: 0 20px;
}

.flash-btn {
    width: 50px;
    height: 50px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.flash-btn:active {
    transform: scale(1.5);
    /* Icon gets bigger when pressed */
}

.flash-btn label {
    cursor: pointer;
}

.flash-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.flash-switch .control .on {
    display: block;
}

.flash-switch .control .off {
    display: none;
}

/* When the checkbox IS checked */
.flash-switch input:checked+.control .on {
    display: none;
}

.flash-switch input:checked+.control .off {
    display: block;
}

/* --- Camera container --- */
.camera-container {
    flex-grow: 1;
    width: 100%;
    height: 375px;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-container #video-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* This makes the video fill the div without distorting */
}

.camera-container #start-camera {
    background: #000;
    color: white;
    font-weight: bold;
    font-size: 20px;
    border: 0;
    padding: 20px;
    cursor: pointer;
    border-radius: 50%;
    width: 170px;
    height: 170px;
}

/* --- Bottom Bar --- */
.bottom-bar {
    background: black;
    padding-bottom: 30px;
}

/* Shutter Button Styles */
.shutter-row {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.shutter-outer:active~.gallery-btn,
.action-buttons:has(.shutter-outer:active) .gallery-btn {
    opacity: 0.5;
}

/* Shutter Button Animation */
.shutter-outer {
    width: 70px;
    height: 70px;
    border: 4px solid white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.shutter-inner {
    width: 55px;
    height: 55px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.shutter-outer:active .shutter-inner {
    transform: scale(0.8);
    /* Shrinks white button smoothly */
}

/* Controls Row */
.controls-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
}

/* Gallery Button with Shutter Link Simulation */
.gallery-btn {
    background: #222;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s;
    overflow: hidden;
    padding: 0;

}

/* CSS trick: Dims when the shutter area is being clicked */
.shutter-row:active~.controls-row .gallery-btn {
    opacity: 0.4;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 165px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #222;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 80px;
    left: 4px;
    bottom: 4px;
    border: 1px solid white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.switch .slider .video {
    color: #ffcc03;
    /* Video is yellow by default */
    padding-left: 20px;
}

.switch .slider .photo {
    color: white;
    padding-right: 15px;
}

/* When the checkbox IS checked */
.switch input:checked+.slider .video {
    color: white;
    /* Video turns white */
}

.switch input:checked+.slider .photo {
    color: #ffcc03;
    /* Photo turns yellow */
}

.switch input:checked+.slider:before {
    -webkit-transform: translateX(75px);
    -ms-transform: translateX(75px);
    transform: translateX(75px);
}

/* Rotate Camera Button */
.rotate-btn {
    color: white;
    font-size: 25px;
    background: #222;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s;
}

.rotate-btn:active {
    transform: scale(1.3);
    /* Gets bigger when pressed */
}