/* features/02-viewer/viewer.css - 중복 제거 클린 버전 */

.viewer-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 🌟 1. 캔버스 컨테이너 설정 */
.canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
    flex: 1;
    overflow: hidden;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* 🌟 2. 캔버스 본체 (투명도 체크무늬 및 안티앨리어싱 방지) */
#main-canvas {
    background-image: 
        linear-gradient(45deg, #2a2b3c 25%, transparent 25%), 
        linear-gradient(-45deg, #2a2b3c 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #2a2b3c 75%), 
        linear-gradient(-45deg, transparent 75%, #2a2b3c 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;

    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
}

/* 🌟 3. UI 컴포넌트 (줌, 안내문구, 로딩) */
.zoom-display {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1000;
    display: none;
}

.placeholder-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    
    /* 🚨 1. 핵심: 체크무늬 캔버스 위로 강제로 끌어올립니다! */
    z-index: 20; 

    /* 🎨 2. 가독성을 위한 예쁜 드롭존(Dropzone) 패널 배경 추가 */
    background: var(--bg-surface); /* 테마에 맞춰 알아서 색이 바뀜 */
    border: 2px dashed var(--border-color); /* 업로드 영역 느낌의 점선 테두리 */
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* 살짝 떠 있는 느낌 */
    
    /* 중앙 정렬 유지 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* 모바일에서도 예쁘게 보이도록 가로 길이 제한 */
    width: 80%;
    max-width: 320px;
}

/* 아이콘 크기와 투명도 조절 */
.placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

/* 텍스트 가독성 강화 */
.placeholder-text {
    color: var(--text-primary); /* 라이트/다크 모드 대비 완벽 적용 */
    font-weight: 800;
    font-size: 1.05em;
    line-height: 1.5;
    word-break: keep-all; /* 단어 중간에 줄바꿈 방지 */
    margin: 0;
}

.loading-indicator {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
}

.loading-indicator p {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
}

/* ==========================================
   🌟 4. 플로팅 툴바 및 다운로드 팝업 공통
========================================== */
.viewer-bottom-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    padding: 8px 16px;
    gap: 8px;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border-radius: 40px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
    z-index: 1000;
    width: max-content;
    max-width: 95vw;
}

.v-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.v-btn:hover { background: var(--bg-color); }
.v-btn:active { transform: scale(0.9); }

.v-divider {
    margin: 0 4px;
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

/* ==========================================
   🌟 5. 다운로드 전용 팝업 및 체크박스
========================================== */
.dl-checkbox-group {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 0.85em;
    font-weight: bold;
    color: var(--text-primary);
}

.dl-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap; /* 🌟 글씨가 찌그러지거나 줄바꿈되어 슬라이더와 겹치는 현상 완벽 차단! */
}

.dl-popup-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.dl-popup {
    display: none;
    position: absolute;
    bottom: 45px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 2000;
    font-weight: normal;
    color: var(--text-primary);
}

.dl-popup-split { left: -20px; width: max-content; }
.dl-popup-wplace { right: -20px; width: 240px; }

.dl-popup-title {
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.dl-popup-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
    align-items: center;
}

.dl-input-number {
    width: 50px;
    text-align: center;
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 4px;
}
.dl-popup-wplace .dl-input-number { width: 100%; }

.dl-label-small {
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.dl-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dl-grid-label {
    font-size: 0.8em;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.dl-popup-tail {
    position: absolute;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.tail-left { left: 45px; transform: translateX(-50%) rotate(45deg); }
.tail-right { right: 40px; transform: translateX(50%) rotate(45deg); }

.dl-btn {
    margin-left: 8px;
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
    transition: all 0.2s ease;
}
.dl-btn:hover { background: linear-gradient(145deg, #41a4e6, #3498db); }
.dl-btn:active { transform: scale(0.95); }