/* ========================================
   iPhone Camera App Clone Styles
   Pixel-perfect match to iOS 18 Camera
   ======================================== */

/* Camera screen container */
#camera-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

#camera-screen.hidden {
    display: none;
}

/* Video viewfinder — not full screen, leaves room for controls */
#viewfinder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Viewfinder takes ~70% of screen, leaving bottom for controls */
    height: 75%;
    object-fit: cover;
    z-index: 1;
    border-radius: 0 0 12px 12px;
}

/* Flash overlay */
#flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    opacity: 0;
    z-index: 50;
    pointer-events: none;
    transition: none;
}

#flash-overlay.flash {
    animation: flashAnim 0.3s ease-out forwards;
}

@keyframes flashAnim {
    0% { opacity: 0.95; }
    100% { opacity: 0; }
}

/* Offscreen capture canvas */
#capture-canvas {
    display: none;
}

/* ---- Top Bar ---- */
.camera-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: env(safe-area-inset-top, 44px) 16px 12px 16px;
    padding-top: calc(env(safe-area-inset-top, 44px) + 8px);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.top-bar-spacer {
    flex: 1;
}

/* Dark rounded pill containing flash + more buttons */
.top-bar-pill {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(40, 40, 40, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 22px;
    padding: 6px 8px;
}

.pill-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.pill-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

/* ---- Zoom Controls (bottom of viewfinder) ---- */
.zoom-controls {
    position: absolute;
    bottom: 26.5%; /* Just above viewfinder bottom edge */
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.3px;
    padding: 6px 4px;
}

.zoom-active {
    color: #FFD60A;
    background: rgba(60, 60, 60, 0.7);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
}

/* ---- Bottom Controls Area (solid black) ---- */
.camera-bottom-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Shutter button row */
.shutter-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0 18px 0;
}

/* Shutter button */
.shutter-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.65);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.1s ease;
}

.shutter-btn:active {
    transform: scale(0.92);
}

.shutter-inner {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.1s ease;
}

.shutter-btn:active .shutter-inner {
    transform: scale(0.9);
}

/* ---- Bottom Row: thumbnail | mode pill | flip ---- */
.camera-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 28px 16px 28px;
}

/* Thumbnail preview — CIRCULAR like iOS */
.thumbnail-wrap {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
    background: #1c1c1e;
    flex-shrink: 0;
}

.thumbnail-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail-wrap img.visible {
    opacity: 1;
}

/* Capture animation: thumbnail pops in */
.thumbnail-wrap.capture-anim {
    animation: thumbPop 0.35s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes thumbPop {
    0% { transform: scale(0.3); opacity: 0.5; }
    60% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Mode selector pill — dark rounded capsule */
.mode-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(50, 50, 50, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 22px;
    padding: 8px 16px;
}

.mode-item {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 16px;
    transition: color 0.2s;
}

.mode-item.active {
    color: #FFD60A;
}

/* Flip camera button — dark circle */
.flip-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(50, 50, 50, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.flip-btn:active {
    background: rgba(80, 80, 80, 0.8);
}

.flip-btn svg {
    width: 24px;
    height: 24px;
}
