:root {
    --camera-bg: #f4f4f4;
    --camera-accent: #333;
    --rainbow-red: #ff3b30;
    --rainbow-orange: #ff9500;
    --rainbow-yellow: #ffcc00;
    --rainbow-green: #4cd964;
    --rainbow-blue: #5ac8fa;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #e0e0e0;
    font-family: 'Permanent Marker', cursive;
}

#photo-wall {
    width: 100%;
    height: 100%;
    position: relative;
    background-image: url('https://www.transparenttextures.com/patterns/cork-board.png');
    /* Optional texture */
    background-color: #dcdcdc;
}

/* Camera Styling */
.camera-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    width: 300px;
    height: 320px;
}

.camera-body {
    width: 100%;
    height: 100%;
    background: var(--camera-bg);
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    box-sizing: border-box;
}

/* Rainbow Stripe */
.camera-body::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom,
            var(--rainbow-red) 20%,
            var(--rainbow-orange) 20% 40%,
            var(--rainbow-yellow) 40% 60%,
            var(--rainbow-green) 60% 80%,
            var(--rainbow-blue) 80%);
    z-index: 1;
    transform: translateY(-50%);
}

.viewfinder {
    width: 220px;
    height: 160px;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    border: 8px solid #333;
    position: relative;
    z-index: 2;
    margin-bottom: 10px;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* Mirror effect */
}

.lens {
    width: 80px;
    height: 80px;
    background: #1a1a1a;
    border-radius: 50%;
    position: absolute;
    bottom: 40px;
    right: 30px;
    border: 4px solid #ccc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lens-inner {
    width: 40px;
    height: 40px;
    background: #000;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, rgba(0, 0, 0, 0) 20%), #000;
}

.flash {
    width: 40px;
    height: 40px;
    background: #444;
    border-radius: 4px;
    position: absolute;
    top: 30px;
    right: 30px;
    border: 2px solid #666;
}

.shutter-btn {
    width: 50px;
    height: 50px;
    background: #ff3b30;
    border-radius: 50%;
    border: 4px solid #d1d1d1;
    position: absolute;
    bottom: 40px;
    left: 30px;
    cursor: pointer;
    box-shadow: 0 4px 0 #b3261e;
    transition: transform 0.1s, box-shadow 0.1s;
    z-index: 2;
}

.shutter-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #b3261e;
}

.output-slot {
    width: 240px;
    height: 12px;
    background: #111;
    position: absolute;
    top: -12px;
    /* Top of the camera */
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    z-index: 0;
}

/* Photo Styling */
.photo {
    width: 200px;
    height: 240px;
    background: #fff;
    padding: 15px 15px 50px 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: absolute;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transform-origin: center;
    cursor: grab;
    transition: filter 3s ease-in-out;
}

.photo:active {
    cursor: grabbing;
}

.photo-content {
    width: 100%;
    height: 170px;
    background: #000;
    overflow: hidden;
    position: relative;
}

.photo-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Developing Animation Classes */
.developing {
    filter: blur(10px) grayscale(100%) brightness(0.2);
}

.developed {
    filter: blur(0) grayscale(0%) brightness(1);
}

/* Ejection Animation */
@keyframes eject {
    0% {
        top: 20px;
        /* Inside camera */
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }

    100% {
        top: -220px;
        /* Fully out */
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* Upload Fallback */
#upload-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #222;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

.upload-btn {
    padding: 10px 20px;
    background: #ff9500;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-family: sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    border: 2px solid #fff;
}

.upload-btn:hover {
    background: #ffcc00;
    color: #333;
}

#file-upload {
    display: none;
}

#uploaded-view {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
}