/* MASTER UNIFIED Photo Zone Styles (v2.0.5 - STABLE) */
#photo-zone-screen,
#photo-zone-screen * {
    box-sizing: border-box;
}

#photo-zone-screen {
    position: fixed;
    inset: 0;
    z-index: 2000000 !important;
    background: #ffffff;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    user-select: none;
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

#photo-zone-screen.active {
    display: flex !important;
}

.photo-zone-container {
    width: 100%;
    max-width: 500px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #ffffff;
    overflow: hidden;
}

.photo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 100%;
    padding: 0 15px;
    position: relative;
    z-index: 10000;
}

.photo-title {
    font-size: 1.3rem;
    color: #ff6b81;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.header-group {
    display: flex;
    gap: 12px;
}

.pz-header-btn {
    width: 44px !important;
    height: 44px !important;
    background: #fff !important;
    border: 1px solid #ffdae0 !important;
    border-radius: 12px !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    background-size: 60% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-shadow: 0 4px 10px rgba(255, 107, 129, 0.1) !important;
    touch-action: none;
    outline: none;
}

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

.icon-flip {
    background-image: url('assets/flip-btn.png') !important;
}

.icon-close {
    background-image: url('assets/x-btn.png') !important;
}

/* Camera: Main Viewport */
.camera-wrapper {
    flex: 1;
    width: 100%;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top: 1px solid #ffdae0;
    border-bottom: 1px solid #ffdae0;
}

#camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#photo-render-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

#sticker-layer {
    position: absolute;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

/* Controls */
.photo-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    height: 110px;
    flex-shrink: 0;
    background: #fff;
}

.pz-capture-btn {
    width: 75px;
    height: 75px;
    background: white !important;
    border: 6px solid #ff6b81 !important;
    border-radius: 50% !important;
    cursor: pointer;
    box-shadow: 0 0 0 4px white, 0 10px 25px rgba(255, 107, 129, 0.4);
    transition: transform 0.1s;
    outline: none;
    padding: 0;
}

.pz-capture-btn:active {
    transform: scale(0.9);
}

.pz-save-btn,
.pz-retake-btn {
    background: #ff6b81 !important;
    color: white !important;
    border: none !important;
    padding: 14px 30px !important;
    border-radius: 30px !important;
    font-weight: 800 !important;
    font-size: 16px;
    cursor: pointer !important;
    box-shadow: 0 6px 15px rgba(255, 107, 129, 0.3) !important;
    transition: transform 0.1s;
}

.pz-save-btn:active, .pz-retake-btn:active {
    transform: scale(0.95);
}

.sticker-shelf {
    height: 130px;
    width: 100%;
    background: #fff;
    border-top: 1px solid #ffdae0;
    padding: 15px 10px;
    overflow-x: auto;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1000;
}

.sticker-list {
    display: flex;
    gap: 12px;
    height: 100%;
    align-items: center;
}

.sticker-item {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 85px;
    height: 85px;
    background: #fff8f9;
    border: 2px solid #ffdae0;
    border-radius: 18px;
    margin: 0 2px;
    flex-shrink: 0;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.sticker-item:active {
    transform: scale(0.9);
}

.sticker-item img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}

/* Placed Stickers */
.placed-sticker {
    position: absolute;
    width: 120px;
    height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: move;
    touch-action: none;
    z-index: 10;
    pointer-events: auto;
}

.placed-sticker.selected {
    outline: 2px dashed #ff6b81;
}

.sticker-trash-btn,
.sticker-transform-btn {
    position: absolute;
    width: 32px;
    height: 32px;
    background: #ff6b81;
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.placed-sticker.selected .sticker-trash-btn,
.placed-sticker.selected .sticker-transform-btn {
    display: flex;
}

.sticker-trash-btn {
    top: -16px;
    right: -16px;
}

.sticker-transform-btn {
    bottom: -16px;
    right: -16px;
}

.hidden {
    display: none !important;
}

.glass {
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.85);
}
