/* インタラクティブエディタのスタイル */
.interactive-editor-section {
    margin: 2rem 0;
}

.code-playground {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 上部のエディタエリア */
.editor-container {
    border-bottom: 2px solid #2196F3;
    background: #1e1e1e;
}

/* タブボタンのスタイル */
.editor-tabs {
    display: flex;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #969696;
    transition: all 0.3s;
    position: relative;
    border-right: 1px solid #3e3e42;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: #1e1e1e;
    color: #cccccc;
}

.tab-btn.active {
    background: #1e1e1e;
    color: #fff;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #2196F3;
}

/* エディタパネル */
.editor-panel {
    height: 250px;
    position: relative;
    background: #1e1e1e;
}

.code-editor {
    width: 100%;
    height: 100%;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: none;
    resize: none;
    background: #1e1e1e;
    color: #d4d4d4;
    tab-size: 2;
    caret-color: #fff;
}

.code-editor:focus {
    outline: none;
    background: #1a1a1a;
}

.code-editor::placeholder {
    color: #666;
}

.code-editor::selection {
    background: #264f78;
    color: #fff;
}

/* 各エディタのdisplay管理 */
.editor-content {
    display: none;
}

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

/* 下部の結果プレビュー（常時表示） */
.preview-container {
    height: 350px;
    position: relative;
    background: #f5f5f5;
    border-top: 1px solid #3e3e42;
}

.preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* リアルタイム更新インジケータ */
.update-status {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    pointer-events: none;
}

.update-status.show {
    opacity: 1;
}

.update-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* プレビューラベル */
.preview-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #2196F3;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}