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

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* 전체 스크롤바 방지 */
}

body {
    font-family: 'Outfit', 'Apple SD Gothic Neo', sans-serif;
    background: #f8f9fa;
    color: #1a1a1a;
}

.container {
    display: flex;
    width: 100%;
    margin: 0;
    background: #ffffff;
    height: 100vh;
    /* iframe의 높이를 100% 사용 */
    overflow: hidden;
}

/* 醫뚯륫 3D 酉곗뼱 */
.viewer-section {
    flex: 6;
    background: #f0f2f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 100%;
}

#canvas3d {
    width: 100%;
    height: 100%;
    display: block;
}

/* 비네팅 효과 - 가운데 밝고 바깥쪽 살짝 어둡게 */
.vignette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center,
            transparent 50%,
            rgba(0, 0, 0, 0.05) 75%,
            rgba(0, 0, 0, 0.12) 100%);
    z-index: 1;
}

.size-display {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.size-label {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.size-label.total {
    font-size: 18px;
    margin-bottom: 12px;
    display: inline-block;
}

.size-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.size-left {
    display: none;
}

.size-scale {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

.size-scale.vertical {
    flex-direction: column;
    align-items: flex-start;
}

.size-tick {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    line-height: 1.2;
}

.size-tick::before {
    content: "";
    display: block;
    background: #555;
    opacity: 0.6;
}

.size-scale:not(.vertical) .size-tick::before {
    height: 2px;
    width: 40px;
}

.size-scale.vertical .size-tick::before {
    width: 2px;
    height: 32px;
}

.size-tick-value {
    font-weight: 600;
    font-size: 12px;
}

.size-tick-label {
    font-size: 11px;
    color: #777;
}

.hint-message {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 5;
}

/* ?곗륫 ?듭뀡 ?⑤꼸 */
.options-panel {
    flex: 4;
    padding: 32px;
    overflow-y: auto;
    background: #ffffff;
    border-left: 1px solid #eee;
}

.options-panel h1 {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111;
}

.input-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    transition: all 0.2s;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: #999;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.checkbox-label span {
    white-space: nowrap;
}

.input-hint {
    font-size: 12px;
    color: #777;
    margin-top: -12px;
    margin-bottom: 16px;
    min-height: 16px;
}

.input-hint.hint-error {
    color: #d9534f;
}

.input-hint.hint-info {
    color: #007bff;
}

.input-group input.input-error {
    border-color: #d9534f;
    background: #fff5f5;
}

.dimension-summary {
    background: #f6f7f9;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 30px;
}

.summary-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 6px;
}

.summary-label {
    color: #666;
}

.summary-value {
    font-weight: 700;
    color: #111;
}

.layout-preview {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    align-items: stretch;
}

.preview-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: #f1f3f5;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    padding: 8px;
    min-width: 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.preview-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--preview-thumb, none);
    background-size: cover;
    background-position: center;
    opacity: 0.15;
}

.preview-block .preview-label {
    font-size: 12px;
    font-weight: 600;
    color: #2d3436;
    position: relative;
}

.preview-block .preview-meta {
    font-size: 11px;
    color: #636e72;
    margin-top: 4px;
    position: relative;
}

.preview-block.gap {
    background: #f8f9fa;
    border-style: dashed;
    color: #486581;
    justify-content: center;
}

.layout-preview .preview-block {
    flex: 1 1 auto;
}

.dimension-status {
    font-size: 12px;
    color: #28a745;
    margin-top: 10px;
    min-height: 16px;
}

.dimension-status.info {
    color: #007bff;
}

.dimension-status.error {
    color: #d9534f;
}

