/* 공통 스타일 */
body { 
    text-align: center; 
    font-family: Arial, sans-serif; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    flex-direction: column;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* 촬영 페이지 스타일 */
#container { 
    display: flex; 
    justify-content: space-between; 
    width: 95%;
    max-width: 1200px;
    background-color: transparent;
    padding: 0;
}

#camera-container { 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
    position: relative;
    width: 800px;
    max-width: 100%;
    box-sizing: border-box;
}

#video-wrapper {
    width: 100%;
    height: 500px;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    border: 2px solid black;
    border-radius: 5px;
    margin-bottom: 15px;
}

video { 
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

#canvas {
    display: none;
    width: 100%;
    height: 500px;
}

#capture-btn {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 10px;
}

#capture-btn:hover {
    background-color: #45a049;
}

#flip-camera-btn {
    padding: 12px 24px;
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 10px;
}

#flip-camera-btn:hover {
    background-color: #e68a00;
}

#photo-preview { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    width: 220px;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.preview-title {
    font-size: 24px;
    color: #333;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin: 0 0 15px 0;
    letter-spacing: 1px;
}

.photo-frame { 
    width: 180px; 
    height: 500px; 
    background-color: black; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 5px; 
    justify-content: space-evenly; 
    overflow: hidden;
    margin-bottom: 15px;
}

.photo-frame img { 
    width: 150px; 
    height: auto; 
    max-height: 110px;
    object-fit: contain; 
    margin: 2px 0;
}

.color-buttons { 
    display: none; 
    margin-top: 10px; 
}

/* Retake Button */
#retake-btn {
    background: linear-gradient(135deg, #FFC107, #FFA000);
    color: rgb(252, 252, 252);
    margin-top: 10px;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#retake-btn:hover {
    background: linear-gradient(135deg, #FFB300, #FF6F00);
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#retake-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#download-btn, #share-btn { 
    display: none; 
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 140px;
    font-size: 14px;
}

#download-btn:hover {
    background-color: #0b7dda;
}

#share-btn {
    background-color: #ff9800;
    margin-top: 5px;
}

#share-btn:hover {
    background-color: #e68a00;
}

/* =========================
   ✅ Right Drawer Menu
========================= */

/* top-right toggle button */
#menu-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* "짝대기" */
#menu-toggle .menu-bar {
    width: 2px;
    height: 22px;
    background: #111;
    display: inline-block;
    opacity: 0.9;
}

/* hamburger icon */
#menu-toggle .menu-icon {
    font-size: 22px;
    line-height: 1;
    color: #111;
}

/* drawer panel */
#right-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    background: white;
    z-index: 2500;
    transform: translateX(110%);
    transition: transform 0.28s ease;
    box-shadow: -10px 0 30px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    padding: 16px;
}

/* open state */
#right-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 16px;
}

#drawer-close {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

/* drawer links */
#right-drawer a {
    text-decoration: none;
    color: #111;
    padding: 12px 10px;
    border-radius: 10px;
    margin-top: 6px;
    font-size: 15px;
}

#right-drawer a:hover {
    background: #f3f4f6;
}

/* backdrop */
#drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 2400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

#drawer-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* 📱 모바일 최적화 */
@media (max-width: 768px) {
    #container {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* drawer toggle (mobile) */
    #menu-toggle {
        top: 12px;
        right: 12px;
    }

    /* drawer width (mobile) */
    #right-drawer {
        width: 78vw;
        max-width: 320px;
    }

    /* 📷 카메라 영역 */
    #camera-container {
        width: 100%;
        max-width: 400px;
        margin-top: 70px; /* 메뉴 버튼이 가리지 않도록 여백 */
        margin-bottom: 20px;
        padding: 15px;
    }

    /* 🎥 비디오 화면 */
    #video-wrapper {
        width: 100%;
        max-height: 250px;
        aspect-ratio: 16 / 9;
    }

    /* 📸 촬영 버튼 */
    #capture-btn {
        font-size: 16px;
        padding: 10px 20px;
    }

    #flip-camera-btn {
        font-size: 16px;
        padding: 10px 20px;
    }

    /* 🖼️ 미리보기 영역 */
    #photo-preview {
        width: 90%;
        max-width: 400px;
        padding: 15px;
        margin-bottom: 20px;
    }

    /* 📷 사진 프레임 */
    .photo-frame {
        width: 200px;
        height: 600px;
    }

    .photo-frame img {
        width: 90%;
        height: auto;
        max-height: 22%;
        object-fit: cover;
        margin: 2px 0;
    }

    /* 📥 다운로드 & 공유 & Retake 버튼 */
    #download-btn, #share-btn, #retake-btn {
        width: 120px;
        font-size: 14px;
        padding: 8px 14px;
        margin-bottom: 10px;
    }
}
