/* main.css */
:where([class^="ri-"])::before {
    content: "\f3c2";
}

.main-container {
    display: flex;
    overflow-x: auto; /* 브라우저가 작아지면 스크롤바 생성 */
    min-width: 0;
}

.sidebar, .editor-panel, .viewer-panel, .ad-panel {
    flex-shrink: 0; /* 패널이 자동으로 줄어들지 않도록 설정 */
    height: 100%;
}

.sidebar {
    width: 330px; /* 초기 너비 */
}

.editor-panel {
    width: 500px; /* 초기 너비 */
}

.viewer-panel {
    width: 400px; /* 초기 너비 */
    flex-grow: 1;
}

/* 광고 패널 스타일 */
.ad-panel {
    width: 200px; /* 광고 패널 고정 너비 */
    min-width: 200px;
}

/* 우측 사이드바 광고 */
.right-sidebar-ad {
    min-width: 300px;
    width: 320px;
    padding: 15px 10px;
}

.right-sidebar-ad .ad-container {
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 0.375rem;
    overflow: hidden;
}

.right-sidebar-ad .ad-container ins {
    display: block;
    width: 300px;
    height: 600px;
    margin: 0 auto;
}

/* 하단 고정 광고 */
.bottom-fixed-ad {
    position: fixed;
    left: 0;
    width: 100%;
    height: 90px;
    min-width: 320px;
    padding: 0 10px;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    bottom: 72px;
}

.bottom-fixed-ad .ad-container {
    max-width: 64rem;
    width: 100%;
    margin: 0 auto;
}

.bottom-fixed-ad .ad-container ins {
    display: block;
    width: 100%;
    min-width: 320px;
    height: 90px;
}

/* 다이어그램 컨테이너 */
.diagram-container {
    width: 100%;
    height: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    user-select: none;
}

.diagram-container .mermaid-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle {
    width: 5px;
    min-width: 5px;
    flex-shrink: 0;
    background: #ccc;
    cursor: ew-resize;
    transition: background 0.2s;
    height: 100%;
    align-self: stretch;
    z-index: 10;
}

.resize-handle:hover {
    background: #999;
}