.input-group label {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.input-group input {
    width: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.unit {
    font-size: 14px;
    color: #666;
}

.preset-buttons {
    display: flex;
    gap: 8px;
}

.btn-reset,
.btn-reset-input,
.btn-preset {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-reset:hover,
.btn-reset-input:hover,
.btn-preset:hover {
    background: #f5f5f5;
}

.btn-preset {
    background: #f9f9f9;
    color: #666;
}

/* 초기화 아이콘 버튼 */
.btn-reset-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-reset-icon:hover {
    background: #e9ecef;
    border-color: #999;
    color: #333;
    transform: rotate(180deg);
}

/* ???뱀뀡 */
.tab-section {
    margin: 30px 0 20px;
}

.tab-notice {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 12px;
}

.tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab.active {
    background: #fff;
    color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tab:hover:not(.active) {
    color: #000;
}

/* ??而⑦뀗痢?*/
.segment-section {
    margin-bottom: 28px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.color-summary {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    background: linear-gradient(135deg, #fbfbfb 0%, #ffffff 70%);
}

.color-entry {
    display: flex;
    align-items: center;
    gap: 16px;
}

.color-entry.empty .color-chip {
    background: #f1f1f1;
    background-image: none;
    border-style: dashed;
}

.color-chip {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.color-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.color-label {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a8a8a;
}

.color-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.color-desc {
    font-size: 13px;
    color: #6f6f6f;
}

.alert-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #856404;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000;
}

.section-title.small {
    font-size: 15px;
    margin-top: 0;
    border-bottom: 1px solid #dcdcdc;
}

/* 紐⑤뱢 洹몃━??*/
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.module-item {
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.module-item:hover {
    border-color: #ddd;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.module-item.selected {
    border-color: #000;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.segment-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.module-price {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

.segment-card {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.segment-card:hover {
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.segment-card.active {
    border-color: #000;
    background: #f4f6f8;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.segment-card .segment-title {
    font-weight: 600;
    font-size: 15px;
    color: #111;
}

.segment-card .segment-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.module-item img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #f5f5f5;
}

.module-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.module-desc {
    font-size: 12px;
    color: #999;
}

.module-notice {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.finish-section {
    margin-bottom: 30px;
}

.finish-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.finish-grid.color .finish-card {
    align-items: center;
    justify-content: center;
}

.finish-grid.color .finish-thumb {
    height: 180px;
}

.finish-card {
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.finish-card:hover {
    border-color: #ddd;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.finish-card.selected {
    border-color: #000;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.finish-card.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
}

.finish-card.disabled:hover {
    transform: none;
    border-color: #e0e0e0;
}

.finish-tag {
    margin-top: 10px;
    font-size: 10px;
    font-weight: 600;
    color: #666;
    letter-spacing: 0.06em;
}

.finish-thumb {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f0f0f0;
}

.finish-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.finish-meta {
    font-size: 12px;
    color: #777;
}

.finish-grid.body .finish-thumb {
    height: 120px;
}

/* 媛寃??뱀뀡 */
.price-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    font-size: 16px;
    font-weight: 600;
}

.price-value {
    font-size: 24px;
    font-weight: 700;
    color: #000;
}

/* ?붿샂 踰꾪듉 */
.btn-submit {
    width: 100%;
    padding: 20px;
    background: #000;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.btn-submit:hover {
    background: #222;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* ?됱긽 ?좏깮湲?*/
.color-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.color-option {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.color-option:hover {
    border-color: #999;
    transform: translateY(-2px);
}

.color-option.selected {
    border-color: #000;
    background: #f8f9fa;
}

.color-box {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    margin: 0 auto 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 뷰 버튼 */
.bottom-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.view-buttons {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.view-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    transform: translateY(-2px);
}

.view-btn.active {
    background: #000;
    color: #fff;
}

/* 토글 컨트롤 - 귀여운 스타일 */
.toggle-controls {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.toggle-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(240, 240, 240, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(0.5);
    opacity: 0.7;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
    filter: grayscale(0);
    opacity: 1;
}

.toggle-btn.active {
    background: #fff;
    filter: grayscale(0);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* 방 컨셉 선택 버튼 */
.room-concept-controls {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.room-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(240, 240, 240, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(0.5);
    opacity: 0.7;
}

.room-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
    filter: grayscale(0);
    opacity: 1;
}

.room-btn.active {
    background: #fff;
    filter: grayscale(0);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .viewer-section {
        min-height: 50vh;
    }

    #canvas3d {
        height: 50vh;
    }

    .options-panel {
        padding: 28px 32px 40px;
    }

    .view-buttons {
        top: 16px;
        right: 16px;
    }

    .size-display {
        top: 16px;
        left: 16px;
    }

    .module-grid,
    .finish-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .layout-preview {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .options-panel h1 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    body {
        background: #fff;
    }

    .viewer-section {
        min-height: 40vh;
    }

    #canvas3d {
        height: 40vh;
    }

    .options-panel {
        padding: 22px 20px 32px;
    }

    .module-grid,
    .finish-grid {
        grid-template-columns: 1fr;
    }

    .tab-section .tabs {
        gap: 8px;
    }

    .tab {
        flex: 1 1 auto;
        font-size: 14px;
    }

    .color-summary {
        padding: 16px;
        gap: 14px;
    }

    .color-chip {
        width: 60px;
        height: 60px;
        border-radius: 12px;
    }

    .price-section {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .view-buttons {
        top: auto;
        bottom: 12px;
        right: 12px;
    }

    .size-display {
        top: 12px;
        left: 12px;
    }
}


/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.premium-spinner {
    width: 32px;
    height: 32px;
    border: 1px solid #eee;
    border-top: 1px solid #000;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}