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

body {
    font-family: monospace;
    background-color: #ffffff;
    color: #000000;
    overflow-x: hidden;
    word-break: keep-all;
}

.container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.nav {
    width: 30vw;
    min-width: 200px;
    height: 100vh;
    padding: 20px 20px;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav h1 {
    font-size: 1rem;
    font-weight: 500;
    background: #000000;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav h1 :hover {
    text-decoration: dotted;
}

.nav p {
    color: #000000;
    font-size: 1rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-links a {
    text-decoration: none;
    color: #000000;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
}

.nav-links a:hover {
    color:blue;
}

.nav-links a:hover::before {
    left: 100%;
}

/* 메인 콘텐츠 영역 */
.main-content {
    margin-left: 30vw;
    width: 70vw;
    height: 100vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-left: 10vw;
    padding-right: 5vw;
    background-color: #ffffff;
    z-index: 100;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: #cccccc;
}

.main-content::-webkit-scrollbar-thumb {
    background: #000000;
}
.content-wrapper {
    align-self: flex-start;
}

.content-section {
    margin-bottom: 20px;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 30px;
    padding-right: 80px;
    padding-left: 20px;
}

.content-section h2 {
    font-size: 1rem;
    font-weight: 500;
    color: #000000;
    margin-bottom: 30px;
    text-align: center;
}

/* 뷰포트 컨테이너 */
.viewport-container {
    position: relative;
    width: min(50vw, 1000px);
    height: calc(50vw * 0.5625); /* 16:9 비율 */
    max-height: 562.5px; /* 1200px * 0.5625 */
    overflow: hidden;
}

.content-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.controls {
    display: flex;
    justify-content: flex-start;
}

.code-btn, .open-btn {
    font-weight: bold;
    color: #000000;
    padding-top: 8px;
    font-family: monospace;
    font-size: 1rem;
}

.code-btn:hover, .open-btn:hover {
    color: blue;
}

.open-btn {
    padding: 8px 15px;
}

/* 코드 패널 스타일 */
.code-panel {
    position: fixed;
    top: 0;
    right: -30vw;
    width: 30vw;
    height: 100vh;
    background: #ffffff;
    z-index: 1000;
    transition: right 0.3s ease;
}



.close {
    color: #000000;
    font-size: 2rem;
    cursor: pointer;
    position: absolute;
    padding: 20px;
    justify-content: end;
}

.close:hover {
    color: blue;
}

.code-panel-body {
    padding: 20px;
    padding-top: 80px;
    height: calc(100vh - 40px);
    overflow-y: auto;
}

.code-panel-body::-webkit-scrollbar {
    width: 8px;
}

.code-panel-body::-webkit-scrollbar-track {
    background: #cccccc;
}

.code-panel-body::-webkit-scrollbar-thumb {
    background: #000000;
}

#codeDisplay {
    background: #f5f5f5;
    color: #000000;
    padding: 15px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

/* 메인 콘텐츠 전환 효과 */
.main-content {
    transition: margin-left 0.3s ease;
}



/* 반응형 디자인 */
@media screen and (max-width: 1024px) {
    .nav {
        width: 35vw;
        min-width: 250px;
    }
    
    .main-content {
        margin-left: 35vw;
        width: 65vw;
    }
    
    .viewport-container {
        width: min(80vw, 800px);
        height: calc(80vw * 0.5625);
        max-height: 450px;
    }
}

@media screen and (max-width: 768px) {
    .nav {
        width: 40vw;
        min-width: 220px;
        padding: 30px 20px;
    }
    
    .nav h1 {
        font-size: 2rem;
    }
    
    .nav p {
        font-size: 0.85rem;
    }
    
    .main-content {
        margin-left: 40vw;
        width: 60vw;
        padding: 20px;
    }
    
    .viewport-container {
        width: 90vw;
        height: calc(90vw * 0.5625);
    }
    
    .content-section h2 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
}
