/* src/main/resources/static/css/code-playground.css */

.playground-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* 서브 탭 */
.playground-sub-tabs {
    display: flex;
    gap: 4px;
    background-color: #F5F5F5;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 16px;
    width: fit-content;
}

.playground-sub-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playground-sub-tab:hover {
    color: #319C80;
}

.playground-sub-tab.active {
    background-color: #319C80;
    color: #fff;
}

/* 에디터 + 미리보기 컨테이너 */
.playground-container {
    display: flex;
    gap: 16px;
    min-height: 500px;
}

.playground-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.playground-preview {
    flex: 1;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
}

/* 코드 에디터 */
.playground-code-editor {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 500px;
    padding: 16px;
    border: 1px solid #D0D0D0;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    background-color: #1E1E1E;
    color: #D4D4D4;
    resize: none;
    box-sizing: border-box;
    tab-size: 2;
}

.playground-code-editor.active {
    display: block;
}

.playground-code-editor::placeholder {
    color: #6A6A6A;
}

.playground-code-editor:focus {
    outline: none;
    border-color: #319C80;
}

/* 미리보기 iframe */
.preview-iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
    background-color: #fff;
}

/* 버튼 영역 */
.playground-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.playground-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background-color: #319C80;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.playground-btn:hover {
    background-color: #28816c;
}

.playground-btn.secondary {
    background-color: #6c757d;
}

.playground-btn.secondary:hover {
    background-color: #5a6268;
}

/* 반응형 */
@media (max-width: 900px) {
    .playground-container {
        flex-direction: column;
    }

    .playground-code-editor {
        min-height: 350px;
    }

    .preview-iframe {
        min-height: 350px;
    }
}

@media (max-width: 600px) {
    .playground-wrapper {
        padding: 0 16px 30px;
    }

    .playground-sub-tabs {
        width: 100%;
        justify-content: center;
    }

    .playground-sub-tab {
        padding: 8px 16px;
        font-size: 13px;
    }

    .playground-code-editor {
        min-height: 280px;
        font-size: 13px;
    }

    .preview-iframe {
        min-height: 280px;
    }

    .playground-btn {
        padding: 10px 18px;
        font-size: 13px;
    }
}
