.mediasoft-code-editor {
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans-serif;
}

.code-editor-tabs {
    display: flex;
    background: linear-gradient(135deg,#f8fafc 0%,#f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,transparent,rgba(59,130,246,.1),transparent);
    transition: left .5s;
}

.tab-btn:hover::before { left: 100%; }
.tab-btn:hover {
    color: #3b82f6;
    background: rgba(59,130,246,.05);
}

.tab-btn.active {
    color: #1e40af;
    background: #fff;
    border-bottom-color: #3b82f6;
}

.code-editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 64px);
    position: relative;
}

.editor-panel {
    display: none;
    height: 100%;
    position: relative;
}

.editor-panel.active {
    display: flex;
    flex-direction: column;
}

.ace-editor {
    flex: 1;
    min-height: 400px;
}

.preview-panel {
    background: linear-gradient(135deg,#f8fafc 0%,#f1f5f9 100%);
}

#preview-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.preview-actions {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);
    transition: left .5s;
}

.btn:hover::before { left: 100%; }

.btn-primary { background: linear-gradient(135deg,#3b82f6,#1d4ed8); color: white; }
.btn-success { background: linear-gradient(135deg,#10b981,#059669); color: white; }
.btn-info { background: linear-gradient(135deg,#0ea5e9,#0284c7); color: white; }
.btn-purple { background: linear-gradient(135deg,#8b5cf6,#7c3aed); color: white; }
.btn-warning { background: linear-gradient(135deg,#f59e0b,#d97706); color: white; }

.btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .tab-btn { padding: 14px 16px; font-size: 13px; }
    .preview-actions { 
        flex-direction: column; 
        gap: 8px;
        padding: 16px;
    }
    .btn { width: 100%; }
}