/* camera.css — 構圖相機樣式 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body.camera-page {
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    -webkit-user-select: none;
    user-select: none;
}

/* 啟動畫面 */
#start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    gap: 20px;
    padding: 40px;
    text-align: center;
}

#start-screen h1 {
    font-size: 24px;
    font-weight: 700;
}

#start-screen p {
    font-size: 14px;
    color: #aaa;
    max-width: 280px;
    line-height: 1.6;
}

#start-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 14px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.15s;
}

#start-btn:active {
    transform: scale(0.95);
}

/* 相機畫面 */
#camera-screen {
    display: none;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    position: relative;
}

/* 影像區 */
.video-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

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

#guide-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 拍照閃光動畫 */
#camera-screen.flash .video-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    animation: flashAnim 0.2s ease-out;
}

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

/* 構圖說明 */
.mode-info {
    background: rgba(0, 0, 0, 0.85);
    padding: 10px 16px;
    text-align: center;
}

#mode-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

#mode-desc {
    font-size: 12px;
    color: #aaa;
}

#mode-guide {
    font-size: 12px;
    color: #f0c040;
    margin-top: 4px;
    font-weight: 500;
}

/* 模式選擇列 */
.mode-bar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.9);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mode-bar::-webkit-scrollbar {
    display: none;
}

.mode-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ccc;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border-color: #fff;
    font-weight: 600;
}

.mode-btn:active {
    transform: scale(0.95);
}

/* 底部操作列 */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.9);
}

.action-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

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

#capture-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
}

#capture-btn::after {
    content: '';
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.15s;
}

#capture-btn:active::after {
    transform: translate(-50%, -50%) scale(0.85);
}

#switch-btn svg,
.back-btn svg {
    width: 28px;
    height: 28px;
}

/* 返回按鈕 */
.back-btn {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

/* 拍照預覽彈窗 */
#preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-bottom: 16px;
    color: #aaa;
    font-size: 14px;
}

#preview-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

#preview-img {
    max-width: 90%;
    max-height: 60vh;
    border-radius: 8px;
    -webkit-touch-callout: default;
}

.preview-save-btn {
    margin-top: 20px;
    background: #fff;
    color: #000;
    border: none;
    padding: 12px 32px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
